From 857aac9ae40a8a50a395803f1f2dacce8cf2e636 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Mon, 2 Apr 2018 17:44:04 -0700 Subject: [PATCH 1/2] Update gofmt for go1.10 --- .../serviceaccount/tokens_controller_test.go | 4 ++-- .../cmd/config/create_authinfo_test.go | 2 +- .../podsecuritypolicy/provider_test.go | 4 ++-- .../client-gen/generators/client_generator.go | 24 +++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pkg/controller/serviceaccount/tokens_controller_test.go b/pkg/controller/serviceaccount/tokens_controller_test.go index ca6a14f2392..cf0c4f854fa 100644 --- a/pkg/controller/serviceaccount/tokens_controller_test.go +++ b/pkg/controller/serviceaccount/tokens_controller_test.go @@ -474,7 +474,7 @@ func TestTokenCreation(t *testing.T) { AddedSecret: serviceAccountTokenSecretWithNamespaceData([]byte("custom")), ExpectedActions: []core.Action{ - // no update is performed... the custom namespace is preserved + // no update is performed... the custom namespace is preserved }, }, @@ -539,7 +539,7 @@ func TestTokenCreation(t *testing.T) { UpdatedSecret: serviceAccountTokenSecretWithNamespaceData([]byte("custom")), ExpectedActions: []core.Action{ - // no update is performed... the custom namespace is preserved + // no update is performed... the custom namespace is preserved }, }, diff --git a/pkg/kubectl/cmd/config/create_authinfo_test.go b/pkg/kubectl/cmd/config/create_authinfo_test.go index 16cd959106d..2b7fd1eddae 100644 --- a/pkg/kubectl/cmd/config/create_authinfo_test.go +++ b/pkg/kubectl/cmd/config/create_authinfo_test.go @@ -142,7 +142,7 @@ func TestCreateAuthInfoOptions(t *testing.T) { }, { flags: []string{ - // No name for authinfo provided. + // No name for authinfo provided. }, wantCompleteErr: true, }, diff --git a/pkg/security/podsecuritypolicy/provider_test.go b/pkg/security/podsecuritypolicy/provider_test.go index b651654dec2..983393eb127 100644 --- a/pkg/security/podsecuritypolicy/provider_test.go +++ b/pkg/security/podsecuritypolicy/provider_test.go @@ -1017,7 +1017,7 @@ func defaultPod() *api.Pod { }, Spec: api.PodSpec{ SecurityContext: &api.PodSecurityContext{ - // fill in for test cases + // fill in for test cases }, Containers: []api.Container{ { @@ -1041,7 +1041,7 @@ func defaultV1Pod() *v1.Pod { }, Spec: v1.PodSpec{ SecurityContext: &v1.PodSecurityContext{ - // fill in for test cases + // fill in for test cases }, Containers: []v1.Container{ { diff --git a/staging/src/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/staging/src/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go index 74af0b31d47..335e995c0a2 100644 --- a/staging/src/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ b/staging/src/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go @@ -44,10 +44,10 @@ func NameSystems() namer.NameSystems { publicNamer := &ExceptionNamer{ Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "EventResource" + // these exceptions are used to deconflict the generated code + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "EventResource" }, KeyFunc: func(t *types.Type) string { return t.Name.Package + "." + t.Name.Name @@ -56,10 +56,10 @@ func NameSystems() namer.NameSystems { } privateNamer := &ExceptionNamer{ Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "eventResource" + // these exceptions are used to deconflict the generated code + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "eventResource" }, KeyFunc: func(t *types.Type) string { return t.Name.Package + "." + t.Name.Name @@ -68,10 +68,10 @@ func NameSystems() namer.NameSystems { } publicPluralNamer := &ExceptionNamer{ Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "EventResource" + // these exceptions are used to deconflict the generated code + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "EventResource" }, KeyFunc: func(t *types.Type) string { return t.Name.Package + "." + t.Name.Name From 710c8563b4500c7a6175fa9a800fa660f561c148 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Mon, 2 Apr 2018 17:57:44 -0700 Subject: [PATCH 2/2] Fix go vet errors --- test/e2e/scheduling/nvidia-gpus.go | 2 +- test/e2e_node/runner/remote/run_remote.go | 16 ++++++++-------- test/integration/master/synthetic_master_test.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/e2e/scheduling/nvidia-gpus.go b/test/e2e/scheduling/nvidia-gpus.go index 93dc4e1eee0..44a4f30f8b3 100644 --- a/test/e2e/scheduling/nvidia-gpus.go +++ b/test/e2e/scheduling/nvidia-gpus.go @@ -199,7 +199,7 @@ func SetupNVIDIAGPUNode(f *framework.Framework, setupResourceGatherer bool) *fra var rsgather *framework.ContainerResourceGatherer if setupResourceGatherer { framework.Logf("Starting ResourceUsageGather for the created DaemonSet pods.") - rsgather, err = framework.NewResourceUsageGatherer(f.ClientSet, framework.ResourceGathererOptions{false, false, 2 * time.Second, 2 * time.Second, true}, pods) + rsgather, err = framework.NewResourceUsageGatherer(f.ClientSet, framework.ResourceGathererOptions{InKubemark: false, MasterOnly: false, ResourceDataGatheringPeriod: 2 * time.Second, ProbeDuration: 2 * time.Second, PrintVerboseLogs: true}, pods) framework.ExpectNoError(err, "creating ResourceUsageGather for the daemonset pods") go rsgather.StartGatheringData() } diff --git a/test/e2e_node/runner/remote/run_remote.go b/test/e2e_node/runner/remote/run_remote.go index 054d1cbed57..7c440ad96b6 100644 --- a/test/e2e_node/runner/remote/run_remote.go +++ b/test/e2e_node/runner/remote/run_remote.go @@ -134,7 +134,7 @@ type ImageConfig struct { type Accelerator struct { Type string `json:"type,omitempty"` - Count int64 `json:"count, omitempty"` + Count int64 `json:"count,omitempty"` } type Resources struct { @@ -142,19 +142,19 @@ type Resources struct { } type GCEImage struct { - Image string `json:"image, omitempty"` - ImageDesc string `json:"image_description, omitempty"` + Image string `json:"image,omitempty"` + ImageDesc string `json:"image_description,omitempty"` Project string `json:"project"` Metadata string `json:"metadata"` - ImageRegex string `json:"image_regex, omitempty"` + ImageRegex string `json:"image_regex,omitempty"` // Defaults to using only the latest image. Acceptable values are [0, # of images that match the regex). // If the number of existing previous images is lesser than what is desired, the test will use that is available. - PreviousImages int `json:"previous_images, omitempty"` + PreviousImages int `json:"previous_images,omitempty"` - Machine string `json:"machine, omitempty"` - Resources Resources `json:"resources, omitempty"` + Machine string `json:"machine,omitempty"` + Resources Resources `json:"resources,omitempty"` // This test is for benchmark (no limit verification, more result log, node name has format 'machine-image-uuid') if 'Tests' is non-empty. - Tests []string `json:"tests, omitempty"` + Tests []string `json:"tests,omitempty"` } type internalImageConfig struct { diff --git a/test/integration/master/synthetic_master_test.go b/test/integration/master/synthetic_master_test.go index 90d5350d6f3..ff44c2c1f10 100644 --- a/test/integration/master/synthetic_master_test.go +++ b/test/integration/master/synthetic_master_test.go @@ -666,7 +666,7 @@ func TestUpdateNodeObjects(t *testing.T) { go func(lister int) { w, err := c.Nodes().Watch(metav1.ListOptions{}) if err != nil { - fmt.Printf("[watch:%d] error: %v", k, err) + fmt.Printf("[watch:%d] error: %v", lister, err) return } i := 0