Skip to content

Commit

Permalink
Documentation updates for comments in istio#40255 (istio#40258)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Van Norman authored Aug 4, 2022
1 parent 9337dd9 commit 93e4ec4
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 69 deletions.
5 changes: 2 additions & 3 deletions cni/pkg/repair/repair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,8 @@ func TestBrokenPodReconciler_detectPod(t *testing.T) {

// Test the ListBrokenPods function
// TODO:(stewartbutler) Add some simple field selector filter test logic to the client-go
//
// fake client. The fake client does NOT support filtering by field selector,
// so we need to add that ourselves to complete the test.
// fake client. The fake client does NOT support filtering by field selector,
// so we need to add that ourselves to complete the test.
func TestBrokenPodReconciler_listBrokenPods(t *testing.T) {
type fields struct {
client kubernetes.Interface
Expand Down
27 changes: 12 additions & 15 deletions operator/pkg/patch/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,18 @@ Paths are specified in the form a.b.c.[key:value].d.[list_entry_value], where:
Some examples are given below. Given a resource:
kind: Deployment
metadata:
name: istio-citadel
namespace: istio-system
a:
b:
- name: n1
value: v1
- name: n2
list:
- "vv1"
- vv2=foo
kind: Deployment
metadata:
name: istio-citadel
namespace: istio-system
a:
b:
- name: n1
value: v1
- name: n2
list:
- "vv1"
- vv2=foo
values and list entries can be added, modifed or deleted.
Expand Down
9 changes: 4 additions & 5 deletions pkg/dns/client/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,10 @@ func testDNS(t *testing.T, d *LocalDNSServer) {
}

// Baseline:
//
// ~150us via agent if cached for A/AAAA
// ~300us via agent when doing the cname redirect
// 5-6ms to upstream resolver directly
// 6-7ms via agent to upstream resolver (cache miss)
// - ~150us via agent if cached for A/AAAA
// - ~300us via agent when doing the cname redirect
// - 5-6ms to upstream resolver directly
// - 6-7ms via agent to upstream resolver (cache miss)
//
// Also useful for load testing is using dnsperf. This can be run with:
//
Expand Down
3 changes: 1 addition & 2 deletions pkg/istio-agent/health/health_probers.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ func NewHTTPProber(cfg *v1alpha3.HTTPHealthCheckConfig, ipv6 bool) *HTTPProber {
}

// HttpProber_Probe will return whether or not the target is healthy (true -> healthy)
//
// by making an HTTP Get response.
// by making an HTTP Get response.
func (h *HTTPProber) Probe(timeout time.Duration) (ProbeResult, error) {
client := &http.Client{
Timeout: timeout,
Expand Down
4 changes: 1 addition & 3 deletions pkg/kube/inject/initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ import (
// "kube-system": The namespace for objects created by the Kubernetes system.
// "kube-public": This namespace is mostly reserved for cluster usage.
// "kube-node-lease": This namespace for the lease objects associated with each node
//
// which improves the performance of the node heartbeats as the cluster scales.
//
// which improves the performance of the node heartbeats as the cluster scales.
// "local-path-storage": Dynamically provisioning persistent local storage with Kubernetes.
//
// used with Kind cluster: https://github.com/rancher/local-path-provisioner
Expand Down
16 changes: 7 additions & 9 deletions pkg/test/framework/components/echo/echotest/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ func (t *T) ConditionallyTo(filters ...CombinationFilter) *T {

// WithDefaultFilters applies common filters that work for most tests.
// Example:
//
// The full set of apps is a, b, c, headless, naked, and vm (one simple pod).
// Only a, headless, naked and vm are used as sources.
// Subtests are generated only for reachable destinations.
// Pod a will not be in destinations, but b will (one simpe pod not in sources)
// - The full set of apps is a, b, c, headless, naked, and vm (one simple pod).
// - Only a, headless, naked and vm are used as sources.
// - Subtests are generated only for reachable destinations.
// - Pod a will not be in destinations, but b will (one simpe pod not in sources)
func (t *T) WithDefaultFilters(minimumFrom, minimumTo int) *T {
return t.
From(FilterMatch(match.NotExternal)).
Expand All @@ -97,10 +96,9 @@ func (t *T) applyCombinationFilters(from echo.Instance, to echo.Instances) echo.
// other "regular" pods that aren't part of the same Service. Pods that are part of the same Service but are in a
// different cluster or revision will still be included.
// Example:
//
// The full set of apps is a, b, c, headless, naked, and vm.
// The plain-pods are a, b and c.
// This filter would result in a, headless, naked and vm.
// - The full set of apps is a, b, c, headless, naked, and vm.
// - The plain-pods are a, b and c.
// - This filter would result in a, headless, naked and vm.
//
// TODO this name is not good
func SimplePodServiceAndAllSpecial(min int, exclude ...echo.Instance) Filter {
Expand Down
9 changes: 4 additions & 5 deletions pkg/test/framework/components/echo/echotest/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,10 @@ func (t *T) fromEachCluster(ctx framework.TestContext, testFn perClusterTest) {
// may appear as a target in multiple subtests.
//
// Example: Given a as the only source, with a, b, c, d as destinationsand n = 3, we get the following subtests:
//
// a/to_a_b_c/from_cluster_1:
// a/to_a_b_c/from_cluster_2:
// a/to_b_c_d/from_cluster_1:
// a/to_b_c_d/from_cluster_2:
// - a/to_a_b_c/from_cluster_1:
// - a/to_a_b_c/from_cluster_2:
// - a/to_b_c_d/from_cluster_1:
// - a/to_b_c_d/from_cluster_2:
func (t *T) RunToN(n int, testFn oneToNTest) {
t.fromEachDeployment(t.rootCtx, func(ctx framework.TestContext, from echo.Instances) {
t.setup(ctx, from.Callers())
Expand Down
26 changes: 12 additions & 14 deletions pkg/test/framework/components/echo/echotest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ type (
//
// For example, given apps a, b, and c in 2 clusters,
// these tests would all run before the context is cleaned up:
//
// a/to_b/from_cluster-1
// a/to_b/from_cluster-2
// a/to_c/from_cluster-1
// a/to_c/from_cluster-2
// cleanup...
// b/to_a/from_cluster-1
// ...
// - a/to_b/from_cluster-1
// - a/to_b/from_cluster-2
// - a/to_c/from_cluster-1
// - a/to_c/from_cluster-2
// - cleanup...
// - b/to_a/from_cluster-1
// ...
func (t *T) Setup(setupFn srcSetupFn) *T {
t.sourceDeploymentSetup = append(t.sourceDeploymentSetup, setupFn)
return t
Expand All @@ -63,12 +62,11 @@ func (t *T) hasSourceSetup() bool {
// destination service.
//
// Example of how long this setup lasts before the given context is cleaned up:
//
// a/to_b/from_cluster-1
// a/to_b/from_cluster-2
// cleanup...
// a/to_b/from_cluster-2
// ...
// - a/to_b/from_cluster-1
// - a/to_b/from_cluster-2
// - cleanup...
// - a/to_b/from_cluster-2
// - ...
func (t *T) SetupForPair(setupFn func(ctx framework.TestContext, from echo.Callers, dsts echo.Instances) error) *T {
return t.SetupForServicePair(func(ctx framework.TestContext, from echo.Callers, dsts echo.Services) error {
return setupFn(ctx, from, dsts.Instances())
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/framework/components/istio/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ func waitForIstioReady(ctx resource.Context, c cluster.Cluster, cfg Config) erro
return nil
}

// configureDirectAPIServiceAccessBetweenClusters - create a remote secret of cluster `c and place
// configureDirectAPIServiceAccessBetweenClusters - create a remote secret of cluster `c` and place
// the secret in all `from` clusters
func (i *istioImpl) configureDirectAPIServiceAccessBetweenClusters(c cluster.Cluster, from ...cluster.Cluster) error {
// Create a secret.
Expand Down
26 changes: 14 additions & 12 deletions tools/bug-report/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ const (
//
// Examples:
//
// 1. All pods in test-namespace with label "test=foo" but without label "private" (with any value):
// include:
// test-namespace/*/*/test=foo
// exclude:
// test-namespace/*/*/private
// 1. All pods in test-namespace with label "test=foo" but without label "private" (with any value):
//
// include:
// test-namespace/*/*/test=foo
// exclude:
// test-namespace/*/*/private
//
// 2. Pods in all namespaces except "kube-system" with annotation "revision"
// matching wildcard 1.6*:
Expand All @@ -65,14 +66,15 @@ const (
// 3. Pods with "prometheus" in the name, except those with
// the annotation "internal=true":
//
// include:
// */*/*prometheus*
// exclude:
// */*/*prometheus*/*/internal=true
// include:
// */*/*prometheus*
// exclude:
// */*/*prometheus*/*/internal=true
//
// 4. Container logs for all containers called "istio-proxy":
//
// 4. Container logs for all containers called "istio-proxy":
// include:
// */*/*/*/*/istio-proxy
// include:
// */*/*/*/*/istio-proxy
type SelectionSpec struct {
Namespaces []string `json:"namespaces,omitempty"`
Deployments []string `json:"deployments,omitempty"`
Expand Down

0 comments on commit 93e4ec4

Please sign in to comment.