From df6c6fd15d44d49059542dc02cc9980f7b91bea8 Mon Sep 17 00:00:00 2001 From: David Eads Date: Tue, 9 Apr 2019 19:01:04 -0400 Subject: [PATCH 1/2] use go 1.11 gofmt --- pkg/apps/apis/apps/v1/defaults_test.go | 6 +- .../apis/apps/validation/validation_test.go | 2 +- pkg/apps/strategy/support/lifecycle_test.go | 4 +- .../clusterresourceoverride/v1/swagger_doc.go | 2 +- .../apis/runonceduration/v1/swagger_doc.go | 2 +- .../runonceduration/admission_test.go | 36 ++--- .../apiserver/registry/buildconfig/webhook.go | 8 +- .../controller/build/build_controller_test.go | 2 +- pkg/build/controller/common/util_test.go | 2 +- pkg/build/controller/strategy/docker.go | 16 +- pkg/build/controller/strategy/sti.go | 16 +- pkg/build/generator/generator_test.go | 6 +- pkg/build/generator/test/mocks.go | 2 +- .../openshiftapiserver/openshift_apiserver.go | 18 +-- pkg/cmd/server/admin/create_kubeconfig.go | 4 +- .../apis/config/validation/master_test.go | 2 +- .../apis/image/validation/validation_test.go | 24 +-- .../validation/whitelist/whitelister_test.go | 2 +- .../admission/imagepolicy/rules/accept.go | 2 +- .../registry/imagestream/strategy.go | 2 +- .../registry/imagestream/strategy_test.go | 4 +- .../password/ldappassword/ldap.go | 12 +- pkg/oc/cli/admin/node/logs.go | 8 +- .../cli/admin/prune/imageprune/prune_test.go | 144 +++++++++--------- .../admin/prune/imageprune/testutil/util.go | 2 +- pkg/oc/cli/importimage/importimage_test.go | 18 +-- pkg/oc/cli/tag/tag_test.go | 2 +- pkg/oc/lib/groupsync/grouplister.go | 14 +- pkg/oc/lib/newapp/app/app_test.go | 2 +- pkg/oc/lib/newapp/app/pipeline.go | 10 +- .../apis/route/validation/validation_test.go | 8 +- .../apis/ingressadmission/v1/swagger_doc.go | 2 +- pkg/route/controller/ingress/ingress.go | 6 +- pkg/route/controller/ingress/ingress_test.go | 20 +-- .../apis/podnodeconstraints/v1/swagger_doc.go | 2 +- .../admission/nodeenv/admission_test.go | 8 +- .../controllers/create_dockercfg_secrets.go | 4 +- .../servicebroker/catalog_test.go | 4 +- test/extended/images/hardprune.go | 8 +- test/extended/util/test.go | 22 +-- ...oauth_serviceaccount_client_events_test.go | 12 +- .../oauth_serviceaccount_client_test.go | 60 ++++---- 42 files changed, 265 insertions(+), 265 deletions(-) diff --git a/pkg/apps/apis/apps/v1/defaults_test.go b/pkg/apps/apis/apps/v1/defaults_test.go index 27acbf083419..44171a6c95fd 100644 --- a/pkg/apps/apis/apps/v1/defaults_test.go +++ b/pkg/apps/apis/apps/v1/defaults_test.go @@ -136,7 +136,7 @@ func TestDefaults(t *testing.T) { DNSPolicy: kapiv1.DNSClusterFirst, Containers: []kapiv1.Container{ { - Name: "test", + Name: "test", TerminationMessagePath: "/dev/termination-log", TerminationMessagePolicy: kapiv1.TerminationMessageReadFile, // The pull policy will be "PullAlways" only when the @@ -392,7 +392,7 @@ func TestDefaults(t *testing.T) { Spec: kapiv1.PodSpec{ Containers: []kapiv1.Container{ { - Name: "first", + Name: "first", TerminationMessagePath: "/dev/termination-log", TerminationMessagePolicy: kapiv1.TerminationMessageReadFile, ImagePullPolicy: kapiv1.PullIfNotPresent, @@ -464,7 +464,7 @@ func TestDefaults(t *testing.T) { Spec: kapiv1.PodSpec{ Containers: []kapiv1.Container{ { - Name: "first", + Name: "first", TerminationMessagePath: "/dev/termination-log", TerminationMessagePolicy: kapiv1.TerminationMessageReadFile, ImagePullPolicy: kapiv1.PullIfNotPresent, diff --git a/pkg/apps/apis/apps/validation/validation_test.go b/pkg/apps/apis/apps/validation/validation_test.go index dc77c7245c3c..3190a50e26b5 100644 --- a/pkg/apps/apis/apps/validation/validation_test.go +++ b/pkg/apps/apis/apps/validation/validation_test.go @@ -274,7 +274,7 @@ func TestValidateDeploymentConfigMissingFields(t *testing.T) { Triggers: manualTrigger(), Selector: appstest.OkSelector(), Strategy: appsapi.DeploymentStrategy{ - Type: appsapi.DeploymentStrategyTypeCustom, + Type: appsapi.DeploymentStrategyTypeCustom, ActiveDeadlineSeconds: mkint64p(3600), }, Template: appstest.OkPodTemplate(), diff --git a/pkg/apps/strategy/support/lifecycle_test.go b/pkg/apps/strategy/support/lifecycle_test.go index 318e4f29a286..5d0977289e75 100644 --- a/pkg/apps/strategy/support/lifecycle_test.go +++ b/pkg/apps/strategy/support/lifecycle_test.go @@ -388,7 +388,7 @@ func TestHookExecutor_makeHookPod(t *testing.T) { Labels: map[string]string{ "openshift.io/deployer-pod.type": "hook", appsv1.DeployerPodForDeploymentLabel: deploymentName, - "label1": "value1", + "label1": "value1", }, Annotations: map[string]string{ appsv1.DeploymentAnnotation: deploymentName, @@ -437,7 +437,7 @@ func TestHookExecutor_makeHookPod(t *testing.T) { }, strategyLabels: map[string]string{ appsv1.DeployerPodForDeploymentLabel: "ignoredValue", - "label1": "value1", + "label1": "value1", }, strategyAnnotations: map[string]string{"annotation2": "value2"}, }, diff --git a/pkg/autoscaling/admission/apis/clusterresourceoverride/v1/swagger_doc.go b/pkg/autoscaling/admission/apis/clusterresourceoverride/v1/swagger_doc.go index aba13eeb1217..f909b0db2ee4 100644 --- a/pkg/autoscaling/admission/apis/clusterresourceoverride/v1/swagger_doc.go +++ b/pkg/autoscaling/admission/apis/clusterresourceoverride/v1/swagger_doc.go @@ -6,7 +6,7 @@ package v1 // ==== DO NOT EDIT THIS FILE MANUALLY ==== var map_ClusterResourceOverrideConfig = map[string]string{ - "": "ClusterResourceOverrideConfig is the configuration for the ClusterResourceOverride admission controller which overrides user-provided container request/limit values.", + "": "ClusterResourceOverrideConfig is the configuration for the ClusterResourceOverride admission controller which overrides user-provided container request/limit values.", "limitCPUToMemoryPercent": "For each of the following, if a non-zero ratio is specified then the initial value (if any) in the pod spec is overwritten according to the ratio. LimitRange defaults are merged prior to the override.\n\nLimitCPUToMemoryPercent (if > 0) overrides the CPU limit to a ratio of the memory limit; 100% overrides CPU to 1 core per 1GiB of RAM. This is done before overriding the CPU request.", "cpuRequestToLimitPercent": "CPURequestToLimitPercent (if > 0) overrides CPU request to a percentage of CPU limit", "memoryRequestToLimitPercent": "MemoryRequestToLimitPercent (if > 0) overrides memory request to a percentage of memory limit", diff --git a/pkg/autoscaling/admission/apis/runonceduration/v1/swagger_doc.go b/pkg/autoscaling/admission/apis/runonceduration/v1/swagger_doc.go index d8570bbe89a7..1cb7c3cdb319 100644 --- a/pkg/autoscaling/admission/apis/runonceduration/v1/swagger_doc.go +++ b/pkg/autoscaling/admission/apis/runonceduration/v1/swagger_doc.go @@ -6,7 +6,7 @@ package v1 // ==== DO NOT EDIT THIS FILE MANUALLY ==== var map_RunOnceDurationConfig = map[string]string{ - "": "RunOnceDurationConfig is the configuration for the RunOnceDuration plugin. It specifies a maximum value for ActiveDeadlineSeconds for a run-once pod. The project that contains the pod may specify a different setting. That setting will take precedence over the one configured for the plugin here.", + "": "RunOnceDurationConfig is the configuration for the RunOnceDuration plugin. It specifies a maximum value for ActiveDeadlineSeconds for a run-once pod. The project that contains the pod may specify a different setting. That setting will take precedence over the one configured for the plugin here.", "activeDeadlineSecondsOverride": "ActiveDeadlineSecondsOverride is the maximum value to set on containers of run-once pods Only a positive value is valid. Absence of a value means that the plugin won't make any changes to the pod It is kept this way for compatibility. Only change it in a new version of the API.", } diff --git a/pkg/autoscaling/admission/runonceduration/admission_test.go b/pkg/autoscaling/admission/runonceduration/admission_test.go index 6b8a0b308605..8e93f9b1605a 100644 --- a/pkg/autoscaling/admission/runonceduration/admission_test.go +++ b/pkg/autoscaling/admission/runonceduration/admission_test.go @@ -67,27 +67,27 @@ func TestRunOnceDurationAdmit(t *testing.T) { expectedActiveDeadlineSeconds *int64 }{ { - name: "expect globally configured duration to be set", - config: testConfig(int64p(10)), - pod: testRunOncePod(), + name: "expect globally configured duration to be set", + config: testConfig(int64p(10)), + pod: testRunOncePod(), expectedActiveDeadlineSeconds: int64p(10), }, { - name: "empty config, no duration to be set", - config: testConfig(nil), - pod: testRunOncePod(), + name: "empty config, no duration to be set", + config: testConfig(nil), + pod: testRunOncePod(), expectedActiveDeadlineSeconds: nil, }, { - name: "expect configured duration to not limit lower existing duration", - config: testConfig(int64p(10)), - pod: testRunOncePodWithDuration(5), + name: "expect configured duration to not limit lower existing duration", + config: testConfig(int64p(10)), + pod: testRunOncePodWithDuration(5), expectedActiveDeadlineSeconds: int64p(5), }, { - name: "expect empty config to not limit existing duration", - config: testConfig(nil), - pod: testRunOncePodWithDuration(5), + name: "expect empty config to not limit existing duration", + config: testConfig(nil), + pod: testRunOncePodWithDuration(5), expectedActiveDeadlineSeconds: int64p(5), }, { @@ -118,15 +118,15 @@ func TestRunOnceDurationAdmit(t *testing.T) { expectedActiveDeadlineSeconds: int64p(1000), }, { - name: "make no change to a pod that is not a run-once pod", - config: testConfig(int64p(10)), - pod: testRestartAlwaysPod(), + name: "make no change to a pod that is not a run-once pod", + config: testConfig(int64p(10)), + pod: testRestartAlwaysPod(), expectedActiveDeadlineSeconds: nil, }, { - name: "update a pod that has a RestartOnFailure policy", - config: testConfig(int64p(10)), - pod: testRestartOnFailurePod(), + name: "update a pod that has a RestartOnFailure policy", + config: testConfig(int64p(10)), + pod: testRestartOnFailurePod(), expectedActiveDeadlineSeconds: int64p(10), }, } diff --git a/pkg/build/apiserver/registry/buildconfig/webhook.go b/pkg/build/apiserver/registry/buildconfig/webhook.go index cd7a60765ee2..2a247630b2f0 100644 --- a/pkg/build/apiserver/registry/buildconfig/webhook.go +++ b/pkg/build/apiserver/registry/buildconfig/webhook.go @@ -164,10 +164,10 @@ func (w *WebHookHandler) ProcessWebHook(writer http.ResponseWriter, req *http.Re buildTriggerCauses := webhook.GenerateBuildTriggerInfo(revision, hookType) request := &buildv1.BuildRequest{ - TriggeredBy: buildTriggerCauses, - ObjectMeta: metav1.ObjectMeta{Name: name}, - Revision: revision, - Env: envvars, + TriggeredBy: buildTriggerCauses, + ObjectMeta: metav1.ObjectMeta{Name: name}, + Revision: revision, + Env: envvars, DockerStrategyOptions: dockerStrategyOptions, } diff --git a/pkg/build/controller/build/build_controller_test.go b/pkg/build/controller/build/build_controller_test.go index 93b07832b2f6..d1073727726f 100644 --- a/pkg/build/controller/build/build_controller_test.go +++ b/pkg/build/controller/build/build_controller_test.go @@ -1673,7 +1673,7 @@ func mockBuild(phase buildv1.BuildPhase, output buildv1.BuildOutput) *buildv1.Bu buildutil.BuildConfigAnnotation: "test-bc", }, Labels: map[string]string{ - "name": "dataBuild", + "name": "dataBuild", buildutil.BuildRunPolicyLabel: string(buildv1.BuildRunPolicyParallel), buildutil.BuildConfigLabel: "test-bc", }, diff --git a/pkg/build/controller/common/util_test.go b/pkg/build/controller/common/util_test.go index 3b93b1591390..025223b03313 100644 --- a/pkg/build/controller/common/util_test.go +++ b/pkg/build/controller/common/util_test.go @@ -47,7 +47,7 @@ func mockBuild(name string, phase buildv1.BuildPhase, stamp *metav1.Time) buildv Namespace: "namespace", CreationTimestamp: *stamp, Labels: map[string]string{ - "app": appName[0], + "app": appName[0], buildutil.BuildConfigLabel: fmt.Sprintf("%v-build", appName[0]), "buildconfig": fmt.Sprintf("%v-build", appName[0]), }, diff --git a/pkg/build/controller/strategy/docker.go b/pkg/build/controller/strategy/docker.go index 1594f4196280..ed56f7bc4b51 100644 --- a/pkg/build/controller/strategy/docker.go +++ b/pkg/build/controller/strategy/docker.go @@ -115,10 +115,10 @@ func (bs *DockerBuildStrategy) CreateBuildPod(build *buildv1.Build, additionalCA // (also if it's a docker type build, we should always have a dockerfile to manage) if build.Spec.Source.Git != nil || build.Spec.Source.Binary != nil { gitCloneContainer := v1.Container{ - Name: GitCloneContainer, - Image: bs.Image, - Command: []string{"openshift-git-clone"}, - Env: copyEnvVarSlice(containerEnv), + Name: GitCloneContainer, + Image: bs.Image, + Command: []string{"openshift-git-clone"}, + Env: copyEnvVarSlice(containerEnv), TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, VolumeMounts: []v1.VolumeMount{ { @@ -166,10 +166,10 @@ func (bs *DockerBuildStrategy) CreateBuildPod(build *buildv1.Build, additionalCA } pod.Spec.InitContainers = append(pod.Spec.InitContainers, v1.Container{ - Name: "manage-dockerfile", - Image: bs.Image, - Command: []string{"openshift-manage-dockerfile"}, - Env: copyEnvVarSlice(containerEnv), + Name: "manage-dockerfile", + Image: bs.Image, + Command: []string{"openshift-manage-dockerfile"}, + Env: copyEnvVarSlice(containerEnv), TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, VolumeMounts: []v1.VolumeMount{ { diff --git a/pkg/build/controller/strategy/sti.go b/pkg/build/controller/strategy/sti.go index 67b3cdee2e6d..989b0282f524 100644 --- a/pkg/build/controller/strategy/sti.go +++ b/pkg/build/controller/strategy/sti.go @@ -120,10 +120,10 @@ func (bs *SourceBuildStrategy) CreateBuildPod(build *buildv1.Build, additionalCA if build.Spec.Source.Git != nil || build.Spec.Source.Binary != nil { gitCloneContainer := corev1.Container{ - Name: GitCloneContainer, - Image: bs.Image, - Command: []string{"openshift-git-clone"}, - Env: copyEnvVarSlice(containerEnv), + Name: GitCloneContainer, + Image: bs.Image, + Command: []string{"openshift-git-clone"}, + Env: copyEnvVarSlice(containerEnv), TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError, VolumeMounts: []corev1.VolumeMount{ { @@ -171,10 +171,10 @@ func (bs *SourceBuildStrategy) CreateBuildPod(build *buildv1.Build, additionalCA } pod.Spec.InitContainers = append(pod.Spec.InitContainers, corev1.Container{ - Name: "manage-dockerfile", - Image: bs.Image, - Command: []string{"openshift-manage-dockerfile"}, - Env: copyEnvVarSlice(containerEnv), + Name: "manage-dockerfile", + Image: bs.Image, + Command: []string{"openshift-manage-dockerfile"}, + Env: copyEnvVarSlice(containerEnv), TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError, VolumeMounts: []corev1.VolumeMount{ { diff --git a/pkg/build/generator/generator_test.go b/pkg/build/generator/generator_test.go index 26a680617f4c..69f44371c171 100644 --- a/pkg/build/generator/generator_test.go +++ b/pkg/build/generator/generator_test.go @@ -1035,7 +1035,7 @@ func TestGenerateBuildWithImageTagForSourceStrategyImageRepository(t *testing.T) ObjectMeta: metav1.ObjectMeta{Name: imageRepoName}, Status: imagev1.ImageStreamStatus{ DockerImageRepository: originalImage, - Tags: is.Status.Tags, + Tags: is.Status.Tags, }, }, nil }, @@ -1106,7 +1106,7 @@ func TestGenerateBuildWithImageTagForDockerStrategyImageRepository(t *testing.T) ObjectMeta: metav1.ObjectMeta{Name: imageRepoName}, Status: imagev1.ImageStreamStatus{ DockerImageRepository: originalImage, - Tags: is.Status.Tags, + Tags: is.Status.Tags, }, }, nil }, @@ -1176,7 +1176,7 @@ func TestGenerateBuildWithImageTagForCustomStrategyImageRepository(t *testing.T) ObjectMeta: metav1.ObjectMeta{Name: imageRepoName}, Status: imagev1.ImageStreamStatus{ DockerImageRepository: originalImage, - Tags: is.Status.Tags, + Tags: is.Status.Tags, }, }, nil }, diff --git a/pkg/build/generator/test/mocks.go b/pkg/build/generator/test/mocks.go index 3b8826c40f80..966411402398 100644 --- a/pkg/build/generator/test/mocks.go +++ b/pkg/build/generator/test/mocks.go @@ -191,7 +191,7 @@ func MockImageStream(repoName, dockerImageRepo string, tags map[string]string) * }, Status: imagev1.ImageStreamStatus{ DockerImageRepository: dockerImageRepo, - Tags: tagHistory, + Tags: tagHistory, }, } } diff --git a/pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go b/pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go index 54b22952522c..e7d74991a57c 100644 --- a/pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go +++ b/pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go @@ -169,8 +169,8 @@ func (c *completedConfig) withAppsAPIServer(delegateAPIServer genericapiserver.D GenericConfig: &genericapiserver.RecommendedConfig{Config: *c.GenericConfig.Config, SharedInformerFactory: c.GenericConfig.SharedInformerFactory}, ExtraConfig: oappsapiserver.ExtraConfig{ KubeAPIServerClientConfig: c.ExtraConfig.KubeAPIServerClientConfig, - Codecs: legacyscheme.Codecs, - Scheme: legacyscheme.Scheme, + Codecs: legacyscheme.Codecs, + Scheme: legacyscheme.Scheme, }, } config := cfg.Complete() @@ -211,8 +211,8 @@ func (c *completedConfig) withBuildAPIServer(delegateAPIServer genericapiserver. GenericConfig: &genericapiserver.RecommendedConfig{Config: *c.GenericConfig.Config, SharedInformerFactory: c.GenericConfig.SharedInformerFactory}, ExtraConfig: buildapiserver.ExtraConfig{ KubeAPIServerClientConfig: c.ExtraConfig.KubeAPIServerClientConfig, - Codecs: legacyscheme.Codecs, - Scheme: legacyscheme.Scheme, + Codecs: legacyscheme.Codecs, + Scheme: legacyscheme.Scheme, }, } config := cfg.Complete() @@ -233,9 +233,9 @@ func (c *completedConfig) withImageAPIServer(delegateAPIServer genericapiserver. RegistryHostnameRetriever: c.ExtraConfig.RegistryHostnameRetriever, AllowedRegistriesForImport: c.ExtraConfig.AllowedRegistriesForImport, MaxImagesBulkImportedPerRepository: c.ExtraConfig.MaxImagesBulkImportedPerRepository, - Codecs: legacyscheme.Codecs, - Scheme: legacyscheme.Scheme, - AdditionalTrustedCA: c.ExtraConfig.AdditionalTrustedCA, + Codecs: legacyscheme.Codecs, + Scheme: legacyscheme.Scheme, + AdditionalTrustedCA: c.ExtraConfig.AdditionalTrustedCA, }, } config := cfg.Complete() @@ -377,8 +377,8 @@ func (c *completedConfig) withTemplateAPIServer(delegateAPIServer genericapiserv GenericConfig: &genericapiserver.RecommendedConfig{Config: *c.GenericConfig.Config, SharedInformerFactory: c.GenericConfig.SharedInformerFactory}, ExtraConfig: templateapiserver.ExtraConfig{ KubeAPIServerClientConfig: c.ExtraConfig.KubeAPIServerClientConfig, - Codecs: legacyscheme.Codecs, - Scheme: legacyscheme.Scheme, + Codecs: legacyscheme.Codecs, + Scheme: legacyscheme.Scheme, }, } config := cfg.Complete() diff --git a/pkg/cmd/server/admin/create_kubeconfig.go b/pkg/cmd/server/admin/create_kubeconfig.go index 6b2910b4a5f2..ed43204dd2db 100644 --- a/pkg/cmd/server/admin/create_kubeconfig.go +++ b/pkg/cmd/server/admin/create_kubeconfig.go @@ -189,7 +189,7 @@ func (o CreateKubeConfigOptions) CreateKubeConfig() (*clientcmdapi.Config, error clusters := make(map[string]*clientcmdapi.Cluster) clusters[clusterNick] = &clientcmdapi.Cluster{ - Server: o.APIServerURL, + Server: o.APIServerURL, CertificateAuthorityData: caData, } @@ -205,7 +205,7 @@ func (o CreateKubeConfigOptions) CreateKubeConfig() (*clientcmdapi.Config, error publicContextNick := config.GetContextNickname(o.ContextNamespace, publicClusterNick, userNick) clusters[publicClusterNick] = &clientcmdapi.Cluster{ - Server: o.PublicAPIServerURL, + Server: o.PublicAPIServerURL, CertificateAuthorityData: caData, } contexts[publicContextNick] = &clientcmdapi.Context{Cluster: publicClusterNick, AuthInfo: userNick, Namespace: o.ContextNamespace} diff --git a/pkg/cmd/server/apis/config/validation/master_test.go b/pkg/cmd/server/apis/config/validation/master_test.go index c588b1a47b7a..e3fd8cfa8827 100644 --- a/pkg/cmd/server/apis/config/validation/master_test.go +++ b/pkg/cmd/server/apis/config/validation/master_test.go @@ -245,7 +245,7 @@ func TestValidateAdmissionPluginConfig(t *testing.T) { { config: map[string]*configapi.AdmissionPluginConfig{ "openshift.io/OriginResourceQuota": &configOnly, - "two": &configOnly, + "two": &configOnly, }, warningFields: []string{"[openshift.io/OriginResourceQuota]"}, expectError: false, diff --git a/pkg/image/apis/image/validation/validation_test.go b/pkg/image/apis/image/validation/validation_test.go index e05492ebdadd..30c333fdab70 100644 --- a/pkg/image/apis/image/validation/validation_test.go +++ b/pkg/image/apis/image/validation/validation_test.go @@ -311,7 +311,7 @@ func TestValidateImageStreamMappingNotOK(t *testing.T) { Namespace: "default", }, DockerImageRepository: "openshift/ruby-19-centos", - Tag: imageapi.DefaultImageTag, + Tag: imageapi.DefaultImageTag, Image: imageapi.Image{ DockerImageReference: "openshift/ruby-19-centos", }, @@ -325,7 +325,7 @@ func TestValidateImageStreamMappingNotOK(t *testing.T) { Namespace: "default", }, DockerImageRepository: "registry/extra/openshift//ruby-19-centos", - Tag: imageapi.DefaultImageTag, + Tag: imageapi.DefaultImageTag, Image: imageapi.Image{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", @@ -416,24 +416,24 @@ func TestValidateImageStream(t *testing.T) { }, }, "invalid dockerImageRepository": { - namespace: "namespace", - name: "foo", + namespace: "namespace", + name: "foo", dockerImageRepository: "a-|///bbb", expected: field.ErrorList{ field.Invalid(field.NewPath("spec", "dockerImageRepository"), "a-|///bbb", "invalid reference format"), }, }, "invalid dockerImageRepository with tag": { - namespace: "namespace", - name: "foo", + namespace: "namespace", + name: "foo", dockerImageRepository: "a/b:tag", expected: field.ErrorList{ field.Invalid(field.NewPath("spec", "dockerImageRepository"), "a/b:tag", "the repository name may not contain a tag"), }, }, "invalid dockerImageRepository with ID": { - namespace: "namespace", - name: "foo", + namespace: "namespace", + name: "foo", dockerImageRepository: "a/b@sha256:something", expected: field.ErrorList{ field.Invalid(field.NewPath("spec", "dockerImageRepository"), "a/b@sha256:something", "invalid reference format"), @@ -590,7 +590,7 @@ func TestValidateImageStream(t *testing.T) { }, Spec: imageapi.ImageStreamSpec{ DockerImageRepository: test.dockerImageRepository, - Tags: test.specTags, + Tags: test.specTags, }, Status: imageapi.ImageStreamStatus{ Tags: test.statusTags, @@ -835,7 +835,7 @@ func TestValidateImageStreamWithWhitelister(t *testing.T) { }, Spec: imageapi.ImageStreamSpec{ DockerImageRepository: test.dockerImageRepository, - Tags: test.specTags, + Tags: test.specTags, }, Status: imageapi.ImageStreamStatus{ Tags: test.statusTags, @@ -1015,7 +1015,7 @@ func TestValidateImageStreamUpdateWithWhitelister(t *testing.T) { ObjectMeta: objMeta, Spec: imageapi.ImageStreamSpec{ DockerImageRepository: tc.oldDockerImageRepository, - Tags: tc.oldSpecTags, + Tags: tc.oldSpecTags, }, Status: imageapi.ImageStreamStatus{ Tags: tc.oldStatusTags, @@ -1025,7 +1025,7 @@ func TestValidateImageStreamUpdateWithWhitelister(t *testing.T) { ObjectMeta: objMeta, Spec: imageapi.ImageStreamSpec{ DockerImageRepository: tc.newDockerImageRepository, - Tags: tc.newSpecTags, + Tags: tc.newSpecTags, }, Status: imageapi.ImageStreamStatus{ Tags: tc.newStatusTags, diff --git a/pkg/image/apis/image/validation/whitelist/whitelister_test.go b/pkg/image/apis/image/validation/whitelist/whitelister_test.go index 8fd783e2e8e2..13d165cdaaa1 100644 --- a/pkg/image/apis/image/validation/whitelist/whitelister_test.go +++ b/pkg/image/apis/image/validation/whitelist/whitelister_test.go @@ -37,7 +37,7 @@ func TestRegistryWhitelister(t *testing.T) { }, difs: map[imageapi.DockerImageReference]error{ {Registry: "docker.io", Namespace: "library", Name: "busybox"}: fmt.Errorf(`registry "docker.io" not allowed by empty whitelist`), - {Name: "busybox"}: fmt.Errorf(`registry "docker.io:443" not allowed by empty whitelist`), + {Name: "busybox"}: fmt.Errorf(`registry "docker.io:443" not allowed by empty whitelist`), }, }, diff --git a/pkg/image/apiserver/admission/imagepolicy/rules/accept.go b/pkg/image/apiserver/admission/imagepolicy/rules/accept.go index d10fda6dac06..c3c6d9079dd7 100644 --- a/pkg/image/apiserver/admission/imagepolicy/rules/accept.go +++ b/pkg/image/apiserver/admission/imagepolicy/rules/accept.go @@ -54,7 +54,7 @@ func NewExecutionRulesAccepter(rules []imagepolicy.ImageExecutionPolicyRule, int a, ok := mapped[gr] if !ok { a = &executionAccepter{ - covers: gr, + covers: gr, integratedRegistryMatcher: integratedRegistryMatcher, } mapped[gr] = a diff --git a/pkg/image/apiserver/registry/imagestream/strategy.go b/pkg/image/apiserver/registry/imagestream/strategy.go index 786af53d5d35..8f2c1b00f48e 100644 --- a/pkg/image/apiserver/registry/imagestream/strategy.go +++ b/pkg/image/apiserver/registry/imagestream/strategy.go @@ -82,7 +82,7 @@ func (s Strategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { stream := obj.(*imageapi.ImageStream) stream.Status = imageapi.ImageStreamStatus{ DockerImageRepository: s.dockerImageRepository(stream, false), - Tags: make(map[string]imageapi.TagEventList), + Tags: make(map[string]imageapi.TagEventList), } stream.Generation = 1 for tag, ref := range stream.Spec.Tags { diff --git a/pkg/image/apiserver/registry/imagestream/strategy_test.go b/pkg/image/apiserver/registry/imagestream/strategy_test.go index 83bec0521ff8..72d3cbfc7180 100644 --- a/pkg/image/apiserver/registry/imagestream/strategy_test.go +++ b/pkg/image/apiserver/registry/imagestream/strategy_test.go @@ -1113,7 +1113,7 @@ func TestTagsChanged(t *testing.T) { }, Status: imageapi.ImageStreamStatus{ DockerImageRepository: test.stream, - Tags: test.existingTagHistory, + Tags: test.existingTagHistory, }, } // we can't reuse the same map twice, it causes both to be modified during updates @@ -1134,7 +1134,7 @@ func TestTagsChanged(t *testing.T) { }, Status: imageapi.ImageStreamStatus{ DockerImageRepository: test.stream, - Tags: previousTagHistory, + Tags: previousTagHistory, }, } if test.previous == nil { diff --git a/pkg/oauthserver/authenticator/password/ldappassword/ldap.go b/pkg/oauthserver/authenticator/password/ldappassword/ldap.go index 6ebc5060e4e2..5ed38e9082df 100644 --- a/pkg/oauthserver/authenticator/password/ldappassword/ldap.go +++ b/pkg/oauthserver/authenticator/password/ldappassword/ldap.go @@ -111,12 +111,12 @@ func (a *Authenticator) getIdentity(username, password string) (authapi.UserIden a.options.URL.BaseDN, // base dn int(a.options.URL.Scope), // scope ldap.NeverDerefAliases, // deref - 2, // size limit, we want to know if this is not unique, but don't want the entire tree - 0, // no client-specified time limit, determined by LDAP server. TODO: make configurable? - false, // not types only - filter, // filter - attrs.List(), // attributes to retrieve - nil, // controls + 2, // size limit, we want to know if this is not unique, but don't want the entire tree + 0, // no client-specified time limit, determined by LDAP server. TODO: make configurable? + false, // not types only + filter, // filter + attrs.List(), // attributes to retrieve + nil, // controls ) klog.V(4).Infof("searching for %s", filter) diff --git a/pkg/oc/cli/admin/node/logs.go b/pkg/oc/cli/admin/node/logs.go index 9a14c52b3527..6c9169416884 100644 --- a/pkg/oc/cli/admin/node/logs.go +++ b/pkg/oc/cli/admin/node/logs.go @@ -94,11 +94,11 @@ func NewLogsOptions(streams genericclioptions.IOStreams) *LogsOptions { func NewCmdLogs(baseName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { o := NewLogsOptions(streams) cmd := &cobra.Command{ - Use: "node-logs [-l LABELS] [NODE...]", + Use: "node-logs [-l LABELS] [NODE...]", DisableFlagsInUseLine: true, - Short: "Display and filter node logs", - Long: logsLong, - Example: fmt.Sprintf(logsExample, baseName), + Short: "Display and filter node logs", + Long: logsLong, + Example: fmt.Sprintf(logsExample, baseName), Run: func(cmd *cobra.Command, args []string) { kcmdutil.CheckErr(o.Complete(f, cmd, args)) kcmdutil.CheckErr(o.Validate()) diff --git a/pkg/oc/cli/admin/prune/imageprune/prune_test.go b/pkg/oc/cli/admin/prune/imageprune/prune_test.go index 8538169c13a0..86b3e05f6bea 100644 --- a/pkg/oc/cli/admin/prune/imageprune/prune_test.go +++ b/pkg/oc/cli/admin/prune/imageprune/prune_test.go @@ -82,9 +82,9 @@ func TestImagePruning(t *testing.T) { expectedErrorString string }{ { - name: "1 pod - phase pending - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodPending, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "1 pod - phase pending - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodPending, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, @@ -100,9 +100,9 @@ func TestImagePruning(t *testing.T) { }, { - name: "1 pod - phase running - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodRunning, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "1 pod - phase running - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodRunning, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, @@ -118,9 +118,9 @@ func TestImagePruning(t *testing.T) { }, { - name: "pod phase succeeded - prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodSucceeded, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "pod phase succeeded - prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodSucceeded, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{"sha256:0000000000000000000000000000000000000000000000000000000000000000"}, expectedBlobDeletions: []string{ registryURL + "|sha256:0000000000000000000000000000000000000000000000000000000000000000", @@ -133,25 +133,25 @@ func TestImagePruning(t *testing.T) { }, { - name: "pod phase succeeded - prune leave registry alone", - pruneRegistry: newBool(false), - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodSucceeded, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "pod phase succeeded - prune leave registry alone", + pruneRegistry: newBool(false), + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodSucceeded, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{"sha256:0000000000000000000000000000000000000000000000000000000000000000"}, expectedBlobDeletions: []string{}, }, { - name: "pod phase succeeded, pod less than min pruning age - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - pods: testutil.PodList(testutil.AgedPod("foo", "pod1", corev1.PodSucceeded, 5, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "pod phase succeeded, pod less than min pruning age - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + pods: testutil.PodList(testutil.AgedPod("foo", "pod1", corev1.PodSucceeded, 5, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, { - name: "pod phase succeeded, image less than min pruning age - don't prune", - images: testutil.ImageList(testutil.AgedImage("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000", 5)), - pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodSucceeded, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "pod phase succeeded, image less than min pruning age - don't prune", + images: testutil.ImageList(testutil.AgedImage("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000", 5)), + pods: testutil.PodList(testutil.Pod("foo", "pod1", corev1.PodSucceeded, registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, @@ -245,16 +245,16 @@ func TestImagePruning(t *testing.T) { }, { - name: "referenced by rc - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - rcs: testutil.RCList(testutil.RC("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by rc - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + rcs: testutil.RCList(testutil.RC("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, { - name: "referenced by dc - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - dcs: testutil.DCList(testutil.DC("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by dc - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + dcs: testutil.DCList(testutil.DC("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, @@ -264,7 +264,7 @@ func TestImagePruning(t *testing.T) { testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000"), testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000001", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000001"), ), - dss: testutil.DSList(testutil.DS("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + dss: testutil.DSList(testutil.DS("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{"sha256:0000000000000000000000000000000000000000000000000000000000000001"}, expectedBlobDeletions: []string{registryURL + "|sha256:0000000000000000000000000000000000000000000000000000000000000001"}, }, @@ -275,7 +275,7 @@ func TestImagePruning(t *testing.T) { testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000"), testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000001", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000001"), ), - rss: testutil.RSList(testutil.RS("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + rss: testutil.RSList(testutil.RS("foo", "rc1", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{"sha256:0000000000000000000000000000000000000000000000000000000000000001"}, expectedBlobDeletions: []string{registryURL + "|sha256:0000000000000000000000000000000000000000000000000000000000000001"}, }, @@ -292,44 +292,44 @@ func TestImagePruning(t *testing.T) { }, { - name: "referenced by bc - sti - ImageStreamImage - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - bcs: testutil.BCList(testutil.BC("foo", "bc1", "source", "ImageStreamImage", "foo", "bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by bc - sti - ImageStreamImage - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + bcs: testutil.BCList(testutil.BC("foo", "bc1", "source", "ImageStreamImage", "foo", "bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, { - name: "referenced by bc - docker - ImageStreamImage - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - bcs: testutil.BCList(testutil.BC("foo", "bc1", "docker", "ImageStreamImage", "foo", "bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by bc - docker - ImageStreamImage - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + bcs: testutil.BCList(testutil.BC("foo", "bc1", "docker", "ImageStreamImage", "foo", "bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, { - name: "referenced by bc - custom - ImageStreamImage - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - bcs: testutil.BCList(testutil.BC("foo", "bc1", "custom", "ImageStreamImage", "foo", "bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by bc - custom - ImageStreamImage - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + bcs: testutil.BCList(testutil.BC("foo", "bc1", "custom", "ImageStreamImage", "foo", "bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, { - name: "referenced by bc - sti - DockerImage - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - bcs: testutil.BCList(testutil.BC("foo", "bc1", "source", "DockerImage", "foo", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by bc - sti - DockerImage - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + bcs: testutil.BCList(testutil.BC("foo", "bc1", "source", "DockerImage", "foo", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, { - name: "referenced by bc - docker - DockerImage - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - bcs: testutil.BCList(testutil.BC("foo", "bc1", "docker", "DockerImage", "foo", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by bc - docker - DockerImage - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + bcs: testutil.BCList(testutil.BC("foo", "bc1", "docker", "DockerImage", "foo", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, { - name: "referenced by bc - custom - DockerImage - don't prune", - images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), - bcs: testutil.BCList(testutil.BC("foo", "bc1", "custom", "DockerImage", "foo", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + name: "referenced by bc - custom - DockerImage - don't prune", + images: testutil.ImageList(testutil.Image("sha256:0000000000000000000000000000000000000000000000000000000000000000", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), + bcs: testutil.BCList(testutil.BC("foo", "bc1", "custom", "DockerImage", "foo", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000000")), expectedImageDeletions: []string{}, }, @@ -1582,21 +1582,21 @@ func TestRegistryPruning(t *testing.T) { keepYoungerThan := 60 * time.Minute keepTagRevisions := 1 options := PrunerOptions{ - KeepYoungerThan: &keepYoungerThan, - KeepTagRevisions: &keepTagRevisions, - PruneRegistry: &test.pruneRegistry, - Images: &test.images, - ImageWatcher: watch.NewFake(), - Streams: &test.streams, - StreamWatcher: watch.NewFake(), - Pods: &corev1.PodList{}, - RCs: &corev1.ReplicationControllerList{}, - BCs: &buildv1.BuildConfigList{}, - Builds: &buildv1.BuildList{}, - DSs: &kappsv1.DaemonSetList{}, - Deployments: &kappsv1.DeploymentList{}, - DCs: &appsv1.DeploymentConfigList{}, - RSs: &kappsv1.ReplicaSetList{}, + KeepYoungerThan: &keepYoungerThan, + KeepTagRevisions: &keepTagRevisions, + PruneRegistry: &test.pruneRegistry, + Images: &test.images, + ImageWatcher: watch.NewFake(), + Streams: &test.streams, + StreamWatcher: watch.NewFake(), + Pods: &corev1.PodList{}, + RCs: &corev1.ReplicationControllerList{}, + BCs: &buildv1.BuildConfigList{}, + Builds: &buildv1.BuildList{}, + DSs: &kappsv1.DaemonSetList{}, + Deployments: &kappsv1.DeploymentList{}, + DCs: &appsv1.DeploymentConfigList{}, + RSs: &kappsv1.ReplicaSetList{}, RegistryClientFactory: FakeRegistryClientFactory, RegistryURL: &url.URL{Scheme: "https", Host: "registry1.io"}, } @@ -1951,18 +1951,18 @@ func TestChangeImageStreamsWhilePruning(t *testing.T) { rss := testutil.RSList() options := PrunerOptions{ - Images: &images, - ImageWatcher: watch.NewFake(), - Streams: &streams, - StreamWatcher: streamWatcher, - Pods: &pods, - RCs: &rcs, - BCs: &bcs, - Builds: &builds, - DSs: &dss, - Deployments: &deployments, - DCs: &dcs, - RSs: &rss, + Images: &images, + ImageWatcher: watch.NewFake(), + Streams: &streams, + StreamWatcher: streamWatcher, + Pods: &pods, + RCs: &rcs, + BCs: &bcs, + Builds: &builds, + DSs: &dss, + Deployments: &deployments, + DCs: &dcs, + RSs: &rss, RegistryClientFactory: FakeRegistryClientFactory, RegistryURL: &url.URL{Scheme: "https", Host: "registry1.io"}, NumWorkers: 1, diff --git a/pkg/oc/cli/admin/prune/imageprune/testutil/util.go b/pkg/oc/cli/admin/prune/imageprune/testutil/util.go index 0a7106495ad8..9cf4e74e8294 100644 --- a/pkg/oc/cli/admin/prune/imageprune/testutil/util.go +++ b/pkg/oc/cli/admin/prune/imageprune/testutil/util.go @@ -201,7 +201,7 @@ func AgedStream(registry, namespace, name string, ageInMinutes int64, tags []ima }, Status: imagev1.ImageStreamStatus{ DockerImageRepository: fmt.Sprintf("%s/%s/%s", registry, namespace, name), - Tags: tags, + Tags: tags, }, } diff --git a/pkg/oc/cli/importimage/importimage_test.go b/pkg/oc/cli/importimage/importimage_test.go index fec900ade305..28a341dbce4e 100644 --- a/pkg/oc/cli/importimage/importimage_test.go +++ b/pkg/oc/cli/importimage/importimage_test.go @@ -54,7 +54,7 @@ func TestCreateImageImport(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "testis", Namespace: "other"}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, expectedImages: []imagev1.ImageImportSpec{{ @@ -68,7 +68,7 @@ func TestCreateImageImport(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "testis", Namespace: "other"}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, err: `"nonexisting" does not exist on the image stream`, @@ -80,7 +80,7 @@ func TestCreateImageImport(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "testis", Namespace: "other"}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, expectedRepository: &imagev1.RepositoryImportSpec{ @@ -96,7 +96,7 @@ func TestCreateImageImport(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "testis", Namespace: "other"}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, }, @@ -109,7 +109,7 @@ func TestCreateImageImport(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "testis", Namespace: "other"}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, expectedRepository: &imagev1.RepositoryImportSpec{ @@ -370,7 +370,7 @@ func TestCreateImageImport(t *testing.T) { }, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, expectedImages: []imagev1.ImageImportSpec{{ @@ -390,7 +390,7 @@ func TestCreateImageImport(t *testing.T) { }, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, expectedImages: []imagev1.ImageImportSpec{{ @@ -453,7 +453,7 @@ func TestCreateImageImport(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "testis", Namespace: "other"}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, expectedRepository: &imagev1.RepositoryImportSpec{ @@ -566,7 +566,7 @@ func TestCreateImageImport(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "testis", Namespace: "other"}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "repo.com/somens/someimage", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, expectedRepository: &imagev1.RepositoryImportSpec{ diff --git a/pkg/oc/cli/tag/tag_test.go b/pkg/oc/cli/tag/tag_test.go index 012cc93f37e1..3f3933d48034 100644 --- a/pkg/oc/cli/tag/tag_test.go +++ b/pkg/oc/cli/tag/tag_test.go @@ -26,7 +26,7 @@ func testData() []*imagev1.ImageStream { ObjectMeta: metav1.ObjectMeta{Name: "rails", Namespace: "yourproject", ResourceVersion: "10", CreationTimestamp: metav1.Now()}, Spec: imagev1.ImageStreamSpec{ DockerImageRepository: "", - Tags: []imagev1.TagReference{}, + Tags: []imagev1.TagReference{}, }, }, { diff --git a/pkg/oc/lib/groupsync/grouplister.go b/pkg/oc/lib/groupsync/grouplister.go index 9092dc47432a..c3c39819fce0 100644 --- a/pkg/oc/lib/groupsync/grouplister.go +++ b/pkg/oc/lib/groupsync/grouplister.go @@ -17,9 +17,9 @@ import ( // NewAllOpenShiftGroupLister returns a new allOpenShiftGroupLister func NewAllOpenShiftGroupLister(blacklist []string, ldapURL string, groupClient userv1client.GroupInterface) interfaces.LDAPGroupListerNameMapper { return &allOpenShiftGroupLister{ - blacklist: sets.NewString(blacklist...), - client: groupClient, - ldapURL: ldapURL, + blacklist: sets.NewString(blacklist...), + client: groupClient, + ldapURL: ldapURL, ldapGroupUIDToOpenShiftGroupName: map[string]string{}, } } @@ -104,10 +104,10 @@ func validateGroupAnnotations(ldapURL string, group userv1.Group) (bool, error) // each entry in the given whitelist of OpenShift Group names func NewOpenShiftGroupLister(whitelist, blacklist []string, ldapURL string, client userv1client.GroupInterface) interfaces.LDAPGroupListerNameMapper { return &openshiftGroupLister{ - whitelist: whitelist, - blacklist: sets.NewString(blacklist...), - client: client, - ldapURL: ldapURL, + whitelist: whitelist, + blacklist: sets.NewString(blacklist...), + client: client, + ldapURL: ldapURL, ldapGroupUIDToOpenShiftGroupName: map[string]string{}, } } diff --git a/pkg/oc/lib/newapp/app/app_test.go b/pkg/oc/lib/newapp/app/app_test.go index 6daafffd5a05..f9aca45f9bba 100644 --- a/pkg/oc/lib/newapp/app/app_test.go +++ b/pkg/oc/lib/newapp/app/app_test.go @@ -465,7 +465,7 @@ func TestNameFromGitURL(t *testing.T) { "empty host": {url: emptyHostURL, expectedName: "", expectedSuccess: false}, "host port": {url: hostPortURL, expectedName: "www.example.com", expectedSuccess: true}, "non standard host port": {url: nonStandardHostPortURL, expectedName: "www.example.com", expectedSuccess: true}, - "host": {url: hostURL, expectedName: "www.example.com", expectedSuccess: true}, + "host": {url: hostURL, expectedName: "www.example.com", expectedSuccess: true}, } for name, test := range tests { diff --git a/pkg/oc/lib/newapp/app/pipeline.go b/pkg/oc/lib/newapp/app/pipeline.go index 40415cce9b4f..05e42acfd9eb 100644 --- a/pkg/oc/lib/newapp/app/pipeline.go +++ b/pkg/oc/lib/newapp/app/pipeline.go @@ -128,11 +128,11 @@ func (pb *pipelineBuilder) NewBuildPipeline(from string, input *ImageRef, source } build := &BuildRef{ - Source: source, - Input: input, - Strategy: strategy, - Output: output, - Env: pb.environment, + Source: source, + Input: input, + Strategy: strategy, + Output: output, + Env: pb.environment, DockerStrategyOptions: pb.dockerStrategyOptions, Binary: binary, } diff --git a/pkg/route/apis/route/validation/validation_test.go b/pkg/route/apis/route/validation/validation_test.go index 3f1742923a1b..a0050a6ebb6d 100644 --- a/pkg/route/apis/route/validation/validation_test.go +++ b/pkg/route/apis/route/validation/validation_test.go @@ -493,8 +493,8 @@ func TestValidatePassthroughInsecureEdgeTerminationPolicy(t *testing.T) { routeapi.InsecureEdgeTerminationPolicyNone: false, routeapi.InsecureEdgeTerminationPolicyAllow: true, routeapi.InsecureEdgeTerminationPolicyRedirect: false, - "support HTTPsec": true, - "or maybe HSTS": true, + "support HTTPsec": true, + "or maybe HSTS": true, } for key, expected := range insecureTypes { @@ -691,8 +691,8 @@ func TestValidateEdgeReencryptInsecureEdgeTerminationPolicy(t *testing.T) { routeapi.InsecureEdgeTerminationPolicyNone: false, routeapi.InsecureEdgeTerminationPolicyAllow: false, routeapi.InsecureEdgeTerminationPolicyRedirect: false, - "support HTTPsec": true, - "or maybe HSTS": true, + "support HTTPsec": true, + "or maybe HSTS": true, } for _, tc := range tests { diff --git a/pkg/route/apiserver/admission/apis/ingressadmission/v1/swagger_doc.go b/pkg/route/apiserver/admission/apis/ingressadmission/v1/swagger_doc.go index a9ced6403901..27266bc8b3f6 100644 --- a/pkg/route/apiserver/admission/apis/ingressadmission/v1/swagger_doc.go +++ b/pkg/route/apiserver/admission/apis/ingressadmission/v1/swagger_doc.go @@ -6,7 +6,7 @@ package v1 // ==== DO NOT EDIT THIS FILE MANUALLY ==== var map_IngressAdmissionConfig = map[string]string{ - "": "IngressAdmissionConfig is the configuration for the the ingress controller limiter plugin. It changes the behavior of ingress objects to behave better with openshift routes and routers. *NOTE* This has security implications in the router when handling ingress objects", + "": "IngressAdmissionConfig is the configuration for the the ingress controller limiter plugin. It changes the behavior of ingress objects to behave better with openshift routes and routers. *NOTE* This has security implications in the router when handling ingress objects", "allowHostnameChanges": "AllowHostnameChanges when false or unset openshift does not allow changing or adding hostnames to ingress objects. If set to true then hostnames can be added or modified which has security implications in the router.", } diff --git a/pkg/route/controller/ingress/ingress.go b/pkg/route/controller/ingress/ingress.go index 71289e555fcc..134735eaf780 100644 --- a/pkg/route/controller/ingress/ingress.go +++ b/pkg/route/controller/ingress/ingress.go @@ -487,9 +487,9 @@ func newRouteForIngress( return nil } tlsConfig = &routev1.TLSConfig{ - Termination: routev1.TLSTerminationEdge, - Certificate: string(secret.Data[v1.TLSCertKey]), - Key: string(secret.Data[v1.TLSPrivateKeyKey]), + Termination: routev1.TLSTerminationEdge, + Certificate: string(secret.Data[v1.TLSCertKey]), + Key: string(secret.Data[v1.TLSPrivateKeyKey]), InsecureEdgeTerminationPolicy: routev1.InsecureEdgeTerminationPolicyRedirect, } } diff --git a/pkg/route/controller/ingress/ingress_test.go b/pkg/route/controller/ingress/ingress_test.go index 468239eeabfe..63d4ee85f51c 100644 --- a/pkg/route/controller/ingress/ingress_test.go +++ b/pkg/route/controller/ingress/ingress_test.go @@ -1014,8 +1014,8 @@ func TestController_sync(t *testing.T) { TLS: &routev1.TLSConfig{ Termination: routev1.TLSTerminationEdge, InsecureEdgeTerminationPolicy: routev1.InsecureEdgeTerminationPolicyRedirect, - Key: "key", - Certificate: "cert", + Key: "key", + Certificate: "cert", }, }, }, @@ -1211,8 +1211,8 @@ func TestController_sync(t *testing.T) { TLS: &routev1.TLSConfig{ Termination: routev1.TLSTerminationEdge, InsecureEdgeTerminationPolicy: routev1.InsecureEdgeTerminationPolicyRedirect, - Key: "key", - Certificate: "cert", + Key: "key", + Certificate: "cert", }, }, }, @@ -1273,8 +1273,8 @@ func TestController_sync(t *testing.T) { TLS: &routev1.TLSConfig{ Termination: routev1.TLSTerminationEdge, InsecureEdgeTerminationPolicy: routev1.InsecureEdgeTerminationPolicyRedirect, - Key: "", - Certificate: "", + Key: "", + Certificate: "", }, }, }, @@ -1396,8 +1396,8 @@ func TestController_sync(t *testing.T) { TLS: &routev1.TLSConfig{ Termination: routev1.TLSTerminationEdge, InsecureEdgeTerminationPolicy: routev1.InsecureEdgeTerminationPolicyRedirect, - Key: "key", - Certificate: "cert", + Key: "key", + Certificate: "cert", }, }, }, @@ -1463,8 +1463,8 @@ func TestController_sync(t *testing.T) { TLS: &routev1.TLSConfig{ Termination: routev1.TLSTerminationEdge, InsecureEdgeTerminationPolicy: routev1.InsecureEdgeTerminationPolicyRedirect, - Key: "key", - Certificate: "", + Key: "key", + Certificate: "", }, }, }, diff --git a/pkg/scheduler/admission/apis/podnodeconstraints/v1/swagger_doc.go b/pkg/scheduler/admission/apis/podnodeconstraints/v1/swagger_doc.go index 948409ffdde5..95e3d2220841 100644 --- a/pkg/scheduler/admission/apis/podnodeconstraints/v1/swagger_doc.go +++ b/pkg/scheduler/admission/apis/podnodeconstraints/v1/swagger_doc.go @@ -6,7 +6,7 @@ package v1 // ==== DO NOT EDIT THIS FILE MANUALLY ==== var map_PodNodeConstraintsConfig = map[string]string{ - "": "PodNodeConstraintsConfig is the configuration for the pod node name and node selector constraint plug-in. For accounts, serviceaccounts and groups which lack the \"pods/binding\" permission, Loading this plugin will prevent setting NodeName on pod specs and will prevent setting NodeSelectors whose labels appear in the blacklist field \"NodeSelectorLabelBlacklist\"", + "": "PodNodeConstraintsConfig is the configuration for the pod node name and node selector constraint plug-in. For accounts, serviceaccounts and groups which lack the \"pods/binding\" permission, Loading this plugin will prevent setting NodeName on pod specs and will prevent setting NodeSelectors whose labels appear in the blacklist field \"NodeSelectorLabelBlacklist\"", "nodeSelectorLabelBlacklist": "NodeSelectorLabelBlacklist specifies a list of labels which cannot be set by entities without the \"pods/binding\" permission", } diff --git a/pkg/scheduler/admission/nodeenv/admission_test.go b/pkg/scheduler/admission/nodeenv/admission_test.go index 3eba8330f5c4..2ba937e1548e 100644 --- a/pkg/scheduler/admission/nodeenv/admission_test.go +++ b/pkg/scheduler/admission/nodeenv/admission_test.go @@ -42,16 +42,16 @@ func TestPodAdmission(t *testing.T) { podNodeSelector: map[string]string{}, mergedNodeSelector: map[string]string{}, ignoreProjectNodeSelector: true, - admit: true, - testName: "No node selectors", + admit: true, + testName: "No node selectors", }, { defaultNodeSelector: "infra = false", podNodeSelector: map[string]string{}, mergedNodeSelector: map[string]string{"infra": "false"}, ignoreProjectNodeSelector: true, - admit: true, - testName: "Default node selector and no conflicts", + admit: true, + testName: "Default node selector and no conflicts", }, { defaultNodeSelector: "", diff --git a/pkg/serviceaccounts/controllers/create_dockercfg_secrets.go b/pkg/serviceaccounts/controllers/create_dockercfg_secrets.go index 51c978a617ff..676fc8c716ec 100644 --- a/pkg/serviceaccounts/controllers/create_dockercfg_secrets.go +++ b/pkg/serviceaccounts/controllers/create_dockercfg_secrets.go @@ -68,8 +68,8 @@ type DockercfgControllerOptions struct { // NewDockercfgController returns a new *DockercfgController. func NewDockercfgController(serviceAccounts informers.ServiceAccountInformer, secrets informers.SecretInformer, cl kclientset.Interface, options DockercfgControllerOptions) *DockercfgController { e := &DockercfgController{ - client: cl, - queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()), + client: cl, + queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()), dockerURLsInitialized: options.DockerURLsInitialized, } diff --git a/pkg/templateservicebroker/servicebroker/catalog_test.go b/pkg/templateservicebroker/servicebroker/catalog_test.go index baf239797740..9a9a6a413789 100644 --- a/pkg/templateservicebroker/servicebroker/catalog_test.go +++ b/pkg/templateservicebroker/servicebroker/catalog_test.go @@ -19,8 +19,8 @@ func TestServiceFromTemplate(t *testing.T) { Name: "name", UID: "ee33151d-a34d-442d-a0ca-6353b73a58fd", Annotations: map[string]string{ - "description": "description", - "tags": "tag1,tag2", + "description": "description", + "tags": "tag1,tag2", "openshift.io/display-name": "displayName", "iconClass": "iconClass", "openshift.io/long-description": "longDescription", diff --git a/test/extended/images/hardprune.go b/test/extended/images/hardprune.go index 98b61db4666b..190c2737c00a 100644 --- a/test/extended/images/hardprune.go +++ b/test/extended/images/hardprune.go @@ -195,7 +195,7 @@ var _ = g.Describe("[Feature:ImagePrune][registry][Serial][Suite:openshift/regis */ ManifestLinks: RepoLinks{oc.Namespace() + "/c": []string{childImg1}}, Blobs: []string{ - childImg1, // manifest blob + childImg1, // manifest blob imgs[childImg1].DockerImageMetadata.ID, // manifest config imgs[childImg1].DockerImageLayers[0].Name, }, @@ -211,7 +211,7 @@ var _ = g.Describe("[Feature:ImagePrune][registry][Serial][Suite:openshift/regis expectedDeletions = mergeOrSetExpectedDeletions(expectedDeletions, &RegistryStorageFiles{ Blobs: []string{ - baseImg1, // manifest blob + baseImg1, // manifest blob imgs[baseImg1].DockerImageMetadata.ID, // manifest config imgs[baseImg1].DockerImageLayers[0].Name, imgs[baseImg1].DockerImageLayers[1].Name, @@ -235,7 +235,7 @@ var _ = g.Describe("[Feature:ImagePrune][registry][Serial][Suite:openshift/regis */ ManifestLinks: RepoLinks{oc.Namespace() + "/b": []string{childImg2}}, Blobs: []string{ - childImg2, // manifest blob + childImg2, // manifest blob imgs[childImg2].DockerImageMetadata.ID, // manifest config imgs[childImg2].DockerImageLayers[0].Name, }, @@ -263,7 +263,7 @@ var _ = g.Describe("[Feature:ImagePrune][registry][Serial][Suite:openshift/regis */ Repos: []string{oc.Namespace() + "/b"}, Blobs: []string{ - baseImg2, // manifest blob + baseImg2, // manifest blob imgs[baseImg2].DockerImageMetadata.ID, // manifest config imgs[baseImg2].DockerImageLayers[0].Name, imgs[baseImg2].DockerImageLayers[1].Name, diff --git a/test/extended/util/test.go b/test/extended/util/test.go index 0eae2130dc58..b4d80f806164 100644 --- a/test/extended/util/test.go +++ b/test/extended/util/test.go @@ -321,16 +321,16 @@ var ( }, // tests for features that are not implemented in openshift "[Disabled:Unimplemented]": { - `\[Feature:Networking-IPv6\]`, // openshift-sdn doesn't support yet - `Monitoring`, // Not installed, should be - `Cluster level logging`, // Not installed yet - `Kibana`, // Not installed - `Ubernetes`, // Can't set zone labels today - `kube-ui`, // Not installed by default - `Kubernetes Dashboard`, // Not installed by default (also probably slow image pull) - `\[Feature:ServiceLoadBalancer\]`, // Not enabled yet - `PersistentVolumes-local`, // Disable local storage in 4.0 for now (sig-storage/hekumar@redhat.com) - `\[Feature:RuntimeClass\]`, // disable runtimeclass tests in 4.1 (sig-pod/sjenning@redhat.com) + `\[Feature:Networking-IPv6\]`, // openshift-sdn doesn't support yet + `Monitoring`, // Not installed, should be + `Cluster level logging`, // Not installed yet + `Kibana`, // Not installed + `Ubernetes`, // Can't set zone labels today + `kube-ui`, // Not installed by default + `Kubernetes Dashboard`, // Not installed by default (also probably slow image pull) + `\[Feature:ServiceLoadBalancer\]`, // Not enabled yet + `PersistentVolumes-local`, // Disable local storage in 4.0 for now (sig-storage/hekumar@redhat.com) + `\[Feature:RuntimeClass\]`, // disable runtimeclass tests in 4.1 (sig-pod/sjenning@redhat.com) `\[Feature:CustomResourceWebhookConversion\]`, // webhook conversion is off by default. sig-master/@sttts `NetworkPolicy between server and client should allow egress access on one named port`, // not yet implemented @@ -343,7 +343,7 @@ var ( `\[Feature:Audit\]`, // Needs special configuration `\[Feature:LocalStorageCapacityIsolation\]`, // relies on a separate daemonset? - `kube-dns-autoscaler`, // Don't run kube-dns + `kube-dns-autoscaler`, // Don't run kube-dns `should check if Kubernetes master services is included in cluster-info`, // Don't run kube-dns `DNS configMap`, // this tests dns federation configuration via configmap, which we don't support yet diff --git a/test/integration/oauth_serviceaccount_client_events_test.go b/test/integration/oauth_serviceaccount_client_events_test.go index 66dfa154ed4c..d50a4ffa5467 100644 --- a/test/integration/oauth_serviceaccount_client_events_test.go +++ b/test/integration/oauth_serviceaccount_client_events_test.go @@ -314,12 +314,12 @@ func setupTestSecrets(client kubernetes.Interface, sa *corev1.ServiceAccount) (* // the specific sequence does not matter, as long as it can generate the server_error that we expect. func runTestOAuthFlow(t *testing.T, ts *testServer, sa *corev1.ServiceAccount, secret *corev1.Secret, redirectURL string, expectBadRequest bool) { oauthClientConfig := &osincli.ClientConfig{ - ClientId: apiserverserviceaccount.MakeUsername(sa.Namespace, sa.Name), - ClientSecret: string(secret.Data[corev1.ServiceAccountTokenKey]), - AuthorizeUrl: ts.clusterAdminClientConfig.Host + "/oauth/authorize", - TokenUrl: ts.clusterAdminClientConfig.Host + "/oauth/token", - RedirectUrl: redirectURL, - Scope: scope.Join([]string{"user:info", "role:edit:" + projectName}), + ClientId: apiserverserviceaccount.MakeUsername(sa.Namespace, sa.Name), + ClientSecret: string(secret.Data[corev1.ServiceAccountTokenKey]), + AuthorizeUrl: ts.clusterAdminClientConfig.Host + "/oauth/authorize", + TokenUrl: ts.clusterAdminClientConfig.Host + "/oauth/token", + RedirectUrl: redirectURL, + Scope: scope.Join([]string{"user:info", "role:edit:" + projectName}), SendClientSecretInParams: true, } diff --git a/test/integration/oauth_serviceaccount_client_test.go b/test/integration/oauth_serviceaccount_client_test.go index 0b842404ecf6..6c27892e8337 100644 --- a/test/integration/oauth_serviceaccount_client_test.go +++ b/test/integration/oauth_serviceaccount_client_test.go @@ -258,12 +258,12 @@ func TestOAuthServiceAccountClient(t *testing.T) { { oauthClientConfig := &osincli.ClientConfig{ - ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), - ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), - AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", - TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", - RedirectUrl: redirectURL, - Scope: scope.Join([]string{"user:info", "role:edit:" + projectName}), + ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), + ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), + AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", + TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", + RedirectUrl: redirectURL, + Scope: scope.Join([]string{"user:info", "role:edit:" + projectName}), SendClientSecretInParams: true, } t.Log("Testing allowed scopes") @@ -294,12 +294,12 @@ func TestOAuthServiceAccountClient(t *testing.T) { { oauthClientConfig := &osincli.ClientConfig{ - ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), - ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), - AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", - TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", - RedirectUrl: redirectURL, - Scope: scope.Join([]string{"user:info", "role:edit:other-ns"}), + ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), + ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), + AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", + TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", + RedirectUrl: redirectURL, + Scope: scope.Join([]string{"user:info", "role:edit:other-ns"}), SendClientSecretInParams: true, } t.Log("Testing disallowed scopes") @@ -316,12 +316,12 @@ func TestOAuthServiceAccountClient(t *testing.T) { { t.Log("Testing invalid scopes") oauthClientConfig := &osincli.ClientConfig{ - ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), - ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), - AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", - TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", - RedirectUrl: redirectURL, - Scope: scope.Join([]string{"unknown-scope"}), + ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), + ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), + AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", + TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", + RedirectUrl: redirectURL, + Scope: scope.Join([]string{"unknown-scope"}), SendClientSecretInParams: true, } runOAuthFlow(t, clusterAdminClientConfig, projectName, oauthClientConfig, nil, authorizationCodes, authorizationErrors, false, false, []string{ @@ -337,12 +337,12 @@ func TestOAuthServiceAccountClient(t *testing.T) { { t.Log("Testing allowed scopes with failed API call") oauthClientConfig := &osincli.ClientConfig{ - ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), - ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), - AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", - TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", - RedirectUrl: redirectURL, - Scope: scope.Join([]string{"user:info"}), + ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), + ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), + AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", + TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", + RedirectUrl: redirectURL, + Scope: scope.Join([]string{"user:info"}), SendClientSecretInParams: true, } // First time, the approval is needed @@ -372,12 +372,12 @@ func TestOAuthServiceAccountClient(t *testing.T) { { oauthClientConfig := &osincli.ClientConfig{ - ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), - ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), - AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", - TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", - RedirectUrl: redirectURL, - Scope: scope.Join([]string{"user:info", "role:edit:" + projectName}), + ClientId: apiserverserviceaccount.MakeUsername(defaultSA.Namespace, defaultSA.Name), + ClientSecret: string(oauthSecret.Data[corev1.ServiceAccountTokenKey]), + AuthorizeUrl: clusterAdminClientConfig.Host + "/oauth/authorize", + TokenUrl: clusterAdminClientConfig.Host + "/oauth/token", + RedirectUrl: redirectURL, + Scope: scope.Join([]string{"user:info", "role:edit:" + projectName}), SendClientSecretInParams: true, } t.Log("Testing grant flow is reentrant") From 8cb48143b904cce60e1ad1e5c149d6b58b9b0bd5 Mon Sep 17 00:00:00 2001 From: David Eads Date: Tue, 9 Apr 2019 19:53:43 -0400 Subject: [PATCH 2/2] UPSTREAM: : pair to that weird apimachinery test pick --- .../k8s.io/apimachinery/pkg/util/naming/from_stack_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/naming/from_stack_test.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/naming/from_stack_test.go index 1ff1ec8ad183..a237082d9a79 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/naming/from_stack_test.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/naming/from_stack_test.go @@ -31,12 +31,12 @@ func TestGetNameFromCallsite(t *testing.T) { { name: "ignore-package", ignoredPackages: []string{"k8s.io/apimachinery/pkg/util/naming"}, - expected: "testing/testing.go:777", + expected: "testing/testing.go:827", }, { name: "ignore-file", ignoredPackages: []string{"k8s.io/apimachinery/pkg/util/naming/from_stack_test.go"}, - expected: "testing/testing.go:777", + expected: "testing/testing.go:827", }, { name: "ignore-multiple",