From 97b2992dc191a357e2167eff5035ce26237a4799 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Fri, 5 Oct 2018 12:59:38 -0700 Subject: [PATCH] Update gofmt for go1.11 --- cluster/gce/gci/apiserver_manifest_test.go | 4 +- .../images/etcd/migrate/integration_test.go | 2 +- .../app/options/options_test.go | 8 +- cmd/kube-apiserver/app/options/options.go | 22 +-- .../app/options/options_test.go | 18 +-- .../kubeadm/validation/validation_test.go | 12 +- cmd/kubeadm/app/cmd/config.go | 2 +- cmd/kubeadm/app/cmd/token.go | 8 +- cmd/kubeadm/app/cmd/upgrade/apply.go | 4 +- cmd/kubeadm/app/cmd/upgrade/upgrade.go | 2 +- .../app/componentconfigs/validation_test.go | 42 +++--- .../app/phases/addons/proxy/proxy_test.go | 6 +- cmd/kubeadm/app/phases/kubelet/flags.go | 6 +- cmd/kubeadm/app/phases/kubelet/flags_test.go | 6 +- .../selfhosting/podspec_mutation_test.go | 2 +- .../phases/uploadconfig/uploadconfig_test.go | 2 +- cmd/kubeadm/app/util/kubeconfig/kubeconfig.go | 2 +- .../app/util/system/package_validator_test.go | 4 +- pkg/api/service/util_test.go | 16 +-- pkg/api/v1/service/util_test.go | 16 +-- .../validation/validation_test.go | 4 +- pkg/apis/autoscaling/v2beta1/defaults.go | 2 +- pkg/apis/autoscaling/v2beta1/defaults_test.go | 2 +- pkg/apis/core/validation/validation_test.go | 18 +-- pkg/cloudprovider/providers/aws/aws_test.go | 2 +- .../providers/azure/azure_loadbalancer.go | 14 +- .../providers/azure/azure_storageaccount.go | 6 +- .../providers/azure/azure_test.go | 6 +- pkg/cloudprovider/providers/gce/gce_test.go | 6 +- .../providers/vsphere/vclib/volumeoptions.go | 2 +- pkg/controller/controller_utils_test.go | 4 +- .../daemon/daemon_controller_test.go | 4 +- .../namespace/namespace_controller.go | 2 +- pkg/controller/podautoscaler/horizontal.go | 6 +- .../podautoscaler/legacy_horizontal_test.go | 2 +- pkg/controller/replicaset/replica_set_test.go | 2 +- .../serviceaccounts_controller.go | 2 +- .../volume/persistentvolume/index_test.go | 48 +++---- .../persistentvolume/pv_controller_base.go | 12 +- .../pvc_protection_controller.go | 4 +- .../pvprotection/pv_protection_controller.go | 4 +- pkg/features/kube_features.go | 4 +- pkg/fieldpath/fieldpath_test.go | 6 +- pkg/kubeapiserver/options/authorization.go | 2 +- pkg/kubectl/cmd/annotate.go | 8 +- pkg/kubectl/cmd/apply.go | 8 +- pkg/kubectl/cmd/apply_edit_last_applied.go | 8 +- pkg/kubectl/cmd/apply_set_last_applied.go | 8 +- pkg/kubectl/cmd/apply_view_last_applied.go | 8 +- pkg/kubectl/cmd/attach.go | 8 +- pkg/kubectl/cmd/attach_test.go | 12 +- pkg/kubectl/cmd/auth/cani.go | 8 +- pkg/kubectl/cmd/auth/reconcile.go | 12 +- pkg/kubectl/cmd/autoscale.go | 8 +- pkg/kubectl/cmd/certificates.go | 14 +- pkg/kubectl/cmd/completion.go | 8 +- pkg/kubectl/cmd/config/config.go | 4 +- pkg/kubectl/cmd/config/create_authinfo.go | 8 +- pkg/kubectl/cmd/config/create_cluster.go | 8 +- pkg/kubectl/cmd/config/create_context.go | 8 +- pkg/kubectl/cmd/config/delete_cluster.go | 8 +- pkg/kubectl/cmd/config/delete_context.go | 8 +- pkg/kubectl/cmd/config/get_contexts.go | 8 +- pkg/kubectl/cmd/config/rename_context.go | 8 +- pkg/kubectl/cmd/config/set.go | 6 +- pkg/kubectl/cmd/config/unset.go | 8 +- pkg/kubectl/cmd/config/use_context.go | 10 +- pkg/kubectl/cmd/convert.go | 8 +- pkg/kubectl/cmd/cp.go | 8 +- pkg/kubectl/cmd/create/create.go | 8 +- pkg/kubectl/cmd/create/create_clusterrole.go | 8 +- .../cmd/create/create_clusterrolebinding.go | 8 +- pkg/kubectl/cmd/create/create_configmap.go | 2 +- pkg/kubectl/cmd/create/create_deployment.go | 2 +- pkg/kubectl/cmd/create/create_namespace.go | 2 +- pkg/kubectl/cmd/create/create_pdb.go | 2 +- .../cmd/create/create_priorityclass.go | 2 +- pkg/kubectl/cmd/create/create_quota.go | 2 +- pkg/kubectl/cmd/create/create_role.go | 8 +- pkg/kubectl/cmd/create/create_rolebinding.go | 8 +- pkg/kubectl/cmd/create/create_secret.go | 24 ++-- pkg/kubectl/cmd/create/create_service.go | 32 ++--- .../cmd/create/create_serviceaccount.go | 2 +- pkg/kubectl/cmd/delete.go | 8 +- pkg/kubectl/cmd/delete_test.go | 4 +- pkg/kubectl/cmd/describe.go | 8 +- pkg/kubectl/cmd/diff.go | 8 +- pkg/kubectl/cmd/drain.go | 24 ++-- pkg/kubectl/cmd/edit.go | 8 +- pkg/kubectl/cmd/exec.go | 8 +- pkg/kubectl/cmd/explain.go | 8 +- pkg/kubectl/cmd/expose.go | 8 +- pkg/kubectl/cmd/get/get.go | 8 +- pkg/kubectl/cmd/help.go | 6 +- pkg/kubectl/cmd/label.go | 8 +- pkg/kubectl/cmd/logs.go | 8 +- pkg/kubectl/cmd/patch.go | 8 +- pkg/kubectl/cmd/plugin.go | 6 +- pkg/kubectl/cmd/portforward.go | 8 +- pkg/kubectl/cmd/proxy.go | 8 +- pkg/kubectl/cmd/replace.go | 8 +- pkg/kubectl/cmd/rollingupdate.go | 12 +- pkg/kubectl/cmd/rollout/rollout.go | 10 +- pkg/kubectl/cmd/rollout/rollout_history.go | 8 +- pkg/kubectl/cmd/rollout/rollout_pause.go | 8 +- pkg/kubectl/cmd/rollout/rollout_resume.go | 8 +- pkg/kubectl/cmd/rollout/rollout_status.go | 8 +- pkg/kubectl/cmd/rollout/rollout_undo.go | 8 +- pkg/kubectl/cmd/run.go | 8 +- pkg/kubectl/cmd/scale.go | 8 +- pkg/kubectl/cmd/set/set.go | 8 +- pkg/kubectl/cmd/set/set_env.go | 8 +- pkg/kubectl/cmd/set/set_image.go | 8 +- pkg/kubectl/cmd/set/set_resources.go | 8 +- pkg/kubectl/cmd/set/set_selector.go | 8 +- pkg/kubectl/cmd/set/set_serviceaccount.go | 2 +- pkg/kubectl/cmd/set/set_subject.go | 8 +- pkg/kubectl/cmd/taint.go | 8 +- pkg/kubectl/cmd/top_node.go | 8 +- pkg/kubectl/cmd/top_pod.go | 8 +- pkg/kubectl/cmd/wait/wait.go | 8 +- pkg/kubectl/service_test.go | 2 +- pkg/kubelet/cm/devicemanager/manager_test.go | 6 +- pkg/kubelet/config/file_linux_test.go | 4 +- pkg/kubelet/config/http_test.go | 12 +- .../libdocker/kube_docker_client.go | 8 +- .../network/hostport/hostport_manager_test.go | 18 +-- pkg/kubelet/eviction/eviction_manager.go | 16 +-- pkg/kubelet/eviction/eviction_manager_test.go | 128 +++++++++--------- pkg/kubelet/kubelet.go | 82 +++++------ .../kuberuntime/kuberuntime_container.go | 4 +- pkg/kubelet/kuberuntime/labels_test.go | 26 ++-- pkg/kubelet/network/dns/dns_test.go | 18 +-- pkg/kubelet/nodelease/controller.go | 10 +- pkg/kubelet/nodestatus/setters_test.go | 8 +- pkg/kubelet/server/portforward/httpstream.go | 6 +- pkg/kubelet/stats/helper.go | 4 +- pkg/printers/internalversion/describe_test.go | 8 +- pkg/printers/internalversion/printers_test.go | 2 +- .../apis/config/validation/validation_test.go | 102 +++++++------- .../core/persistent_volume_claims_test.go | 4 +- pkg/quota/v1/evaluator/core/pods_test.go | 40 +++--- pkg/quota/v1/evaluator/core/services_test.go | 30 ++-- .../subjectaccessreview/rest_test.go | 4 +- pkg/registry/core/node/storage/storage.go | 6 +- pkg/registry/core/rest/storage_core.go | 6 +- .../extensions/controller/storage/storage.go | 2 +- .../algorithm/predicates/metadata.go | 8 +- .../algorithm/predicates/predicates_test.go | 6 +- pkg/scheduler/cache/node_tree_test.go | 4 +- .../core/equivalence/eqivalence_test.go | 60 ++++---- pkg/scheduler/core/extender.go | 2 +- pkg/scheduler/core/generic_scheduler_test.go | 6 +- pkg/scheduler/factory/factory_test.go | 4 +- pkg/security/apparmor/validate_test.go | 8 +- pkg/volume/awsebs/aws_ebs_test.go | 2 +- pkg/volume/cinder/cinder_test.go | 2 +- pkg/volume/flocker/flocker_util_test.go | 2 +- pkg/volume/flocker/flocker_volume_test.go | 6 +- pkg/volume/gcepd/gce_pd_test.go | 2 +- pkg/volume/host_path/host_path_test.go | 2 +- pkg/volume/iscsi/iscsi_test.go | 4 +- pkg/volume/photon_pd/photon_pd_test.go | 2 +- pkg/volume/portworx/portworx_test.go | 2 +- pkg/volume/scaleio/sio_client.go | 2 +- pkg/volume/scaleio/sio_volume_test.go | 22 +-- pkg/volume/storageos/storageos_util_test.go | 4 +- pkg/volume/util/device_util_linux_test.go | 4 +- .../operationexecutor/operation_generator.go | 8 +- .../vsphere_volume/vsphere_volume_test.go | 2 +- .../admission/imagepolicy/admission_test.go | 6 +- .../podnodeselector/admission_test.go | 8 +- .../admission_test.go | 22 +-- .../apps/v1/types_swagger_doc_generated.go | 2 +- .../v1beta2/types_swagger_doc_generated.go | 2 +- .../v1/types_swagger_doc_generated.go | 8 +- .../v2beta1/types_swagger_doc_generated.go | 8 +- .../core/v1/types_swagger_doc_generated.go | 38 +++--- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../rbac/v1/types_swagger_doc_generated.go | 2 +- .../v1alpha1/types_swagger_doc_generated.go | 2 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../v1alpha1/types_swagger_doc_generated.go | 2 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../k8s.io/apimachinery/pkg/api/meta/meta.go | 12 +- .../apimachinery/pkg/runtime/scheme_test.go | 30 ++-- .../pkg/util/validation/validation_test.go | 2 +- .../src/k8s.io/apiserver/pkg/audit/request.go | 8 +- .../apiserver/pkg/server/options/etcd_test.go | 72 +++++----- .../pkg/server/options/serving_test.go | 2 +- .../pkg/storage/etcd/testing/utils.go | 2 +- .../pkg/storage/etcd3/lease_manager.go | 2 +- .../pkg/storage/storagebackend/config.go | 6 +- .../pkg/util/webhook/webhook_test.go | 12 +- .../apiserver/pkg/util/wsstream/conn.go | 2 +- .../apiserver/pkg/util/wsstream/stream.go | 2 +- .../pkg/authorizer/webhook/webhook_test.go | 2 +- .../client-go/tools/cache/shared_informer.go | 2 +- .../tools/clientcmd/client_config_test.go | 2 +- .../transport/round_trippers_test.go | 6 +- .../src/k8s.io/client-go/util/cert/cert.go | 4 +- .../cmd/informer-gen/generators/packages.go | 6 +- .../generators/versioninterface.go | 2 +- .../pkg/apiserver/apiserver.go | 16 +-- .../pkg/apiserver/handler_proxy_test.go | 6 +- test/e2e/common/runtime.go | 30 ++-- test/e2e/framework/framework.go | 4 +- test/e2e/framework/resource_usage_gatherer.go | 2 +- test/e2e/scheduling/taints_test.go | 18 +-- 209 files changed, 1029 insertions(+), 1029 deletions(-) diff --git a/cluster/gce/gci/apiserver_manifest_test.go b/cluster/gce/gci/apiserver_manifest_test.go index 83547360b8e..2b430bd4295 100644 --- a/cluster/gce/gci/apiserver_manifest_test.go +++ b/cluster/gce/gci/apiserver_manifest_test.go @@ -105,12 +105,12 @@ func TestEncryptionProviderFlag(t *testing.T) { wantFlag bool }{ { - desc: "ENCRYPTION_PROVIDER_CONFIG is set", + desc: "ENCRYPTION_PROVIDER_CONFIG is set", encryptionProviderConfig: base64.StdEncoding.EncodeToString([]byte("foo")), wantFlag: true, }, { - desc: "ENCRYPTION_PROVIDER_CONFIG is not set", + desc: "ENCRYPTION_PROVIDER_CONFIG is not set", encryptionProviderConfig: "", wantFlag: false, }, diff --git a/cluster/images/etcd/migrate/integration_test.go b/cluster/images/etcd/migrate/integration_test.go index bd32e5d10ce..4fea31d29aa 100644 --- a/cluster/images/etcd/migrate/integration_test.go +++ b/cluster/images/etcd/migrate/integration_test.go @@ -323,7 +323,7 @@ func generateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth}, BasicConstraintsValid: true, - IsCA: true, + IsCA: true, } if ip := net.ParseIP(host); ip != nil { diff --git a/cmd/cloud-controller-manager/app/options/options_test.go b/cmd/cloud-controller-manager/app/options/options_test.go index 8efbc2487fc..72bcb068a9c 100644 --- a/cmd/cloud-controller-manager/app/options/options_test.go +++ b/cmd/cloud-controller-manager/app/options/options_test.go @@ -104,8 +104,8 @@ func TestDefaultFlags(t *testing.T) { RemoteKubeConfigFileOptional: true, AlwaysAllowPaths: []string{"/healthz"}, // note: this does not match /healthz/ or }, - Kubeconfig: "", - Master: "", + Kubeconfig: "", + Master: "", NodeStatusUpdateFrequency: metav1.Duration{Duration: 5 * time.Minute}, } if !reflect.DeepEqual(expected, s) { @@ -222,8 +222,8 @@ func TestAddFlags(t *testing.T) { RemoteKubeConfigFileOptional: true, AlwaysAllowPaths: []string{"/healthz"}, // note: this does not match /healthz/ or }, - Kubeconfig: "/kubeconfig", - Master: "192.168.4.20", + Kubeconfig: "/kubeconfig", + Master: "192.168.4.20", NodeStatusUpdateFrequency: metav1.Duration{Duration: 10 * time.Minute}, } if !reflect.DeepEqual(expected, s) { diff --git a/cmd/kube-apiserver/app/options/options.go b/cmd/kube-apiserver/app/options/options.go index 2e5276d4bc7..7416c214fbb 100644 --- a/cmd/kube-apiserver/app/options/options.go +++ b/cmd/kube-apiserver/app/options/options.go @@ -77,17 +77,17 @@ type ServerRunOptions struct { func NewServerRunOptions() *ServerRunOptions { s := ServerRunOptions{ GenericServerRunOptions: genericoptions.NewServerRunOptions(), - Etcd: genericoptions.NewEtcdOptions(storagebackend.NewDefaultConfig(kubeoptions.DefaultEtcdPathPrefix, nil)), - SecureServing: kubeoptions.NewSecureServingOptions(), - InsecureServing: kubeoptions.NewInsecureServingOptions(), - Audit: genericoptions.NewAuditOptions(), - Features: genericoptions.NewFeatureOptions(), - Admission: kubeoptions.NewAdmissionOptions(), - Authentication: kubeoptions.NewBuiltInAuthenticationOptions().WithAll(), - Authorization: kubeoptions.NewBuiltInAuthorizationOptions(), - CloudProvider: kubeoptions.NewCloudProviderOptions(), - StorageSerialization: kubeoptions.NewStorageSerializationOptions(), - APIEnablement: genericoptions.NewAPIEnablementOptions(), + Etcd: genericoptions.NewEtcdOptions(storagebackend.NewDefaultConfig(kubeoptions.DefaultEtcdPathPrefix, nil)), + SecureServing: kubeoptions.NewSecureServingOptions(), + InsecureServing: kubeoptions.NewInsecureServingOptions(), + Audit: genericoptions.NewAuditOptions(), + Features: genericoptions.NewFeatureOptions(), + Admission: kubeoptions.NewAdmissionOptions(), + Authentication: kubeoptions.NewBuiltInAuthenticationOptions().WithAll(), + Authorization: kubeoptions.NewBuiltInAuthorizationOptions(), + CloudProvider: kubeoptions.NewCloudProviderOptions(), + StorageSerialization: kubeoptions.NewStorageSerializationOptions(), + APIEnablement: genericoptions.NewAPIEnablementOptions(), EnableLogsHandler: true, EventTTL: 1 * time.Hour, diff --git a/cmd/kube-apiserver/app/options/options_test.go b/cmd/kube-apiserver/app/options/options_test.go index 38fbe904535..474ade67c8b 100644 --- a/cmd/kube-apiserver/app/options/options_test.go +++ b/cmd/kube-apiserver/app/options/options_test.go @@ -142,16 +142,16 @@ func TestAddFlags(t *testing.T) { }, Etcd: &apiserveroptions.EtcdOptions{ StorageConfig: storagebackend.Config{ - Type: "etcd2", - ServerList: nil, - Prefix: "/registry", + Type: "etcd2", + ServerList: nil, + Prefix: "/registry", DeserializationCacheSize: 0, - Quorum: false, - KeyFile: "/var/run/kubernetes/etcd.key", - CAFile: "/var/run/kubernetes/etcdca.crt", - CertFile: "/var/run/kubernetes/etcdce.crt", - CompactionInterval: storagebackend.DefaultCompactInterval, - CountMetricPollPeriod: time.Minute, + Quorum: false, + KeyFile: "/var/run/kubernetes/etcd.key", + CAFile: "/var/run/kubernetes/etcdca.crt", + CertFile: "/var/run/kubernetes/etcdce.crt", + CompactionInterval: storagebackend.DefaultCompactInterval, + CountMetricPollPeriod: time.Minute, }, DefaultStorageMediaType: "application/vnd.kubernetes.protobuf", DeleteCollectionWorkers: 1, diff --git a/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go b/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go index 9f28dd3208b..604c3e129bc 100644 --- a/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go +++ b/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go @@ -448,9 +448,9 @@ func TestValidateInitConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -495,9 +495,9 @@ func TestValidateInitConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, diff --git a/cmd/kubeadm/app/cmd/config.go b/cmd/kubeadm/app/cmd/config.go index 5b93d9bf6a2..9fc59c32833 100644 --- a/cmd/kubeadm/app/cmd/config.go +++ b/cmd/kubeadm/app/cmd/config.go @@ -195,7 +195,7 @@ func getDefaultInitConfigBytes(kind string) ([]byte, error) { func getDefaultNodeConfigBytes() ([]byte, error) { internalcfg, err := configutil.NodeConfigFileAndDefaultsToInternalConfig("", &kubeadmapiv1beta1.JoinConfiguration{ - Token: sillyToken.Token.String(), + Token: sillyToken.Token.String(), DiscoveryTokenAPIServers: []string{"kube-apiserver:6443"}, DiscoveryTokenUnsafeSkipCAVerification: true, // TODO: DiscoveryTokenUnsafeSkipCAVerification: true needs to be set for validation to pass, but shouldn't be recommended as the default }) diff --git a/cmd/kubeadm/app/cmd/token.go b/cmd/kubeadm/app/cmd/token.go index e503c692e96..ab9bde7e37f 100644 --- a/cmd/kubeadm/app/cmd/token.go +++ b/cmd/kubeadm/app/cmd/token.go @@ -97,9 +97,9 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command { bto := options.NewBootstrapTokenOptions() createCmd := &cobra.Command{ - Use: "create [token]", + Use: "create [token]", DisableFlagsInUseLine: true, - Short: "Create bootstrap tokens on the server.", + Short: "Create bootstrap tokens on the server.", Long: dedent.Dedent(` This command will create a bootstrap token for you. You can specify the usages for this token, the "time to live" and an optional human friendly description. @@ -158,9 +158,9 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command { tokenCmd.AddCommand(listCmd) deleteCmd := &cobra.Command{ - Use: "delete [token-value]", + Use: "delete [token-value]", DisableFlagsInUseLine: true, - Short: "Delete bootstrap tokens on the server.", + Short: "Delete bootstrap tokens on the server.", Long: dedent.Dedent(` This command will delete a given bootstrap token for you. diff --git a/cmd/kubeadm/app/cmd/upgrade/apply.go b/cmd/kubeadm/app/cmd/upgrade/apply.go index b8ee8a10b70..2430701d072 100644 --- a/cmd/kubeadm/app/cmd/upgrade/apply.go +++ b/cmd/kubeadm/app/cmd/upgrade/apply.go @@ -74,9 +74,9 @@ func NewCmdApply(apf *applyPlanFlags) *cobra.Command { } cmd := &cobra.Command{ - Use: "apply [version]", + Use: "apply [version]", DisableFlagsInUseLine: true, - Short: "Upgrade your Kubernetes cluster to the specified version.", + Short: "Upgrade your Kubernetes cluster to the specified version.", Run: func(cmd *cobra.Command, args []string) { var err error flags.ignorePreflightErrorsSet, err = validation.ValidateIgnorePreflightErrors(flags.ignorePreflightErrors) diff --git a/cmd/kubeadm/app/cmd/upgrade/upgrade.go b/cmd/kubeadm/app/cmd/upgrade/upgrade.go index 84be584e16c..1d2ccabd6c1 100644 --- a/cmd/kubeadm/app/cmd/upgrade/upgrade.go +++ b/cmd/kubeadm/app/cmd/upgrade/upgrade.go @@ -53,7 +53,7 @@ func NewCmdUpgrade(out io.Writer) *cobra.Command { allowRCUpgrades: false, printConfig: false, ignorePreflightErrorsSet: sets.NewString(), - out: out, + out: out, } cmd := &cobra.Command{ diff --git a/cmd/kubeadm/app/componentconfigs/validation_test.go b/cmd/kubeadm/app/componentconfigs/validation_test.go index 0881f2db9fe..29343f8645e 100644 --- a/cmd/kubeadm/app/componentconfigs/validation_test.go +++ b/cmd/kubeadm/app/componentconfigs/validation_test.go @@ -55,9 +55,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -87,9 +87,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -120,9 +120,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -153,9 +153,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -186,9 +186,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -219,9 +219,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -252,9 +252,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: utilpointer.Int32Ptr(2), - MaxPerCore: utilpointer.Int32Ptr(1), - Min: utilpointer.Int32Ptr(1), + Max: utilpointer.Int32Ptr(2), + MaxPerCore: utilpointer.Int32Ptr(1), + Min: utilpointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, diff --git a/cmd/kubeadm/app/phases/addons/proxy/proxy_test.go b/cmd/kubeadm/app/phases/addons/proxy/proxy_test.go index c04558a33c9..9d7ab37bcba 100644 --- a/cmd/kubeadm/app/phases/addons/proxy/proxy_test.go +++ b/cmd/kubeadm/app/phases/addons/proxy/proxy_test.go @@ -210,9 +210,9 @@ func TestEnsureProxyAddon(t *testing.T) { HealthzBindAddress: "0.0.0.0:10256", MetricsBindAddress: "127.0.0.1:10249", Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, diff --git a/cmd/kubeadm/app/phases/kubelet/flags.go b/cmd/kubeadm/app/phases/kubelet/flags.go index ad1b9aff6ec..05ffc1ad7d5 100644 --- a/cmd/kubeadm/app/phases/kubelet/flags.go +++ b/cmd/kubeadm/app/phases/kubelet/flags.go @@ -55,9 +55,9 @@ func WriteKubeletDynamicEnvFile(nodeRegOpts *kubeadmapi.NodeRegistrationOptions, nodeRegOpts: nodeRegOpts, featureGates: featureGates, registerTaintsUsingFlags: registerTaintsUsingFlags, - execer: utilsexec.New(), - pidOfFunc: procfs.PidOf, - defaultHostname: hostName, + execer: utilsexec.New(), + pidOfFunc: procfs.PidOf, + defaultHostname: hostName, } stringMap := buildKubeletArgMap(flagOpts) argList := kubeadmutil.BuildArgumentListFromMap(stringMap, nodeRegOpts.KubeletExtraArgs) diff --git a/cmd/kubeadm/app/phases/kubelet/flags_test.go b/cmd/kubeadm/app/phases/kubelet/flags_test.go index 6fa178b555f..b1738750003 100644 --- a/cmd/kubeadm/app/phases/kubelet/flags_test.go +++ b/cmd/kubeadm/app/phases/kubelet/flags_test.go @@ -206,9 +206,9 @@ func TestBuildKubeletArgMap(t *testing.T) { }, }, registerTaintsUsingFlags: true, - execer: cgroupfsCgroupExecer, - pidOfFunc: binaryNotRunningPidOfFunc, - defaultHostname: "foo", + execer: cgroupfsCgroupExecer, + pidOfFunc: binaryNotRunningPidOfFunc, + defaultHostname: "foo", }, expected: map[string]string{ "container-runtime": "remote", diff --git a/cmd/kubeadm/app/phases/selfhosting/podspec_mutation_test.go b/cmd/kubeadm/app/phases/selfhosting/podspec_mutation_test.go index 6a5f1da8a8b..8f3e64164cf 100644 --- a/cmd/kubeadm/app/phases/selfhosting/podspec_mutation_test.go +++ b/cmd/kubeadm/app/phases/selfhosting/podspec_mutation_test.go @@ -130,7 +130,7 @@ func TestAddNodeSelectorToPodSpec(t *testing.T) { }, expected: v1.PodSpec{ NodeSelector: map[string]string{ - "foo": "bar", + "foo": "bar", kubeadmconstants.LabelNodeRoleMaster: "", }, }, diff --git a/cmd/kubeadm/app/phases/uploadconfig/uploadconfig_test.go b/cmd/kubeadm/app/phases/uploadconfig/uploadconfig_test.go index f91e27abcbc..d575e506541 100644 --- a/cmd/kubeadm/app/phases/uploadconfig/uploadconfig_test.go +++ b/cmd/kubeadm/app/phases/uploadconfig/uploadconfig_test.go @@ -166,7 +166,7 @@ func TestGetClusterStatus(t *testing.T) { expectedClusterEndpoints int }{ { - name: "return empty ClusterStatus if cluster kubeadm-config doesn't exist (e.g init)", + name: "return empty ClusterStatus if cluster kubeadm-config doesn't exist (e.g init)", expectedClusterEndpoints: 0, }, { diff --git a/cmd/kubeadm/app/util/kubeconfig/kubeconfig.go b/cmd/kubeadm/app/util/kubeconfig/kubeconfig.go index f2ef0203fa5..1e5216d3819 100644 --- a/cmd/kubeadm/app/util/kubeconfig/kubeconfig.go +++ b/cmd/kubeadm/app/util/kubeconfig/kubeconfig.go @@ -32,7 +32,7 @@ func CreateBasic(serverURL, clusterName, userName string, caCert []byte) *client return &clientcmdapi.Config{ Clusters: map[string]*clientcmdapi.Cluster{ clusterName: { - Server: serverURL, + Server: serverURL, CertificateAuthorityData: caCert, }, }, diff --git a/cmd/kubeadm/app/util/system/package_validator_test.go b/cmd/kubeadm/app/util/system/package_validator_test.go index 02353423c02..0e57fb50865 100644 --- a/cmd/kubeadm/app/util/system/package_validator_test.go +++ b/cmd/kubeadm/app/util/system/package_validator_test.go @@ -166,8 +166,8 @@ func TestValidatePackageVersion(t *testing.T) { testKernelRelease := "test-kernel-release" manager := testPackageManager{ packageVersions: map[string]string{ - "foo": "1.0.0", - "bar": "2.1.0", + "foo": "1.0.0", + "bar": "2.1.0", "bar-" + testKernelRelease: "3.0.0", }, } diff --git a/pkg/api/service/util_test.go b/pkg/api/service/util_test.go index 46790a170b4..5fb31f7b5de 100644 --- a/pkg/api/service/util_test.go +++ b/pkg/api/service/util_test.go @@ -151,25 +151,25 @@ func TestRequestsOnlyLocalTraffic(t *testing.T) { }) checkRequestsOnlyLocalTraffic(false, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeNodePort, + Type: api.ServiceTypeNodePort, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster, }, }) checkRequestsOnlyLocalTraffic(true, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeNodePort, + Type: api.ServiceTypeNodePort, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeLocal, }, }) checkRequestsOnlyLocalTraffic(false, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeLoadBalancer, + Type: api.ServiceTypeLoadBalancer, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster, }, }) checkRequestsOnlyLocalTraffic(true, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeLoadBalancer, + Type: api.ServiceTypeLoadBalancer, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeLocal, }, }) @@ -191,25 +191,25 @@ func TestNeedsHealthCheck(t *testing.T) { }) checkNeedsHealthCheck(false, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeNodePort, + Type: api.ServiceTypeNodePort, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster, }, }) checkNeedsHealthCheck(false, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeNodePort, + Type: api.ServiceTypeNodePort, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeLocal, }, }) checkNeedsHealthCheck(false, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeLoadBalancer, + Type: api.ServiceTypeLoadBalancer, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster, }, }) checkNeedsHealthCheck(true, &api.Service{ Spec: api.ServiceSpec{ - Type: api.ServiceTypeLoadBalancer, + Type: api.ServiceTypeLoadBalancer, ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeLocal, }, }) diff --git a/pkg/api/v1/service/util_test.go b/pkg/api/v1/service/util_test.go index df9504cbe6c..90b93f129d4 100644 --- a/pkg/api/v1/service/util_test.go +++ b/pkg/api/v1/service/util_test.go @@ -151,25 +151,25 @@ func TestRequestsOnlyLocalTraffic(t *testing.T) { }) checkRequestsOnlyLocalTraffic(false, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeNodePort, + Type: v1.ServiceTypeNodePort, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster, }, }) checkRequestsOnlyLocalTraffic(true, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeNodePort, + Type: v1.ServiceTypeNodePort, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeLocal, }, }) checkRequestsOnlyLocalTraffic(false, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeLoadBalancer, + Type: v1.ServiceTypeLoadBalancer, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster, }, }) checkRequestsOnlyLocalTraffic(true, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeLoadBalancer, + Type: v1.ServiceTypeLoadBalancer, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeLocal, }, }) @@ -191,25 +191,25 @@ func TestNeedsHealthCheck(t *testing.T) { }) checkNeedsHealthCheck(false, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeNodePort, + Type: v1.ServiceTypeNodePort, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster, }, }) checkNeedsHealthCheck(false, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeNodePort, + Type: v1.ServiceTypeNodePort, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeLocal, }, }) checkNeedsHealthCheck(false, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeLoadBalancer, + Type: v1.ServiceTypeLoadBalancer, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster, }, }) checkNeedsHealthCheck(true, &v1.Service{ Spec: v1.ServiceSpec{ - Type: v1.ServiceTypeLoadBalancer, + Type: v1.ServiceTypeLoadBalancer, ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeLocal, }, }) diff --git a/pkg/apis/authorization/validation/validation_test.go b/pkg/apis/authorization/validation/validation_test.go index e96acaf35ae..44168859f0b 100644 --- a/pkg/apis/authorization/validation/validation_test.go +++ b/pkg/apis/authorization/validation/validation_test.go @@ -51,7 +51,7 @@ func TestValidateSARSpec(t *testing.T) { obj: authorizationapi.SubjectAccessReviewSpec{ ResourceAttributes: &authorizationapi.ResourceAttributes{}, NonResourceAttributes: &authorizationapi.NonResourceAttributes{}, - User: "me", + User: "me", }, msg: "cannot be specified in combination with resourceAttributes", }, @@ -183,7 +183,7 @@ func TestValidateLocalSAR(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Namespace: "a"}, Spec: authorizationapi.SubjectAccessReviewSpec{ NonResourceAttributes: &authorizationapi.NonResourceAttributes{}, - User: "user", + User: "user", }, }, msg: "disallowed on this kind of request", diff --git a/pkg/apis/autoscaling/v2beta1/defaults.go b/pkg/apis/autoscaling/v2beta1/defaults.go index e08f96b92f5..5fdf8e7122c 100644 --- a/pkg/apis/autoscaling/v2beta1/defaults.go +++ b/pkg/apis/autoscaling/v2beta1/defaults.go @@ -39,7 +39,7 @@ func SetDefaults_HorizontalPodAutoscaler(obj *autoscalingv2beta1.HorizontalPodAu { Type: autoscalingv2beta1.ResourceMetricSourceType, Resource: &autoscalingv2beta1.ResourceMetricSource{ - Name: v1.ResourceCPU, + Name: v1.ResourceCPU, TargetAverageUtilization: &utilizationDefaultVal, }, }, diff --git a/pkg/apis/autoscaling/v2beta1/defaults_test.go b/pkg/apis/autoscaling/v2beta1/defaults_test.go index 97d5a06189e..a68e39f1597 100644 --- a/pkg/apis/autoscaling/v2beta1/defaults_test.go +++ b/pkg/apis/autoscaling/v2beta1/defaults_test.go @@ -39,7 +39,7 @@ func TestSetDefaultHPA(t *testing.T) { { Type: autoscalingv2beta1.ResourceMetricSourceType, Resource: &autoscalingv2beta1.ResourceMetricSource{ - Name: v1.ResourceCPU, + Name: v1.ResourceCPU, TargetAverageUtilization: &utilizationDefaultVal, }, }, diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go index aca1a5b3370..858b6e0a1c4 100644 --- a/pkg/apis/core/validation/validation_test.go +++ b/pkg/apis/core/validation/validation_test.go @@ -10285,14 +10285,14 @@ func TestValidateNode(t *testing.T) { for i := range errs { field := errs[i].Field expectedFields := map[string]bool{ - "metadata.name": true, - "metadata.labels": true, - "metadata.annotations": true, - "metadata.namespace": true, - "spec.externalID": true, - "spec.taints[0].key": true, - "spec.taints[0].value": true, - "spec.taints[0].effect": true, + "metadata.name": true, + "metadata.labels": true, + "metadata.annotations": true, + "metadata.namespace": true, + "spec.externalID": true, + "spec.taints[0].key": true, + "spec.taints[0].value": true, + "spec.taints[0].effect": true, "metadata.annotations.scheduler.alpha.kubernetes.io/preferAvoidPods[0].PodSignature": true, "metadata.annotations.scheduler.alpha.kubernetes.io/preferAvoidPods[0].PodSignature.PodController.Controller": true, } @@ -12235,7 +12235,7 @@ func TestValidateBasicAuthSecret(t *testing.T) { secret core.Secret valid bool }{ - "valid": {validBasicAuthSecret(), true}, + "valid": {validBasicAuthSecret(), true}, "missing username and password": {missingBasicAuthUsernamePasswordKeys, false}, } diff --git a/pkg/cloudprovider/providers/aws/aws_test.go b/pkg/cloudprovider/providers/aws/aws_test.go index 9ff80e4c35c..6e86f406c50 100644 --- a/pkg/cloudprovider/providers/aws/aws_test.go +++ b/pkg/cloudprovider/providers/aws/aws_test.go @@ -1123,7 +1123,7 @@ func TestGetLoadBalancerAdditionalTags(t *testing.T) { { Annotations: map[string]string{ ServiceAnnotationLoadBalancerAdditionalTags: "Key1=, Key2=Val2", - "anotherKey": "anotherValue", + "anotherKey": "anotherValue", }, Tags: map[string]string{ "Key1": "", diff --git a/pkg/cloudprovider/providers/azure/azure_loadbalancer.go b/pkg/cloudprovider/providers/azure/azure_loadbalancer.go index 7d5d176ef92..12b7d3922b8 100644 --- a/pkg/cloudprovider/providers/azure/azure_loadbalancer.go +++ b/pkg/cloudprovider/providers/azure/azure_loadbalancer.go @@ -702,7 +702,7 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, newConfigs = append(newConfigs, network.FrontendIPConfiguration{ - Name: to.StringPtr(lbFrontendIPConfigName), + Name: to.StringPtr(lbFrontendIPConfigName), FrontendIPConfigurationPropertiesFormat: fipConfigurationProperties, }) glog.V(10).Infof("reconcileLoadBalancer for service (%s)(%t): lb frontendconfig(%s) - adding", serviceName, wantLb, lbFrontendIPConfigName) @@ -1025,8 +1025,8 @@ func (az *Cloud) reconcileSecurityGroup(clusterName string, service *v1.Service, DestinationPortRange: to.StringPtr(strconv.Itoa(int(port.Port))), SourceAddressPrefix: to.StringPtr(sourceAddressPrefixes[j]), DestinationAddressPrefix: to.StringPtr(destinationIPAddress), - Access: network.SecurityRuleAccessAllow, - Direction: network.SecurityRuleDirectionInbound, + Access: network.SecurityRuleAccessAllow, + Direction: network.SecurityRuleDirectionInbound, }, } } @@ -1226,8 +1226,8 @@ func makeConsolidatable(rule network.SecurityRule) network.SecurityRule { SourceAddressPrefix: rule.SourceAddressPrefix, SourceAddressPrefixes: rule.SourceAddressPrefixes, DestinationAddressPrefixes: collectionOrSingle(rule.DestinationAddressPrefixes, rule.DestinationAddressPrefix), - Access: rule.Access, - Direction: rule.Direction, + Access: rule.Access, + Direction: rule.Direction, }, } } @@ -1248,8 +1248,8 @@ func consolidate(existingRule network.SecurityRule, newRule network.SecurityRule SourceAddressPrefix: existingRule.SourceAddressPrefix, SourceAddressPrefixes: existingRule.SourceAddressPrefixes, DestinationAddressPrefixes: destinations, - Access: existingRule.Access, - Direction: existingRule.Direction, + Access: existingRule.Access, + Direction: existingRule.Direction, }, } } diff --git a/pkg/cloudprovider/providers/azure/azure_storageaccount.go b/pkg/cloudprovider/providers/azure/azure_storageaccount.go index 94e6f862935..7c885f31009 100644 --- a/pkg/cloudprovider/providers/azure/azure_storageaccount.go +++ b/pkg/cloudprovider/providers/azure/azure_storageaccount.go @@ -114,10 +114,10 @@ func (az *Cloud) ensureStorageAccount(accountName, accountType, resourceGroup, l cp := storage.AccountCreateParameters{ Sku: &storage.Sku{Name: storage.SkuName(accountType)}, // switch to use StorageV2 as it's recommended according to https://docs.microsoft.com/en-us/azure/storage/common/storage-account-options - Kind: storage.StorageV2, + Kind: storage.StorageV2, AccountPropertiesCreateParameters: &storage.AccountPropertiesCreateParameters{EnableHTTPSTrafficOnly: to.BoolPtr(true)}, - Tags: map[string]*string{"created-by": to.StringPtr("azure")}, - Location: &location} + Tags: map[string]*string{"created-by": to.StringPtr("azure")}, + Location: &location} ctx, cancel := getContextWithCancel() defer cancel() diff --git a/pkg/cloudprovider/providers/azure/azure_test.go b/pkg/cloudprovider/providers/azure/azure_test.go index 2d243a9e7a8..b708976a618 100644 --- a/pkg/cloudprovider/providers/azure/azure_test.go +++ b/pkg/cloudprovider/providers/azure/azure_test.go @@ -952,7 +952,7 @@ func getTestCloud() (az *Cloud) { RouteTableName: "rt", PrimaryAvailabilitySetName: "as", MaximumLoadBalancerRuleCount: 250, - VMType: vmTypeStandard, + VMType: vmTypeStandard, }, nodeZones: map[string]sets.String{}, nodeInformerSynced: func() bool { return true }, @@ -1968,8 +1968,8 @@ func TestIfServiceSpecifiesSharedRuleAndRuleExistsThenTheServicesPortAndAddressA SourceAddressPrefix: to.StringPtr("Internet"), DestinationPortRange: to.StringPtr("80"), DestinationAddressPrefix: to.StringPtr("192.168.33.44"), - Access: network.SecurityRuleAccessAllow, - Direction: network.SecurityRuleDirectionInbound, + Access: network.SecurityRuleAccessAllow, + Direction: network.SecurityRuleDirectionInbound, }, }, } diff --git a/pkg/cloudprovider/providers/gce/gce_test.go b/pkg/cloudprovider/providers/gce/gce_test.go index 9747dfea5e5..1bb2c12d42d 100644 --- a/pkg/cloudprovider/providers/gce/gce_test.go +++ b/pkg/cloudprovider/providers/gce/gce_test.go @@ -529,9 +529,9 @@ func TestGetRegionInURL(t *testing.T) { "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-central1/subnetworks/a": "us-central1", "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-west2/subnetworks/b": "us-west2", "projects/my-project/regions/asia-central1/subnetworks/c": "asia-central1", - "regions/europe-north2": "europe-north2", - "my-url": "", - "": "", + "regions/europe-north2": "europe-north2", + "my-url": "", + "": "", } for input, output := range cases { result := getRegionInURL(input) diff --git a/pkg/cloudprovider/providers/vsphere/vclib/volumeoptions.go b/pkg/cloudprovider/providers/vsphere/vclib/volumeoptions.go index 75dadb437ee..eceba70496c 100644 --- a/pkg/cloudprovider/providers/vsphere/vclib/volumeoptions.go +++ b/pkg/cloudprovider/providers/vsphere/vclib/volumeoptions.go @@ -38,7 +38,7 @@ type VolumeOptions struct { var ( // DiskFormatValidType specifies the valid disk formats DiskFormatValidType = map[string]string{ - ThinDiskType: ThinDiskType, + ThinDiskType: ThinDiskType, strings.ToLower(EagerZeroedThickDiskType): EagerZeroedThickDiskType, strings.ToLower(ZeroedThickDiskType): PreallocatedDiskType, } diff --git a/pkg/controller/controller_utils_test.go b/pkg/controller/controller_utils_test.go index 999efadb68b..c2c3d425d64 100644 --- a/pkg/controller/controller_utils_test.go +++ b/pkg/controller/controller_utils_test.go @@ -82,7 +82,7 @@ func newReplicationController(replicas int) *v1.ReplicationController { Spec: v1.PodSpec{ Containers: []v1.Container{ { - Image: "foo/bar", + Image: "foo/bar", TerminationMessagePath: v1.TerminationMessagePathDefault, ImagePullPolicy: v1.PullIfNotPresent, SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(), @@ -144,7 +144,7 @@ func newReplicaSet(name string, replicas int) *apps.ReplicaSet { Spec: v1.PodSpec{ Containers: []v1.Container{ { - Image: "foo/bar", + Image: "foo/bar", TerminationMessagePath: v1.TerminationMessagePathDefault, ImagePullPolicy: v1.PullIfNotPresent, SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(), diff --git a/pkg/controller/daemon/daemon_controller_test.go b/pkg/controller/daemon/daemon_controller_test.go index c0bda46d540..83b7d1062a0 100644 --- a/pkg/controller/daemon/daemon_controller_test.go +++ b/pkg/controller/daemon/daemon_controller_test.go @@ -111,7 +111,7 @@ func newDaemonSet(name string) *apps.DaemonSet { Spec: v1.PodSpec{ Containers: []v1.Container{ { - Image: "foo/bar", + Image: "foo/bar", TerminationMessagePath: v1.TerminationMessagePathDefault, ImagePullPolicy: v1.PullIfNotPresent, SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(), @@ -180,7 +180,7 @@ func newPod(podName string, nodeName string, label map[string]string, ds *apps.D podSpec = v1.PodSpec{ Containers: []v1.Container{ { - Image: "foo/bar", + Image: "foo/bar", TerminationMessagePath: v1.TerminationMessagePathDefault, ImagePullPolicy: v1.PullIfNotPresent, SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(), diff --git a/pkg/controller/namespace/namespace_controller.go b/pkg/controller/namespace/namespace_controller.go index 3164d290b93..396f1a3ead4 100644 --- a/pkg/controller/namespace/namespace_controller.go +++ b/pkg/controller/namespace/namespace_controller.go @@ -71,7 +71,7 @@ func NewNamespaceController( // create the controller so we can inject the enqueue function namespaceController := &NamespaceController{ - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "namespace"), + queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "namespace"), namespacedResourcesDeleter: deletion.NewNamespacedResourcesDeleter(kubeClient.CoreV1().Namespaces(), dynamicClient, kubeClient.CoreV1(), discoverResourcesFn, finalizerToken, true), } diff --git a/pkg/controller/podautoscaler/horizontal.go b/pkg/controller/podautoscaler/horizontal.go index 2e1c763084a..1ac7c1f9800 100644 --- a/pkg/controller/podautoscaler/horizontal.go +++ b/pkg/controller/podautoscaler/horizontal.go @@ -117,9 +117,9 @@ func NewHorizontalController( scaleNamespacer: scaleNamespacer, hpaNamespacer: hpaNamespacer, downscaleStabilisationWindow: downscaleStabilisationWindow, - queue: workqueue.NewNamedRateLimitingQueue(NewDefaultHPARateLimiter(resyncPeriod), "horizontalpodautoscaler"), - mapper: mapper, - recommendations: map[string][]timestampedRecommendation{}, + queue: workqueue.NewNamedRateLimitingQueue(NewDefaultHPARateLimiter(resyncPeriod), "horizontalpodautoscaler"), + mapper: mapper, + recommendations: map[string][]timestampedRecommendation{}, } hpaInformer.Informer().AddEventHandlerWithResyncPeriod( diff --git a/pkg/controller/podautoscaler/legacy_horizontal_test.go b/pkg/controller/podautoscaler/legacy_horizontal_test.go index 52919a7362a..6d0bf6cdc4a 100644 --- a/pkg/controller/podautoscaler/legacy_horizontal_test.go +++ b/pkg/controller/podautoscaler/legacy_horizontal_test.go @@ -179,7 +179,7 @@ func (tc *legacyTestCase) prepareTestClient(t *testing.T) (*fake.Clientset, *sca { Type: autoscalingv2.ResourceMetricSourceType, Resource: &autoscalingv2.ResourceMetricSource{ - Name: v1.ResourceCPU, + Name: v1.ResourceCPU, TargetAverageUtilization: &tc.CPUTarget, }, }, diff --git a/pkg/controller/replicaset/replica_set_test.go b/pkg/controller/replicaset/replica_set_test.go index 43f7ff22c0c..f737e9d27a6 100644 --- a/pkg/controller/replicaset/replica_set_test.go +++ b/pkg/controller/replicaset/replica_set_test.go @@ -101,7 +101,7 @@ func newReplicaSet(replicas int, selectorMap map[string]string) *apps.ReplicaSet Spec: v1.PodSpec{ Containers: []v1.Container{ { - Image: "foo/bar", + Image: "foo/bar", TerminationMessagePath: v1.TerminationMessagePathDefault, ImagePullPolicy: v1.PullIfNotPresent, SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(), diff --git a/pkg/controller/serviceaccount/serviceaccounts_controller.go b/pkg/controller/serviceaccount/serviceaccounts_controller.go index 4d0f53bb0b9..bf01f8b39a7 100644 --- a/pkg/controller/serviceaccount/serviceaccounts_controller.go +++ b/pkg/controller/serviceaccount/serviceaccounts_controller.go @@ -65,7 +65,7 @@ func NewServiceAccountsController(saInformer coreinformers.ServiceAccountInforme e := &ServiceAccountsController{ client: cl, serviceAccountsToEnsure: options.ServiceAccounts, - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "serviceaccount"), + queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "serviceaccount"), } if cl != nil && cl.CoreV1().RESTClient().GetRateLimiter() != nil { if err := metrics.RegisterMetricAndTrackRateLimiterUsage("serviceaccount_controller", cl.CoreV1().RESTClient().GetRateLimiter()); err != nil { diff --git a/pkg/controller/volume/persistentvolume/index_test.go b/pkg/controller/volume/persistentvolume/index_test.go index e2053fe830c..8ad390daf89 100644 --- a/pkg/controller/volume/persistentvolume/index_test.go +++ b/pkg/controller/volume/persistentvolume/index_test.go @@ -1245,27 +1245,27 @@ func TestAlphaStorageObjectInUseProtectionFiltering(t *testing.T) { enableStorageObjectInUseProtection bool }{ "feature enabled - pv deletionTimeStamp not set": { - isExpectedMatch: true, - vol: pv, - pvc: pvc, + isExpectedMatch: true, + vol: pv, + pvc: pvc, enableStorageObjectInUseProtection: true, }, "feature enabled - pv deletionTimeStamp set": { - isExpectedMatch: false, - vol: pvToDelete, - pvc: pvc, + isExpectedMatch: false, + vol: pvToDelete, + pvc: pvc, enableStorageObjectInUseProtection: true, }, "feature disabled - pv deletionTimeStamp not set": { - isExpectedMatch: true, - vol: pv, - pvc: pvc, + isExpectedMatch: true, + vol: pv, + pvc: pvc, enableStorageObjectInUseProtection: false, }, "feature disabled - pv deletionTimeStamp set": { - isExpectedMatch: true, - vol: pvToDelete, - pvc: pvc, + isExpectedMatch: true, + vol: pvToDelete, + pvc: pvc, enableStorageObjectInUseProtection: false, }, } @@ -1291,27 +1291,27 @@ func TestAlphaStorageObjectInUseProtectionFiltering(t *testing.T) { enableStorageObjectInUseProtection bool }{ "feature enabled - pv deletionTimeStamp not set": { - isExpectedMatch: true, - vol: createTestVolOrderedIndex(pv), - pvc: pvc, + isExpectedMatch: true, + vol: createTestVolOrderedIndex(pv), + pvc: pvc, enableStorageObjectInUseProtection: true, }, "feature enabled - pv deletionTimeStamp set": { - isExpectedMatch: false, - vol: createTestVolOrderedIndex(pvToDelete), - pvc: pvc, + isExpectedMatch: false, + vol: createTestVolOrderedIndex(pvToDelete), + pvc: pvc, enableStorageObjectInUseProtection: true, }, "feature disabled - pv deletionTimeStamp not set": { - isExpectedMatch: true, - vol: createTestVolOrderedIndex(pv), - pvc: pvc, + isExpectedMatch: true, + vol: createTestVolOrderedIndex(pv), + pvc: pvc, enableStorageObjectInUseProtection: false, }, "feature disabled - pv deletionTimeStamp set": { - isExpectedMatch: true, - vol: createTestVolOrderedIndex(pvToDelete), - pvc: pvc, + isExpectedMatch: true, + vol: createTestVolOrderedIndex(pvToDelete), + pvc: pvc, enableStorageObjectInUseProtection: false, }, } diff --git a/pkg/controller/volume/persistentvolume/pv_controller_base.go b/pkg/controller/volume/persistentvolume/pv_controller_base.go index 40e78824843..4c07da0e9d2 100644 --- a/pkg/controller/volume/persistentvolume/pv_controller_base.go +++ b/pkg/controller/volume/persistentvolume/pv_controller_base.go @@ -79,12 +79,12 @@ func NewController(p ControllerParameters) (*PersistentVolumeController, error) } controller := &PersistentVolumeController{ - volumes: newPersistentVolumeOrderedIndex(), - claims: cache.NewStore(cache.DeletionHandlingMetaNamespaceKeyFunc), - kubeClient: p.KubeClient, - eventRecorder: eventRecorder, - runningOperations: goroutinemap.NewGoRoutineMap(true /* exponentialBackOffOnError */), - cloud: p.Cloud, + volumes: newPersistentVolumeOrderedIndex(), + claims: cache.NewStore(cache.DeletionHandlingMetaNamespaceKeyFunc), + kubeClient: p.KubeClient, + eventRecorder: eventRecorder, + runningOperations: goroutinemap.NewGoRoutineMap(true /* exponentialBackOffOnError */), + cloud: p.Cloud, enableDynamicProvisioning: p.EnableDynamicProvisioning, clusterName: p.ClusterName, createProvisionedPVRetryCount: createProvisionedPVRetryCount, diff --git a/pkg/controller/volume/pvcprotection/pvc_protection_controller.go b/pkg/controller/volume/pvcprotection/pvc_protection_controller.go index cfa7658e6e7..8de612fffdf 100644 --- a/pkg/controller/volume/pvcprotection/pvc_protection_controller.go +++ b/pkg/controller/volume/pvcprotection/pvc_protection_controller.go @@ -57,8 +57,8 @@ type Controller struct { // NewPVCProtectionController returns a new instance of PVCProtectionController. func NewPVCProtectionController(pvcInformer coreinformers.PersistentVolumeClaimInformer, podInformer coreinformers.PodInformer, cl clientset.Interface, storageObjectInUseProtectionFeatureEnabled bool) *Controller { e := &Controller{ - client: cl, - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "pvcprotection"), + client: cl, + queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "pvcprotection"), storageObjectInUseProtectionEnabled: storageObjectInUseProtectionFeatureEnabled, } if cl != nil && cl.CoreV1().RESTClient().GetRateLimiter() != nil { diff --git a/pkg/controller/volume/pvprotection/pv_protection_controller.go b/pkg/controller/volume/pvprotection/pv_protection_controller.go index 7764c693827..bc19eb5e527 100644 --- a/pkg/controller/volume/pvprotection/pv_protection_controller.go +++ b/pkg/controller/volume/pvprotection/pv_protection_controller.go @@ -53,8 +53,8 @@ type Controller struct { // NewPVProtectionController returns a new *Controller. func NewPVProtectionController(pvInformer coreinformers.PersistentVolumeInformer, cl clientset.Interface, storageObjectInUseProtectionFeatureEnabled bool) *Controller { e := &Controller{ - client: cl, - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "pvprotection"), + client: cl, + queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "pvprotection"), storageObjectInUseProtectionEnabled: storageObjectInUseProtectionFeatureEnabled, } if cl != nil && cl.CoreV1().RESTClient().GetRateLimiter() != nil { diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index c03e93c6c83..54c84c8fa79 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -387,8 +387,8 @@ func init() { // To add a new feature, define a key for it above and add it here. The features will be // available throughout Kubernetes binaries. var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{ - AppArmor: {Default: true, PreRelease: utilfeature.Beta}, - DynamicKubeletConfig: {Default: true, PreRelease: utilfeature.Beta}, + AppArmor: {Default: true, PreRelease: utilfeature.Beta}, + DynamicKubeletConfig: {Default: true, PreRelease: utilfeature.Beta}, ExperimentalHostUserNamespaceDefaultingGate: {Default: false, PreRelease: utilfeature.Beta}, ExperimentalCriticalPodAnnotation: {Default: false, PreRelease: utilfeature.Alpha}, DevicePlugins: {Default: true, PreRelease: utilfeature.Beta}, diff --git a/pkg/fieldpath/fieldpath_test.go b/pkg/fieldpath/fieldpath_test.go index 66b2b325041..efa8e99477f 100644 --- a/pkg/fieldpath/fieldpath_test.go +++ b/pkg/fieldpath/fieldpath_test.go @@ -160,9 +160,9 @@ func TestExtractFieldPathAsString(t *testing.T) { expectedMessageFragment: "invalid key subscript in metadata.labels", }, { - name: "invalid subscript", - fieldPath: "metadata.notexisting['something']", - obj: &v1.Pod{}, + name: "invalid subscript", + fieldPath: "metadata.notexisting['something']", + obj: &v1.Pod{}, expectedMessageFragment: "fieldPath \"metadata.notexisting['something']\" does not support subscript", }, } diff --git a/pkg/kubeapiserver/options/authorization.go b/pkg/kubeapiserver/options/authorization.go index 3c5559ef031..585e3ecfb8f 100644 --- a/pkg/kubeapiserver/options/authorization.go +++ b/pkg/kubeapiserver/options/authorization.go @@ -39,7 +39,7 @@ type BuiltInAuthorizationOptions struct { func NewBuiltInAuthorizationOptions() *BuiltInAuthorizationOptions { return &BuiltInAuthorizationOptions{ - Modes: []string{authzmodes.ModeAlwaysAllow}, + Modes: []string{authzmodes.ModeAlwaysAllow}, WebhookCacheAuthorizedTTL: 5 * time.Minute, WebhookCacheUnauthorizedTTL: 30 * time.Second, } diff --git a/pkg/kubectl/cmd/annotate.go b/pkg/kubectl/cmd/annotate.go index 9c6d96a393e..0cf8e532829 100644 --- a/pkg/kubectl/cmd/annotate.go +++ b/pkg/kubectl/cmd/annotate.go @@ -123,11 +123,11 @@ func NewCmdAnnotate(parent string, f cmdutil.Factory, ioStreams genericclioption o := NewAnnotateOptions(ioStreams) cmd := &cobra.Command{ - Use: "annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]", + Use: "annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]", DisableFlagsInUseLine: true, - Short: i18n.T("Update the annotations on a resource"), - Long: annotateLong + "\n\n" + cmdutil.SuggestApiResources(parent), - Example: annotateExample, + Short: i18n.T("Update the annotations on a resource"), + Long: annotateLong + "\n\n" + cmdutil.SuggestApiResources(parent), + Example: annotateExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/apply.go b/pkg/kubectl/cmd/apply.go index ee8b8e3f0c9..834e4d99ec0 100644 --- a/pkg/kubectl/cmd/apply.go +++ b/pkg/kubectl/cmd/apply.go @@ -146,11 +146,11 @@ func NewCmdApply(baseName string, f cmdutil.Factory, ioStreams genericclioptions o.cmdBaseName = baseName cmd := &cobra.Command{ - Use: "apply -f FILENAME", + Use: "apply -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Apply a configuration to a resource by filename or stdin"), - Long: applyLong, - Example: applyExample, + Short: i18n.T("Apply a configuration to a resource by filename or stdin"), + Long: applyLong, + Example: applyExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) cmdutil.CheckErr(validateArgs(cmd, args)) diff --git a/pkg/kubectl/cmd/apply_edit_last_applied.go b/pkg/kubectl/cmd/apply_edit_last_applied.go index 1312049910f..5a3fa438cf4 100644 --- a/pkg/kubectl/cmd/apply_edit_last_applied.go +++ b/pkg/kubectl/cmd/apply_edit_last_applied.go @@ -59,11 +59,11 @@ func NewCmdApplyEditLastApplied(f cmdutil.Factory, ioStreams genericclioptions.I o := editor.NewEditOptions(editor.ApplyEditMode, ioStreams) cmd := &cobra.Command{ - Use: "edit-last-applied (RESOURCE/NAME | -f FILENAME)", + Use: "edit-last-applied (RESOURCE/NAME | -f FILENAME)", DisableFlagsInUseLine: true, - Short: "Edit latest last-applied-configuration annotations of a resource/object", - Long: applyEditLastAppliedLong, - Example: applyEditLastAppliedExample, + Short: "Edit latest last-applied-configuration annotations of a resource/object", + Long: applyEditLastAppliedLong, + Example: applyEditLastAppliedExample, Run: func(cmd *cobra.Command, args []string) { if err := o.Complete(f, args, cmd); err != nil { cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/apply_set_last_applied.go b/pkg/kubectl/cmd/apply_set_last_applied.go index 899e7311fbb..e7ddad85585 100644 --- a/pkg/kubectl/cmd/apply_set_last_applied.go +++ b/pkg/kubectl/cmd/apply_set_last_applied.go @@ -91,11 +91,11 @@ func NewSetLastAppliedOptions(ioStreams genericclioptions.IOStreams) *SetLastApp func NewCmdApplySetLastApplied(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { o := NewSetLastAppliedOptions(ioStreams) cmd := &cobra.Command{ - Use: "set-last-applied -f FILENAME", + Use: "set-last-applied -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Set the last-applied-configuration annotation on a live object to match the contents of a file."), - Long: applySetLastAppliedLong, - Example: applySetLastAppliedExample, + Short: i18n.T("Set the last-applied-configuration annotation on a live object to match the contents of a file."), + Long: applySetLastAppliedLong, + Example: applySetLastAppliedExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/apply_view_last_applied.go b/pkg/kubectl/cmd/apply_view_last_applied.go index c960ee5e0af..33900ccb858 100644 --- a/pkg/kubectl/cmd/apply_view_last_applied.go +++ b/pkg/kubectl/cmd/apply_view_last_applied.go @@ -69,11 +69,11 @@ func NewCmdApplyViewLastApplied(f cmdutil.Factory, ioStreams genericclioptions.I options := NewViewLastAppliedOptions(ioStreams) cmd := &cobra.Command{ - Use: "view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)", + Use: "view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)", DisableFlagsInUseLine: true, - Short: i18n.T("View latest last-applied-configuration annotations of a resource/object"), - Long: applyViewLastAppliedLong, - Example: applyViewLastAppliedExample, + Short: i18n.T("View latest last-applied-configuration annotations of a resource/object"), + Long: applyViewLastAppliedLong, + Example: applyViewLastAppliedExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(cmd, f, args)) cmdutil.CheckErr(options.Validate(cmd)) diff --git a/pkg/kubectl/cmd/attach.go b/pkg/kubectl/cmd/attach.go index 54d7dcfcc48..8b11539f0be 100644 --- a/pkg/kubectl/cmd/attach.go +++ b/pkg/kubectl/cmd/attach.go @@ -96,11 +96,11 @@ func NewAttachOptions(streams genericclioptions.IOStreams) *AttachOptions { func NewCmdAttach(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { o := NewAttachOptions(streams) cmd := &cobra.Command{ - Use: "attach (POD | TYPE/NAME) -c CONTAINER", + Use: "attach (POD | TYPE/NAME) -c CONTAINER", DisableFlagsInUseLine: true, - Short: i18n.T("Attach to a running container"), - Long: "Attach to a process that is already running inside an existing container.", - Example: attachExample, + Short: i18n.T("Attach to a running container"), + Long: "Attach to a process that is already running inside an existing container.", + Example: attachExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/attach_test.go b/pkg/kubectl/cmd/attach_test.go index f7e51847bc5..9b0e8dc1b50 100644 --- a/pkg/kubectl/cmd/attach_test.go +++ b/pkg/kubectl/cmd/attach_test.go @@ -83,7 +83,7 @@ func TestPodAndContainerAttach(t *testing.T) { args: []string{"foo"}, expectedPodName: "foo", expectedContainerName: "bar", - obj: attachPod(), + obj: attachPod(), }, { name: "container in flag", @@ -91,7 +91,7 @@ func TestPodAndContainerAttach(t *testing.T) { args: []string{"foo"}, expectedPodName: "foo", expectedContainerName: "bar", - obj: attachPod(), + obj: attachPod(), }, { name: "init container in flag", @@ -99,7 +99,7 @@ func TestPodAndContainerAttach(t *testing.T) { args: []string{"foo"}, expectedPodName: "foo", expectedContainerName: "initfoo", - obj: attachPod(), + obj: attachPod(), }, { name: "non-existing container", @@ -115,7 +115,7 @@ func TestPodAndContainerAttach(t *testing.T) { args: []string{"pods", "foo"}, expectedPodName: "foo", expectedContainerName: "bar", - obj: attachPod(), + obj: attachPod(), }, { name: "invalid get pod timeout value", @@ -123,8 +123,8 @@ func TestPodAndContainerAttach(t *testing.T) { args: []string{"pod/foo"}, expectedPodName: "foo", expectedContainerName: "bar", - obj: attachPod(), - expectError: "must be higher than zero", + obj: attachPod(), + expectError: "must be higher than zero", }, } diff --git a/pkg/kubectl/cmd/auth/cani.go b/pkg/kubectl/cmd/auth/cani.go index 7762fa7c254..8ed38fb7fd9 100644 --- a/pkg/kubectl/cmd/auth/cani.go +++ b/pkg/kubectl/cmd/auth/cani.go @@ -86,11 +86,11 @@ func NewCmdCanI(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C } cmd := &cobra.Command{ - Use: "can-i VERB [TYPE | TYPE/NAME | NONRESOURCEURL]", + Use: "can-i VERB [TYPE | TYPE/NAME | NONRESOURCEURL]", DisableFlagsInUseLine: true, - Short: "Check whether an action is allowed", - Long: canILong, - Example: canIExample, + Short: "Check whether an action is allowed", + Long: canILong, + Example: canIExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/auth/reconcile.go b/pkg/kubectl/cmd/auth/reconcile.go index 6d042af7e1f..d788c973556 100644 --- a/pkg/kubectl/cmd/auth/reconcile.go +++ b/pkg/kubectl/cmd/auth/reconcile.go @@ -78,11 +78,11 @@ func NewCmdReconcile(f cmdutil.Factory, streams genericclioptions.IOStreams) *co o := NewReconcileOptions(streams) cmd := &cobra.Command{ - Use: "reconcile -f FILENAME", + Use: "reconcile -f FILENAME", DisableFlagsInUseLine: true, - Short: "Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRole binding objects", - Long: reconcileLong, - Example: reconcileExample, + Short: "Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRole binding objects", + Long: reconcileLong, + Example: reconcileExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(cmd, f, args)) cmdutil.CheckErr(o.Validate()) @@ -182,7 +182,7 @@ func (o *ReconcileOptions) RunReconcile() error { reconcileOptions := reconciliation.ReconcileRoleOptions{ Confirm: !o.DryRun, RemoveExtraPermissions: o.RemoveExtraPermissions, - Role: reconciliation.RoleRuleOwner{Role: t}, + Role: reconciliation.RoleRuleOwner{Role: t}, Client: reconciliation.RoleModifier{ NamespaceClient: o.NamespaceClient.Namespaces(), Client: o.RBACClient, @@ -198,7 +198,7 @@ func (o *ReconcileOptions) RunReconcile() error { reconcileOptions := reconciliation.ReconcileRoleOptions{ Confirm: !o.DryRun, RemoveExtraPermissions: o.RemoveExtraPermissions, - Role: reconciliation.ClusterRoleRuleOwner{ClusterRole: t}, + Role: reconciliation.ClusterRoleRuleOwner{ClusterRole: t}, Client: reconciliation.ClusterRoleModifier{ Client: o.RBACClient.ClusterRoles(), }, diff --git a/pkg/kubectl/cmd/autoscale.go b/pkg/kubectl/cmd/autoscale.go index abf87915cc0..5c9333472d3 100644 --- a/pkg/kubectl/cmd/autoscale.go +++ b/pkg/kubectl/cmd/autoscale.go @@ -97,11 +97,11 @@ func NewCmdAutoscale(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) * validArgs := []string{"deployment", "replicaset", "replicationcontroller"} cmd := &cobra.Command{ - Use: "autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]", + Use: "autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]", DisableFlagsInUseLine: true, - Short: i18n.T("Auto-scale a Deployment, ReplicaSet, or ReplicationController"), - Long: autoscaleLong, - Example: autoscaleExample, + Short: i18n.T("Auto-scale a Deployment, ReplicaSet, or ReplicationController"), + Long: autoscaleLong, + Example: autoscaleExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/certificates.go b/pkg/kubectl/cmd/certificates.go index 52d53f13bb4..82a4e2aa40a 100644 --- a/pkg/kubectl/cmd/certificates.go +++ b/pkg/kubectl/cmd/certificates.go @@ -38,10 +38,10 @@ import ( func NewCmdCertificate(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ - Use: "certificate SUBCOMMAND", + Use: "certificate SUBCOMMAND", DisableFlagsInUseLine: true, - Short: i18n.T("Modify certificate resources."), - Long: "Modify certificate resources.", + Short: i18n.T("Modify certificate resources."), + Long: "Modify certificate resources.", Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, @@ -108,9 +108,9 @@ func NewCmdCertificateApprove(f cmdutil.Factory, ioStreams genericclioptions.IOS IOStreams: ioStreams, } cmd := &cobra.Command{ - Use: "approve (-f FILENAME | NAME)", + Use: "approve (-f FILENAME | NAME)", DisableFlagsInUseLine: true, - Short: i18n.T("Approve a certificate signing request"), + Short: i18n.T("Approve a certificate signing request"), Long: templates.LongDesc(` Approve a certificate signing request. @@ -165,9 +165,9 @@ func NewCmdCertificateDeny(f cmdutil.Factory, ioStreams genericclioptions.IOStre IOStreams: ioStreams, } cmd := &cobra.Command{ - Use: "deny (-f FILENAME | NAME)", + Use: "deny (-f FILENAME | NAME)", DisableFlagsInUseLine: true, - Short: i18n.T("Deny a certificate signing request"), + Short: i18n.T("Deny a certificate signing request"), Long: templates.LongDesc(` Deny a certificate signing request. diff --git a/pkg/kubectl/cmd/completion.go b/pkg/kubectl/cmd/completion.go index 4bafc66fea7..3e9c4457005 100644 --- a/pkg/kubectl/cmd/completion.go +++ b/pkg/kubectl/cmd/completion.go @@ -99,11 +99,11 @@ func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command { } cmd := &cobra.Command{ - Use: "completion SHELL", + Use: "completion SHELL", DisableFlagsInUseLine: true, - Short: i18n.T("Output shell completion code for the specified shell (bash or zsh)"), - Long: completion_long, - Example: completion_example, + Short: i18n.T("Output shell completion code for the specified shell (bash or zsh)"), + Long: completion_long, + Example: completion_example, Run: func(cmd *cobra.Command, args []string) { err := RunCompletion(out, boilerPlate, cmd, args) cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/config/config.go b/pkg/kubectl/cmd/config/config.go index 720f59f3599..f75ac8b6b4c 100644 --- a/pkg/kubectl/cmd/config/config.go +++ b/pkg/kubectl/cmd/config/config.go @@ -37,9 +37,9 @@ func NewCmdConfig(f cmdutil.Factory, pathOptions *clientcmd.PathOptions, streams } cmd := &cobra.Command{ - Use: "config SUBCOMMAND", + Use: "config SUBCOMMAND", DisableFlagsInUseLine: true, - Short: i18n.T("Modify kubeconfig files"), + Short: i18n.T("Modify kubeconfig files"), Long: templates.LongDesc(` Modify kubeconfig files using subcommands like "kubectl config set current-context my-context" diff --git a/pkg/kubectl/cmd/config/create_authinfo.go b/pkg/kubectl/cmd/config/create_authinfo.go index 368d47c0fb3..66d0115a2ad 100644 --- a/pkg/kubectl/cmd/config/create_authinfo.go +++ b/pkg/kubectl/cmd/config/create_authinfo.go @@ -100,11 +100,11 @@ func NewCmdConfigSetAuthInfo(out io.Writer, configAccess clientcmd.ConfigAccess) func newCmdConfigSetAuthInfo(out io.Writer, options *createAuthInfoOptions) *cobra.Command { cmd := &cobra.Command{ - Use: fmt.Sprintf("set-credentials NAME [--%v=path/to/certfile] [--%v=path/to/keyfile] [--%v=bearer_token] [--%v=basic_user] [--%v=basic_password] [--%v=provider_name] [--%v=key=value]", clientcmd.FlagCertFile, clientcmd.FlagKeyFile, clientcmd.FlagBearerToken, clientcmd.FlagUsername, clientcmd.FlagPassword, flagAuthProvider, flagAuthProviderArg), + Use: fmt.Sprintf("set-credentials NAME [--%v=path/to/certfile] [--%v=path/to/keyfile] [--%v=bearer_token] [--%v=basic_user] [--%v=basic_password] [--%v=provider_name] [--%v=key=value]", clientcmd.FlagCertFile, clientcmd.FlagKeyFile, clientcmd.FlagBearerToken, clientcmd.FlagUsername, clientcmd.FlagPassword, flagAuthProvider, flagAuthProviderArg), DisableFlagsInUseLine: true, - Short: i18n.T("Sets a user entry in kubeconfig"), - Long: create_authinfo_long, - Example: create_authinfo_example, + Short: i18n.T("Sets a user entry in kubeconfig"), + Long: create_authinfo_long, + Example: create_authinfo_example, Run: func(cmd *cobra.Command, args []string) { err := options.complete(cmd, out) if err != nil { diff --git a/pkg/kubectl/cmd/config/create_cluster.go b/pkg/kubectl/cmd/config/create_cluster.go index f1f2d091bca..310954e0ab6 100644 --- a/pkg/kubectl/cmd/config/create_cluster.go +++ b/pkg/kubectl/cmd/config/create_cluster.go @@ -63,11 +63,11 @@ func NewCmdConfigSetCluster(out io.Writer, configAccess clientcmd.ConfigAccess) options := &createClusterOptions{configAccess: configAccess} cmd := &cobra.Command{ - Use: fmt.Sprintf("set-cluster NAME [--%v=server] [--%v=path/to/certificate/authority] [--%v=true]", clientcmd.FlagAPIServer, clientcmd.FlagCAFile, clientcmd.FlagInsecure), + Use: fmt.Sprintf("set-cluster NAME [--%v=server] [--%v=path/to/certificate/authority] [--%v=true]", clientcmd.FlagAPIServer, clientcmd.FlagCAFile, clientcmd.FlagInsecure), DisableFlagsInUseLine: true, - Short: i18n.T("Sets a cluster entry in kubeconfig"), - Long: create_cluster_long, - Example: create_cluster_example, + Short: i18n.T("Sets a cluster entry in kubeconfig"), + Long: create_cluster_long, + Example: create_cluster_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.complete(cmd)) cmdutil.CheckErr(options.run()) diff --git a/pkg/kubectl/cmd/config/create_context.go b/pkg/kubectl/cmd/config/create_context.go index 46e30df99d9..631db47890f 100644 --- a/pkg/kubectl/cmd/config/create_context.go +++ b/pkg/kubectl/cmd/config/create_context.go @@ -55,11 +55,11 @@ func NewCmdConfigSetContext(out io.Writer, configAccess clientcmd.ConfigAccess) options := &createContextOptions{configAccess: configAccess} cmd := &cobra.Command{ - Use: fmt.Sprintf("set-context [NAME | --current] [--%v=cluster_nickname] [--%v=user_nickname] [--%v=namespace]", clientcmd.FlagClusterName, clientcmd.FlagAuthInfoName, clientcmd.FlagNamespace), + Use: fmt.Sprintf("set-context [NAME | --current] [--%v=cluster_nickname] [--%v=user_nickname] [--%v=namespace]", clientcmd.FlagClusterName, clientcmd.FlagAuthInfoName, clientcmd.FlagNamespace), DisableFlagsInUseLine: true, - Short: i18n.T("Sets a context entry in kubeconfig"), - Long: create_context_long, - Example: create_context_example, + Short: i18n.T("Sets a context entry in kubeconfig"), + Long: create_context_long, + Example: create_context_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.complete(cmd)) name, exists, err := options.run() diff --git a/pkg/kubectl/cmd/config/delete_cluster.go b/pkg/kubectl/cmd/config/delete_cluster.go index a9e00ce8348..bc3efe774f3 100644 --- a/pkg/kubectl/cmd/config/delete_cluster.go +++ b/pkg/kubectl/cmd/config/delete_cluster.go @@ -35,11 +35,11 @@ var ( func NewCmdConfigDeleteCluster(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command { cmd := &cobra.Command{ - Use: "delete-cluster NAME", + Use: "delete-cluster NAME", DisableFlagsInUseLine: true, - Short: i18n.T("Delete the specified cluster from the kubeconfig"), - Long: "Delete the specified cluster from the kubeconfig", - Example: delete_cluster_example, + Short: i18n.T("Delete the specified cluster from the kubeconfig"), + Long: "Delete the specified cluster from the kubeconfig", + Example: delete_cluster_example, Run: func(cmd *cobra.Command, args []string) { err := runDeleteCluster(out, configAccess, cmd) cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/config/delete_context.go b/pkg/kubectl/cmd/config/delete_context.go index d6dad310221..e7156b110c6 100644 --- a/pkg/kubectl/cmd/config/delete_context.go +++ b/pkg/kubectl/cmd/config/delete_context.go @@ -35,11 +35,11 @@ var ( func NewCmdConfigDeleteContext(out, errOut io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command { cmd := &cobra.Command{ - Use: "delete-context NAME", + Use: "delete-context NAME", DisableFlagsInUseLine: true, - Short: i18n.T("Delete the specified context from the kubeconfig"), - Long: "Delete the specified context from the kubeconfig", - Example: delete_context_example, + Short: i18n.T("Delete the specified context from the kubeconfig"), + Long: "Delete the specified context from the kubeconfig", + Example: delete_context_example, Run: func(cmd *cobra.Command, args []string) { err := runDeleteContext(out, errOut, configAccess, cmd) cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/config/get_contexts.go b/pkg/kubectl/cmd/config/get_contexts.go index 30ccba502db..c77915cdcc4 100644 --- a/pkg/kubectl/cmd/config/get_contexts.go +++ b/pkg/kubectl/cmd/config/get_contexts.go @@ -67,11 +67,11 @@ func NewCmdConfigGetContexts(streams genericclioptions.IOStreams, configAccess c } cmd := &cobra.Command{ - Use: "get-contexts [(-o|--output=)name)]", + Use: "get-contexts [(-o|--output=)name)]", DisableFlagsInUseLine: true, - Short: i18n.T("Describe one or many contexts"), - Long: getContextsLong, - Example: getContextsExample, + Short: i18n.T("Describe one or many contexts"), + Long: getContextsLong, + Example: getContextsExample, Run: func(cmd *cobra.Command, args []string) { validOutputTypes := sets.NewString("", "json", "yaml", "wide", "name", "custom-columns", "custom-columns-file", "go-template", "go-template-file", "jsonpath", "jsonpath-file") supportedOutputTypes := sets.NewString("", "name") diff --git a/pkg/kubectl/cmd/config/rename_context.go b/pkg/kubectl/cmd/config/rename_context.go index b5fc2e728de..506b917a46e 100644 --- a/pkg/kubectl/cmd/config/rename_context.go +++ b/pkg/kubectl/cmd/config/rename_context.go @@ -61,11 +61,11 @@ func NewCmdConfigRenameContext(out io.Writer, configAccess clientcmd.ConfigAcces options := &RenameContextOptions{configAccess: configAccess} cmd := &cobra.Command{ - Use: renameContextUse, + Use: renameContextUse, DisableFlagsInUseLine: true, - Short: renameContextShort, - Long: renameContextLong, - Example: renameContextExample, + Short: renameContextShort, + Long: renameContextLong, + Example: renameContextExample, Run: func(cmd *cobra.Command, args []string) { if err := options.Complete(cmd, args, out); err != nil { cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/config/set.go b/pkg/kubectl/cmd/config/set.go index 184a987fc3f..40f39d79fab 100644 --- a/pkg/kubectl/cmd/config/set.go +++ b/pkg/kubectl/cmd/config/set.go @@ -51,10 +51,10 @@ func NewCmdConfigSet(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra. options := &setOptions{configAccess: configAccess} cmd := &cobra.Command{ - Use: "set PROPERTY_NAME PROPERTY_VALUE", + Use: "set PROPERTY_NAME PROPERTY_VALUE", DisableFlagsInUseLine: true, - Short: i18n.T("Sets an individual value in a kubeconfig file"), - Long: set_long, + Short: i18n.T("Sets an individual value in a kubeconfig file"), + Long: set_long, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.complete(cmd)) cmdutil.CheckErr(options.run()) diff --git a/pkg/kubectl/cmd/config/unset.go b/pkg/kubectl/cmd/config/unset.go index 18345cd4914..13cd8d81031 100644 --- a/pkg/kubectl/cmd/config/unset.go +++ b/pkg/kubectl/cmd/config/unset.go @@ -53,11 +53,11 @@ func NewCmdConfigUnset(out io.Writer, configAccess clientcmd.ConfigAccess) *cobr options := &unsetOptions{configAccess: configAccess} cmd := &cobra.Command{ - Use: "unset PROPERTY_NAME", + Use: "unset PROPERTY_NAME", DisableFlagsInUseLine: true, - Short: i18n.T("Unsets an individual value in a kubeconfig file"), - Long: unsetLong, - Example: unsetExample, + Short: i18n.T("Unsets an individual value in a kubeconfig file"), + Long: unsetLong, + Example: unsetExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.complete(cmd, args)) cmdutil.CheckErr(options.run(out)) diff --git a/pkg/kubectl/cmd/config/use_context.go b/pkg/kubectl/cmd/config/use_context.go index 747837e0939..6330394eede 100644 --- a/pkg/kubectl/cmd/config/use_context.go +++ b/pkg/kubectl/cmd/config/use_context.go @@ -45,12 +45,12 @@ func NewCmdConfigUseContext(out io.Writer, configAccess clientcmd.ConfigAccess) options := &useContextOptions{configAccess: configAccess} cmd := &cobra.Command{ - Use: "use-context CONTEXT_NAME", + Use: "use-context CONTEXT_NAME", DisableFlagsInUseLine: true, - Short: i18n.T("Sets the current-context in a kubeconfig file"), - Aliases: []string{"use"}, - Long: `Sets the current-context in a kubeconfig file`, - Example: use_context_example, + Short: i18n.T("Sets the current-context in a kubeconfig file"), + Aliases: []string{"use"}, + Long: `Sets the current-context in a kubeconfig file`, + Example: use_context_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.complete(cmd)) cmdutil.CheckErr(options.run()) diff --git a/pkg/kubectl/cmd/convert.go b/pkg/kubectl/cmd/convert.go index 3d1302dc361..72dc6671581 100644 --- a/pkg/kubectl/cmd/convert.go +++ b/pkg/kubectl/cmd/convert.go @@ -89,11 +89,11 @@ func NewCmdConvert(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *co o := NewConvertOptions(ioStreams) cmd := &cobra.Command{ - Use: "convert -f FILENAME", + Use: "convert -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Convert config files between different API versions"), - Long: convert_long, - Example: convert_example, + Short: i18n.T("Convert config files between different API versions"), + Long: convert_long, + Example: convert_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) cmdutil.CheckErr(o.RunConvert()) diff --git a/pkg/kubectl/cmd/cp.go b/pkg/kubectl/cmd/cp.go index e7d73d08185..441c508cdee 100644 --- a/pkg/kubectl/cmd/cp.go +++ b/pkg/kubectl/cmd/cp.go @@ -86,11 +86,11 @@ func NewCmdCp(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.C o := NewCopyOptions(ioStreams) cmd := &cobra.Command{ - Use: "cp ", + Use: "cp ", DisableFlagsInUseLine: true, - Short: i18n.T("Copy files and directories to and from containers."), - Long: "Copy files and directories to and from containers.", - Example: cpExample, + Short: i18n.T("Copy files and directories to and from containers."), + Long: "Copy files and directories to and from containers.", + Example: cpExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) cmdutil.CheckErr(o.Run(args)) diff --git a/pkg/kubectl/cmd/create/create.go b/pkg/kubectl/cmd/create/create.go index 165ea1d4143..bfd51282501 100644 --- a/pkg/kubectl/cmd/create/create.go +++ b/pkg/kubectl/cmd/create/create.go @@ -93,11 +93,11 @@ func NewCmdCreate(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cob o := NewCreateOptions(ioStreams) cmd := &cobra.Command{ - Use: "create -f FILENAME", + Use: "create -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Create a resource from a file or from stdin."), - Long: createLong, - Example: createExample, + Short: i18n.T("Create a resource from a file or from stdin."), + Long: createLong, + Example: createExample, Run: func(cmd *cobra.Command, args []string) { if cmdutil.IsFilenameSliceEmpty(o.FilenameOptions.Filenames) { defaultRunFunc := cmdutil.DefaultSubCommandRun(ioStreams.ErrOut) diff --git a/pkg/kubectl/cmd/create/create_clusterrole.go b/pkg/kubectl/cmd/create/create_clusterrole.go index ccaaab0fab8..670b3d591b1 100644 --- a/pkg/kubectl/cmd/create/create_clusterrole.go +++ b/pkg/kubectl/cmd/create/create_clusterrole.go @@ -71,11 +71,11 @@ func NewCmdCreateClusterRole(f cmdutil.Factory, ioStreams genericclioptions.IOSt AggregationRule: map[string]string{}, } cmd := &cobra.Command{ - Use: "clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run]", + Use: "clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run]", DisableFlagsInUseLine: true, - Short: clusterRoleLong, - Long: clusterRoleLong, - Example: clusterRoleExample, + Short: clusterRoleLong, + Long: clusterRoleLong, + Example: clusterRoleExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(c.Complete(f, cmd, args)) cmdutil.CheckErr(c.Validate()) diff --git a/pkg/kubectl/cmd/create/create_clusterrolebinding.go b/pkg/kubectl/cmd/create/create_clusterrolebinding.go index e345fb2065c..a2f77ca6ca2 100644 --- a/pkg/kubectl/cmd/create/create_clusterrolebinding.go +++ b/pkg/kubectl/cmd/create/create_clusterrolebinding.go @@ -46,11 +46,11 @@ func NewCmdCreateClusterRoleBinding(f cmdutil.Factory, ioStreams genericclioptio } cmd := &cobra.Command{ - Use: "clusterrolebinding NAME --clusterrole=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]", + Use: "clusterrolebinding NAME --clusterrole=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a ClusterRoleBinding for a particular ClusterRole"), - Long: clusterRoleBindingLong, - Example: clusterRoleBindingExample, + Short: i18n.T("Create a ClusterRoleBinding for a particular ClusterRole"), + Long: clusterRoleBindingLong, + Example: clusterRoleBindingExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) diff --git a/pkg/kubectl/cmd/create/create_configmap.go b/pkg/kubectl/cmd/create/create_configmap.go index 2fa97b6e06a..a3485f33f7f 100644 --- a/pkg/kubectl/cmd/create/create_configmap.go +++ b/pkg/kubectl/cmd/create/create_configmap.go @@ -67,7 +67,7 @@ func NewCmdCreateConfigMap(f cmdutil.Factory, ioStreams genericclioptions.IOStre } cmd := &cobra.Command{ - Use: "configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]", + Use: "configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]", DisableFlagsInUseLine: true, Aliases: []string{"cm"}, Short: i18n.T("Create a configmap from a local file, directory or literal value"), diff --git a/pkg/kubectl/cmd/create/create_deployment.go b/pkg/kubectl/cmd/create/create_deployment.go index 6f4da51a8ac..65e2eeaf052 100644 --- a/pkg/kubectl/cmd/create/create_deployment.go +++ b/pkg/kubectl/cmd/create/create_deployment.go @@ -48,7 +48,7 @@ func NewCmdCreateDeployment(f cmdutil.Factory, ioStreams genericclioptions.IOStr } cmd := &cobra.Command{ - Use: "deployment NAME --image=image [--dry-run]", + Use: "deployment NAME --image=image [--dry-run]", DisableFlagsInUseLine: true, Aliases: []string{"deploy"}, Short: i18n.T("Create a deployment with the specified name."), diff --git a/pkg/kubectl/cmd/create/create_namespace.go b/pkg/kubectl/cmd/create/create_namespace.go index 275f8a8f0c8..e5fdb89a7df 100644 --- a/pkg/kubectl/cmd/create/create_namespace.go +++ b/pkg/kubectl/cmd/create/create_namespace.go @@ -46,7 +46,7 @@ func NewCmdCreateNamespace(f cmdutil.Factory, ioStreams genericclioptions.IOStre } cmd := &cobra.Command{ - Use: "namespace NAME [--dry-run]", + Use: "namespace NAME [--dry-run]", DisableFlagsInUseLine: true, Aliases: []string{"ns"}, Short: i18n.T("Create a namespace with the specified name"), diff --git a/pkg/kubectl/cmd/create/create_pdb.go b/pkg/kubectl/cmd/create/create_pdb.go index 9845cabc49c..b45f7f5d95c 100644 --- a/pkg/kubectl/cmd/create/create_pdb.go +++ b/pkg/kubectl/cmd/create/create_pdb.go @@ -51,7 +51,7 @@ func NewCmdCreatePodDisruptionBudget(f cmdutil.Factory, ioStreams genericcliopti } cmd := &cobra.Command{ - Use: "poddisruptionbudget NAME --selector=SELECTOR --min-available=N [--dry-run]", + Use: "poddisruptionbudget NAME --selector=SELECTOR --min-available=N [--dry-run]", DisableFlagsInUseLine: true, Aliases: []string{"pdb"}, Short: i18n.T("Create a pod disruption budget with the specified name."), diff --git a/pkg/kubectl/cmd/create/create_priorityclass.go b/pkg/kubectl/cmd/create/create_priorityclass.go index 75c9dcfae38..6223c25b41a 100644 --- a/pkg/kubectl/cmd/create/create_priorityclass.go +++ b/pkg/kubectl/cmd/create/create_priorityclass.go @@ -49,7 +49,7 @@ func NewCmdCreatePriorityClass(f cmdutil.Factory, ioStreams genericclioptions.IO } cmd := &cobra.Command{ - Use: "priorityclass NAME --value=VALUE --global-default=BOOL [--dry-run]", + Use: "priorityclass NAME --value=VALUE --global-default=BOOL [--dry-run]", DisableFlagsInUseLine: true, Aliases: []string{"pc"}, Short: i18n.T("Create a priorityclass with the specified name."), diff --git a/pkg/kubectl/cmd/create/create_quota.go b/pkg/kubectl/cmd/create/create_quota.go index 233ac906d0d..0162a0e2a7a 100644 --- a/pkg/kubectl/cmd/create/create_quota.go +++ b/pkg/kubectl/cmd/create/create_quota.go @@ -49,7 +49,7 @@ func NewCmdCreateQuota(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) } cmd := &cobra.Command{ - Use: "quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=bool]", + Use: "quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=bool]", DisableFlagsInUseLine: true, Aliases: []string{"resourcequota"}, Short: i18n.T("Create a quota with the specified name."), diff --git a/pkg/kubectl/cmd/create/create_role.go b/pkg/kubectl/cmd/create/create_role.go index 42a5276b694..0d9a72eab8b 100644 --- a/pkg/kubectl/cmd/create/create_role.go +++ b/pkg/kubectl/cmd/create/create_role.go @@ -142,11 +142,11 @@ func NewCmdCreateRole(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) o := NewCreateRoleOptions(ioStreams) cmd := &cobra.Command{ - Use: "role NAME --verb=verb --resource=resource.group/subresource [--resource-name=resourcename] [--dry-run]", + Use: "role NAME --verb=verb --resource=resource.group/subresource [--resource-name=resourcename] [--dry-run]", DisableFlagsInUseLine: true, - Short: roleLong, - Long: roleLong, - Example: roleExample, + Short: roleLong, + Long: roleLong, + Example: roleExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/create/create_rolebinding.go b/pkg/kubectl/cmd/create/create_rolebinding.go index e6e6dfd4ad5..da5eada6065 100644 --- a/pkg/kubectl/cmd/create/create_rolebinding.go +++ b/pkg/kubectl/cmd/create/create_rolebinding.go @@ -46,11 +46,11 @@ func NewCmdCreateRoleBinding(f cmdutil.Factory, ioStreams genericclioptions.IOSt } cmd := &cobra.Command{ - Use: "rolebinding NAME --clusterrole=NAME|--role=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]", + Use: "rolebinding NAME --clusterrole=NAME|--role=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a RoleBinding for a particular Role or ClusterRole"), - Long: roleBindingLong, - Example: roleBindingExample, + Short: i18n.T("Create a RoleBinding for a particular Role or ClusterRole"), + Long: roleBindingLong, + Example: roleBindingExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) diff --git a/pkg/kubectl/cmd/create/create_secret.go b/pkg/kubectl/cmd/create/create_secret.go index 793c7f4c1ff..7b68b826574 100644 --- a/pkg/kubectl/cmd/create/create_secret.go +++ b/pkg/kubectl/cmd/create/create_secret.go @@ -83,11 +83,11 @@ func NewCmdCreateSecretGeneric(f cmdutil.Factory, ioStreams genericclioptions.IO } cmd := &cobra.Command{ - Use: "generic NAME [--type=string] [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]", + Use: "generic NAME [--type=string] [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a secret from a local file, directory or literal value"), - Long: secretLong, - Example: secretExample, + Short: i18n.T("Create a secret from a local file, directory or literal value"), + Long: secretLong, + Example: secretExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) @@ -168,11 +168,11 @@ func NewCmdCreateSecretDockerRegistry(f cmdutil.Factory, ioStreams genericcliopt } cmd := &cobra.Command{ - Use: "docker-registry NAME --docker-username=user --docker-password=password --docker-email=email [--docker-server=string] [--from-literal=key1=value1] [--dry-run]", + Use: "docker-registry NAME --docker-username=user --docker-password=password --docker-email=email [--docker-server=string] [--from-literal=key1=value1] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a secret for use with a Docker registry"), - Long: secretForDockerRegistryLong, - Example: secretForDockerRegistryExample, + Short: i18n.T("Create a secret for use with a Docker registry"), + Long: secretForDockerRegistryLong, + Example: secretForDockerRegistryExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) @@ -259,11 +259,11 @@ func NewCmdCreateSecretTLS(f cmdutil.Factory, ioStreams genericclioptions.IOStre } cmd := &cobra.Command{ - Use: "tls NAME --cert=path/to/cert/file --key=path/to/key/file [--dry-run]", + Use: "tls NAME --cert=path/to/cert/file --key=path/to/key/file [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a TLS secret"), - Long: secretForTLSLong, - Example: secretForTLSExample, + Short: i18n.T("Create a TLS secret"), + Long: secretForTLSLong, + Example: secretForTLSExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) diff --git a/pkg/kubectl/cmd/create/create_service.go b/pkg/kubectl/cmd/create/create_service.go index fa8f6315472..5cae370ff88 100644 --- a/pkg/kubectl/cmd/create/create_service.go +++ b/pkg/kubectl/cmd/create/create_service.go @@ -71,11 +71,11 @@ func NewCmdCreateServiceClusterIP(f cmdutil.Factory, ioStreams genericclioptions } cmd := &cobra.Command{ - Use: "clusterip NAME [--tcp=:] [--dry-run]", + Use: "clusterip NAME [--tcp=:] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a ClusterIP service."), - Long: serviceClusterIPLong, - Example: serviceClusterIPExample, + Short: i18n.T("Create a ClusterIP service."), + Long: serviceClusterIPLong, + Example: serviceClusterIPExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) @@ -143,11 +143,11 @@ func NewCmdCreateServiceNodePort(f cmdutil.Factory, ioStreams genericclioptions. } cmd := &cobra.Command{ - Use: "nodeport NAME [--tcp=port:targetPort] [--dry-run]", + Use: "nodeport NAME [--tcp=port:targetPort] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a NodePort service."), - Long: serviceNodePortLong, - Example: serviceNodePortExample, + Short: i18n.T("Create a NodePort service."), + Long: serviceNodePortLong, + Example: serviceNodePortExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) @@ -212,11 +212,11 @@ func NewCmdCreateServiceLoadBalancer(f cmdutil.Factory, ioStreams genericcliopti } cmd := &cobra.Command{ - Use: "loadbalancer NAME [--tcp=port:targetPort] [--dry-run]", + Use: "loadbalancer NAME [--tcp=port:targetPort] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a LoadBalancer service."), - Long: serviceLoadBalancerLong, - Example: serviceLoadBalancerExample, + Short: i18n.T("Create a LoadBalancer service."), + Long: serviceLoadBalancerLong, + Example: serviceLoadBalancerExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) @@ -283,11 +283,11 @@ func NewCmdCreateServiceExternalName(f cmdutil.Factory, ioStreams genericcliopti } cmd := &cobra.Command{ - Use: "externalname NAME --external-name external.name [--dry-run]", + Use: "externalname NAME --external-name external.name [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Create an ExternalName service."), - Long: serviceExternalNameLong, - Example: serviceExternalNameExample, + Short: i18n.T("Create an ExternalName service."), + Long: serviceExternalNameLong, + Example: serviceExternalNameExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.Run()) diff --git a/pkg/kubectl/cmd/create/create_serviceaccount.go b/pkg/kubectl/cmd/create/create_serviceaccount.go index e001be9dc3f..e388c3ada98 100644 --- a/pkg/kubectl/cmd/create/create_serviceaccount.go +++ b/pkg/kubectl/cmd/create/create_serviceaccount.go @@ -46,7 +46,7 @@ func NewCmdCreateServiceAccount(f cmdutil.Factory, ioStreams genericclioptions.I } cmd := &cobra.Command{ - Use: "serviceaccount NAME [--dry-run]", + Use: "serviceaccount NAME [--dry-run]", DisableFlagsInUseLine: true, Aliases: []string{"sa"}, Short: i18n.T("Create a service account with the specified name"), diff --git a/pkg/kubectl/cmd/delete.go b/pkg/kubectl/cmd/delete.go index 3f983f0d1b9..4d4bf5778da 100644 --- a/pkg/kubectl/cmd/delete.go +++ b/pkg/kubectl/cmd/delete.go @@ -118,11 +118,11 @@ func NewCmdDelete(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra deleteFlags := NewDeleteCommandFlags("containing the resource to delete.") cmd := &cobra.Command{ - Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])", + Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])", DisableFlagsInUseLine: true, - Short: i18n.T("Delete resources by filenames, stdin, resources and names, or by resources and label selector"), - Long: delete_long, - Example: delete_example, + Short: i18n.T("Delete resources by filenames, stdin, resources and names, or by resources and label selector"), + Long: delete_long, + Example: delete_example, Run: func(cmd *cobra.Command, args []string) { o := deleteFlags.ToOptions(nil, streams) cmdutil.CheckErr(o.Complete(f, args, cmd)) diff --git a/pkg/kubectl/cmd/delete_test.go b/pkg/kubectl/cmd/delete_test.go index 873a292d6c9..e28b5c937f8 100644 --- a/pkg/kubectl/cmd/delete_test.go +++ b/pkg/kubectl/cmd/delete_test.go @@ -40,9 +40,9 @@ var unstructuredSerializer = resource.UnstructuredPlusDefaultContentConfig().Neg func fakecmd() *cobra.Command { cmd := &cobra.Command{ - Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])", + Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])", DisableFlagsInUseLine: true, - Run: func(cmd *cobra.Command, args []string) {}, + Run: func(cmd *cobra.Command, args []string) {}, } return cmd } diff --git a/pkg/kubectl/cmd/describe.go b/pkg/kubectl/cmd/describe.go index 774f613b7fb..9f04d2cb186 100644 --- a/pkg/kubectl/cmd/describe.go +++ b/pkg/kubectl/cmd/describe.go @@ -101,11 +101,11 @@ func NewCmdDescribe(parent string, f cmdutil.Factory, streams genericclioptions. } cmd := &cobra.Command{ - Use: "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)", + Use: "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)", DisableFlagsInUseLine: true, - Short: i18n.T("Show details of a specific resource or group of resources"), - Long: describeLong + "\n\n" + cmdutil.SuggestApiResources(parent), - Example: describeExample, + Short: i18n.T("Show details of a specific resource or group of resources"), + Long: describeLong + "\n\n" + cmdutil.SuggestApiResources(parent), + Example: describeExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Run()) diff --git a/pkg/kubectl/cmd/diff.go b/pkg/kubectl/cmd/diff.go index 60fba88666d..d32bdd24b88 100644 --- a/pkg/kubectl/cmd/diff.go +++ b/pkg/kubectl/cmd/diff.go @@ -78,11 +78,11 @@ func NewCmdDiff(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C IOStreams: streams, } cmd := &cobra.Command{ - Use: "diff -f FILENAME", + Use: "diff -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Diff live version against would-be applied version"), - Long: diffLong, - Example: diffExample, + Short: i18n.T("Diff live version against would-be applied version"), + Long: diffLong, + Example: diffExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(checkDiffArgs(cmd, args)) cmdutil.CheckErr(RunDiff(f, &diff, &options)) diff --git a/pkg/kubectl/cmd/drain.go b/pkg/kubectl/cmd/drain.go index 2f515270095..55d451ddb0e 100644 --- a/pkg/kubectl/cmd/drain.go +++ b/pkg/kubectl/cmd/drain.go @@ -109,11 +109,11 @@ func NewCmdCordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cob } cmd := &cobra.Command{ - Use: "cordon NODE", + Use: "cordon NODE", DisableFlagsInUseLine: true, - Short: i18n.T("Mark node as unschedulable"), - Long: cordon_long, - Example: cordon_example, + Short: i18n.T("Mark node as unschedulable"), + Long: cordon_long, + Example: cordon_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.RunCordonOrUncordon(true)) @@ -140,11 +140,11 @@ func NewCmdUncordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *c } cmd := &cobra.Command{ - Use: "uncordon NODE", + Use: "uncordon NODE", DisableFlagsInUseLine: true, - Short: i18n.T("Mark node as schedulable"), - Long: uncordon_long, - Example: uncordon_example, + Short: i18n.T("Mark node as schedulable"), + Long: uncordon_long, + Example: uncordon_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.RunCordonOrUncordon(false)) @@ -202,11 +202,11 @@ func NewCmdDrain(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobr options := NewDrainOptions(f, ioStreams) cmd := &cobra.Command{ - Use: "drain NODE", + Use: "drain NODE", DisableFlagsInUseLine: true, - Short: i18n.T("Drain node in preparation for maintenance"), - Long: drain_long, - Example: drain_example, + Short: i18n.T("Drain node in preparation for maintenance"), + Long: drain_long, + Example: drain_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(options.Complete(f, cmd, args)) cmdutil.CheckErr(options.RunDrain()) diff --git a/pkg/kubectl/cmd/edit.go b/pkg/kubectl/cmd/edit.go index 65d9cf0c4a2..f7156b1b5bd 100644 --- a/pkg/kubectl/cmd/edit.go +++ b/pkg/kubectl/cmd/edit.go @@ -72,11 +72,11 @@ func NewCmdEdit(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra o.ValidateOptions = cmdutil.ValidateOptions{EnableValidation: true} cmd := &cobra.Command{ - Use: "edit (RESOURCE/NAME | -f FILENAME)", + Use: "edit (RESOURCE/NAME | -f FILENAME)", DisableFlagsInUseLine: true, - Short: i18n.T("Edit a resource on the server"), - Long: editLong, - Example: fmt.Sprintf(editExample), + Short: i18n.T("Edit a resource on the server"), + Long: editLong, + Example: fmt.Sprintf(editExample), Run: func(cmd *cobra.Command, args []string) { if err := o.Complete(f, args, cmd); err != nil { cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/exec.go b/pkg/kubectl/cmd/exec.go index 25899ce8647..30e0b4d214c 100644 --- a/pkg/kubectl/cmd/exec.go +++ b/pkg/kubectl/cmd/exec.go @@ -72,11 +72,11 @@ func NewCmdExec(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C Executor: &DefaultRemoteExecutor{}, } cmd := &cobra.Command{ - Use: "exec POD [-c CONTAINER] -- COMMAND [args...]", + Use: "exec POD [-c CONTAINER] -- COMMAND [args...]", DisableFlagsInUseLine: true, - Short: i18n.T("Execute a command in a container"), - Long: "Execute a command in a container.", - Example: exec_example, + Short: i18n.T("Execute a command in a container"), + Long: "Execute a command in a container.", + Example: exec_example, Run: func(cmd *cobra.Command, args []string) { argsLenAtDash := cmd.ArgsLenAtDash() cmdutil.CheckErr(options.Complete(f, cmd, args, argsLenAtDash)) diff --git a/pkg/kubectl/cmd/explain.go b/pkg/kubectl/cmd/explain.go index d76bef0868d..40233aedb7d 100644 --- a/pkg/kubectl/cmd/explain.go +++ b/pkg/kubectl/cmd/explain.go @@ -74,11 +74,11 @@ func NewCmdExplain(parent string, f cmdutil.Factory, streams genericclioptions.I o := NewExplainOptions(parent, streams) cmd := &cobra.Command{ - Use: "explain RESOURCE", + Use: "explain RESOURCE", DisableFlagsInUseLine: true, - Short: i18n.T("Documentation of resources"), - Long: explainLong + "\n\n" + cmdutil.SuggestApiResources(parent), - Example: explainExamples, + Short: i18n.T("Documentation of resources"), + Long: explainLong + "\n\n" + cmdutil.SuggestApiResources(parent), + Example: explainExamples, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) cmdutil.CheckErr(o.Validate(args)) diff --git a/pkg/kubectl/cmd/expose.go b/pkg/kubectl/cmd/expose.go index 6341d345ec0..47e1dba484a 100644 --- a/pkg/kubectl/cmd/expose.go +++ b/pkg/kubectl/cmd/expose.go @@ -126,11 +126,11 @@ func NewCmdExposeService(f cmdutil.Factory, streams genericclioptions.IOStreams) } cmd := &cobra.Command{ - Use: "expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]", + Use: "expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]", DisableFlagsInUseLine: true, - Short: i18n.T("Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service"), - Long: exposeLong, - Example: exposeExample, + Short: i18n.T("Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service"), + Long: exposeLong, + Example: exposeExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) cmdutil.CheckErr(o.RunExpose(cmd, args)) diff --git a/pkg/kubectl/cmd/get/get.go b/pkg/kubectl/cmd/get/get.go index 185dac34385..3681e62901b 100644 --- a/pkg/kubectl/cmd/get/get.go +++ b/pkg/kubectl/cmd/get/get.go @@ -150,11 +150,11 @@ func NewCmdGet(parent string, f cmdutil.Factory, streams genericclioptions.IOStr o := NewGetOptions(parent, streams) cmd := &cobra.Command{ - Use: "get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]", + Use: "get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]", DisableFlagsInUseLine: true, - Short: i18n.T("Display one or many resources"), - Long: getLong + "\n\n" + cmdutil.SuggestApiResources(parent), - Example: getExample, + Short: i18n.T("Display one or many resources"), + Long: getLong + "\n\n" + cmdutil.SuggestApiResources(parent), + Example: getExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate(cmd)) diff --git a/pkg/kubectl/cmd/help.go b/pkg/kubectl/cmd/help.go index 783a87c64db..508fd1d7d50 100644 --- a/pkg/kubectl/cmd/help.go +++ b/pkg/kubectl/cmd/help.go @@ -31,10 +31,10 @@ var helpLong = templates.LongDesc(i18n.T(` func NewCmdHelp() *cobra.Command { cmd := &cobra.Command{ - Use: "help [command] | STRING_TO_SEARCH", + Use: "help [command] | STRING_TO_SEARCH", DisableFlagsInUseLine: true, - Short: i18n.T("Help about any command"), - Long: helpLong, + Short: i18n.T("Help about any command"), + Long: helpLong, Run: RunHelp, } diff --git a/pkg/kubectl/cmd/label.go b/pkg/kubectl/cmd/label.go index 3ef0eb6f5b6..23d1d1ad7cd 100644 --- a/pkg/kubectl/cmd/label.go +++ b/pkg/kubectl/cmd/label.go @@ -125,11 +125,11 @@ func NewCmdLabel(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobr o := NewLabelOptions(ioStreams) cmd := &cobra.Command{ - Use: "label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]", + Use: "label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]", DisableFlagsInUseLine: true, - Short: i18n.T("Update the labels on a resource"), - Long: fmt.Sprintf(labelLong, validation.LabelValueMaxLength), - Example: labelExample, + Short: i18n.T("Update the labels on a resource"), + Long: fmt.Sprintf(labelLong, validation.LabelValueMaxLength), + Example: labelExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/logs.go b/pkg/kubectl/cmd/logs.go index 5f727c29b13..c4a4ca4a61b 100644 --- a/pkg/kubectl/cmd/logs.go +++ b/pkg/kubectl/cmd/logs.go @@ -119,11 +119,11 @@ func NewCmdLogs(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C o := NewLogsOptions(streams, false) cmd := &cobra.Command{ - Use: logsUsageStr, + Use: logsUsageStr, DisableFlagsInUseLine: true, - Short: i18n.T("Print the logs for a container in a pod"), - Long: "Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.", - Example: logsExample, + Short: i18n.T("Print the logs for a container in a pod"), + Long: "Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.", + Example: logsExample, PreRun: func(cmd *cobra.Command, args []string) { if len(os.Args) > 1 && os.Args[1] == "log" { printDeprecationWarning(o.ErrOut, "logs", "log") diff --git a/pkg/kubectl/cmd/patch.go b/pkg/kubectl/cmd/patch.go index e5eb13b38bd..bd794b5f892 100644 --- a/pkg/kubectl/cmd/patch.go +++ b/pkg/kubectl/cmd/patch.go @@ -107,11 +107,11 @@ func NewCmdPatch(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobr o := NewPatchOptions(ioStreams) cmd := &cobra.Command{ - Use: "patch (-f FILENAME | TYPE NAME) -p PATCH", + Use: "patch (-f FILENAME | TYPE NAME) -p PATCH", DisableFlagsInUseLine: true, - Short: i18n.T("Update field(s) of a resource using strategic merge patch"), - Long: patchLong, - Example: patchExample, + Short: i18n.T("Update field(s) of a resource using strategic merge patch"), + Long: patchLong, + Example: patchExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/plugin.go b/pkg/kubectl/cmd/plugin.go index 76b3aa89592..31b514dfb26 100644 --- a/pkg/kubectl/cmd/plugin.go +++ b/pkg/kubectl/cmd/plugin.go @@ -52,10 +52,10 @@ var ( func NewCmdPlugin(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ - Use: "plugin [flags]", + Use: "plugin [flags]", DisableFlagsInUseLine: true, - Short: i18n.T("Provides utilities for interacting with plugins."), - Long: plugin_long, + Short: i18n.T("Provides utilities for interacting with plugins."), + Long: plugin_long, Run: func(cmd *cobra.Command, args []string) { cmdutil.DefaultSubCommandRun(streams.ErrOut)(cmd, args) }, diff --git a/pkg/kubectl/cmd/portforward.go b/pkg/kubectl/cmd/portforward.go index 5c0095bb3b0..a29a0fa5011 100644 --- a/pkg/kubectl/cmd/portforward.go +++ b/pkg/kubectl/cmd/portforward.go @@ -95,11 +95,11 @@ func NewCmdPortForward(f cmdutil.Factory, streams genericclioptions.IOStreams) * }, } cmd := &cobra.Command{ - Use: "port-forward TYPE/NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]", + Use: "port-forward TYPE/NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]", DisableFlagsInUseLine: true, - Short: i18n.T("Forward one or more local ports to a pod"), - Long: portforwardLong, - Example: portforwardExample, + Short: i18n.T("Forward one or more local ports to a pod"), + Long: portforwardLong, + Example: portforwardExample, Run: func(cmd *cobra.Command, args []string) { if err := opts.Complete(f, cmd, args); err != nil { cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/proxy.go b/pkg/kubectl/cmd/proxy.go index e2daa184d25..d57aa3d1909 100644 --- a/pkg/kubectl/cmd/proxy.go +++ b/pkg/kubectl/cmd/proxy.go @@ -72,11 +72,11 @@ var ( func NewCmdProxy(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ - Use: "proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-prefix=prefix]", + Use: "proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-prefix=prefix]", DisableFlagsInUseLine: true, - Short: i18n.T("Run a proxy to the Kubernetes API server"), - Long: proxyLong, - Example: proxyExample, + Short: i18n.T("Run a proxy to the Kubernetes API server"), + Long: proxyLong, + Example: proxyExample, Run: func(cmd *cobra.Command, args []string) { err := RunProxy(f, streams.Out, cmd) cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/replace.go b/pkg/kubectl/cmd/replace.go index ed28a2c0ec3..53d8fa07f26 100644 --- a/pkg/kubectl/cmd/replace.go +++ b/pkg/kubectl/cmd/replace.go @@ -102,11 +102,11 @@ func NewCmdReplace(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobr o := NewReplaceOptions(streams) cmd := &cobra.Command{ - Use: "replace -f FILENAME", + Use: "replace -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Replace a resource by filename or stdin"), - Long: replaceLong, - Example: replaceExample, + Short: i18n.T("Replace a resource by filename or stdin"), + Long: replaceLong, + Example: replaceExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate(cmd)) diff --git a/pkg/kubectl/cmd/rollingupdate.go b/pkg/kubectl/cmd/rollingupdate.go index 01250e51f6d..9504f524b56 100644 --- a/pkg/kubectl/cmd/rollingupdate.go +++ b/pkg/kubectl/cmd/rollingupdate.go @@ -129,13 +129,13 @@ func NewCmdRollingUpdate(f cmdutil.Factory, ioStreams genericclioptions.IOStream o := NewRollingUpdateOptions(ioStreams) cmd := &cobra.Command{ - Use: "rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)", + Use: "rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)", DisableFlagsInUseLine: true, - Short: "Perform a rolling update. This command is deprecated, use rollout instead.", - Long: rollingUpdateLong, - Example: rollingUpdateExample, - Deprecated: `use "rollout" instead`, - Hidden: true, + Short: "Perform a rolling update. This command is deprecated, use rollout instead.", + Long: rollingUpdateLong, + Example: rollingUpdateExample, + Deprecated: `use "rollout" instead`, + Hidden: true, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate(cmd, args)) diff --git a/pkg/kubectl/cmd/rollout/rollout.go b/pkg/kubectl/cmd/rollout/rollout.go index d62c79ae62c..f0eb548ce04 100644 --- a/pkg/kubectl/cmd/rollout/rollout.go +++ b/pkg/kubectl/cmd/rollout/rollout.go @@ -48,12 +48,12 @@ var ( func NewCmdRollout(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ - Use: "rollout SUBCOMMAND", + Use: "rollout SUBCOMMAND", DisableFlagsInUseLine: true, - Short: i18n.T("Manage the rollout of a resource"), - Long: rollout_long, - Example: rollout_example, - Run: cmdutil.DefaultSubCommandRun(streams.Out), + Short: i18n.T("Manage the rollout of a resource"), + Long: rollout_long, + Example: rollout_example, + Run: cmdutil.DefaultSubCommandRun(streams.Out), } // subcommands cmd.AddCommand(NewCmdRolloutHistory(f, streams)) diff --git a/pkg/kubectl/cmd/rollout/rollout_history.go b/pkg/kubectl/cmd/rollout/rollout_history.go index e58c9262fde..4f49afbd8fc 100644 --- a/pkg/kubectl/cmd/rollout/rollout_history.go +++ b/pkg/kubectl/cmd/rollout/rollout_history.go @@ -74,11 +74,11 @@ func NewCmdRolloutHistory(f cmdutil.Factory, streams genericclioptions.IOStreams validArgs := []string{"deployment", "daemonset", "statefulset"} cmd := &cobra.Command{ - Use: "history (TYPE NAME | TYPE/NAME) [flags]", + Use: "history (TYPE NAME | TYPE/NAME) [flags]", DisableFlagsInUseLine: true, - Short: i18n.T("View rollout history"), - Long: history_long, - Example: history_example, + Short: i18n.T("View rollout history"), + Long: history_long, + Example: history_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/rollout/rollout_pause.go b/pkg/kubectl/cmd/rollout/rollout_pause.go index 2c53bd24778..e87e9c78713 100644 --- a/pkg/kubectl/cmd/rollout/rollout_pause.go +++ b/pkg/kubectl/cmd/rollout/rollout_pause.go @@ -74,11 +74,11 @@ func NewCmdRolloutPause(f cmdutil.Factory, streams genericclioptions.IOStreams) validArgs := []string{"deployment"} cmd := &cobra.Command{ - Use: "pause RESOURCE", + Use: "pause RESOURCE", DisableFlagsInUseLine: true, - Short: i18n.T("Mark the provided resource as paused"), - Long: pause_long, - Example: pause_example, + Short: i18n.T("Mark the provided resource as paused"), + Long: pause_long, + Example: pause_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/rollout/rollout_resume.go b/pkg/kubectl/cmd/rollout/rollout_resume.go index d94a3858ce7..4ed7309aa67 100644 --- a/pkg/kubectl/cmd/rollout/rollout_resume.go +++ b/pkg/kubectl/cmd/rollout/rollout_resume.go @@ -77,11 +77,11 @@ func NewCmdRolloutResume(f cmdutil.Factory, streams genericclioptions.IOStreams) validArgs := []string{"deployment"} cmd := &cobra.Command{ - Use: "resume RESOURCE", + Use: "resume RESOURCE", DisableFlagsInUseLine: true, - Short: i18n.T("Resume a paused resource"), - Long: resume_long, - Example: resume_example, + Short: i18n.T("Resume a paused resource"), + Long: resume_long, + Example: resume_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/rollout/rollout_status.go b/pkg/kubectl/cmd/rollout/rollout_status.go index 98b617e20d6..828e03cb9f8 100644 --- a/pkg/kubectl/cmd/rollout/rollout_status.go +++ b/pkg/kubectl/cmd/rollout/rollout_status.go @@ -95,11 +95,11 @@ func NewCmdRolloutStatus(f cmdutil.Factory, streams genericclioptions.IOStreams) validArgs := []string{"deployment", "daemonset", "statefulset"} cmd := &cobra.Command{ - Use: "status (TYPE NAME | TYPE/NAME) [flags]", + Use: "status (TYPE NAME | TYPE/NAME) [flags]", DisableFlagsInUseLine: true, - Short: i18n.T("Show the status of the rollout"), - Long: status_long, - Example: status_example, + Short: i18n.T("Show the status of the rollout"), + Long: status_long, + Example: status_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/rollout/rollout_undo.go b/pkg/kubectl/cmd/rollout/rollout_undo.go index b7e287fb4d7..f6f9aa47282 100644 --- a/pkg/kubectl/cmd/rollout/rollout_undo.go +++ b/pkg/kubectl/cmd/rollout/rollout_undo.go @@ -79,11 +79,11 @@ func NewCmdRolloutUndo(f cmdutil.Factory, streams genericclioptions.IOStreams) * validArgs := []string{"deployment", "daemonset", "statefulset"} cmd := &cobra.Command{ - Use: "undo (TYPE NAME | TYPE/NAME) [flags]", + Use: "undo (TYPE NAME | TYPE/NAME) [flags]", DisableFlagsInUseLine: true, - Short: i18n.T("Undo a previous rollout"), - Long: undo_long, - Example: undo_example, + Short: i18n.T("Undo a previous rollout"), + Long: undo_long, + Example: undo_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/run.go b/pkg/kubectl/cmd/run.go index 4a2cd29e532..8fa3df9baea 100644 --- a/pkg/kubectl/cmd/run.go +++ b/pkg/kubectl/cmd/run.go @@ -141,11 +141,11 @@ func NewCmdRun(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Co o := NewRunOptions(streams) cmd := &cobra.Command{ - Use: "run NAME --image=image [--env=\"key=value\"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [--command] -- [COMMAND] [args...]", + Use: "run NAME --image=image [--env=\"key=value\"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [--command] -- [COMMAND] [args...]", DisableFlagsInUseLine: true, - Short: i18n.T("Run a particular image on the cluster"), - Long: runLong, - Example: runExample, + Short: i18n.T("Run a particular image on the cluster"), + Long: runLong, + Example: runExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) cmdutil.CheckErr(o.Run(f, cmd, args)) diff --git a/pkg/kubectl/cmd/scale.go b/pkg/kubectl/cmd/scale.go index 932ae8702b6..eef3de67699 100644 --- a/pkg/kubectl/cmd/scale.go +++ b/pkg/kubectl/cmd/scale.go @@ -109,11 +109,11 @@ func NewCmdScale(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobr validArgs := []string{"deployment", "replicaset", "replicationcontroller", "statefulset"} cmd := &cobra.Command{ - Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)", + Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)", DisableFlagsInUseLine: true, - Short: i18n.T("Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job"), - Long: scaleLong, - Example: scaleExample, + Short: i18n.T("Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job"), + Long: scaleLong, + Example: scaleExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate(cmd)) diff --git a/pkg/kubectl/cmd/set/set.go b/pkg/kubectl/cmd/set/set.go index d45ce33e2ab..de6ff5bc685 100644 --- a/pkg/kubectl/cmd/set/set.go +++ b/pkg/kubectl/cmd/set/set.go @@ -33,11 +33,11 @@ var ( func NewCmdSet(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ - Use: "set SUBCOMMAND", + Use: "set SUBCOMMAND", DisableFlagsInUseLine: true, - Short: i18n.T("Set specific features on objects"), - Long: set_long, - Run: cmdutil.DefaultSubCommandRun(streams.ErrOut), + Short: i18n.T("Set specific features on objects"), + Long: set_long, + Run: cmdutil.DefaultSubCommandRun(streams.ErrOut), } // add subcommands diff --git a/pkg/kubectl/cmd/set/set_env.go b/pkg/kubectl/cmd/set/set_env.go index 0a315607088..2bd4b340a11 100644 --- a/pkg/kubectl/cmd/set/set_env.go +++ b/pkg/kubectl/cmd/set/set_env.go @@ -145,11 +145,11 @@ func NewEnvOptions(streams genericclioptions.IOStreams) *EnvOptions { func NewCmdEnv(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { o := NewEnvOptions(streams) cmd := &cobra.Command{ - Use: "env RESOURCE/NAME KEY_1=VAL_1 ... KEY_N=VAL_N", + Use: "env RESOURCE/NAME KEY_1=VAL_1 ... KEY_N=VAL_N", DisableFlagsInUseLine: true, - Short: "Update environment variables on a pod template", - Long: envLong, - Example: fmt.Sprintf(envExample), + Short: "Update environment variables on a pod template", + Long: envLong, + Example: fmt.Sprintf(envExample), Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/set/set_image.go b/pkg/kubectl/cmd/set/set_image.go index c97102e31ce..a09b9912cf7 100644 --- a/pkg/kubectl/cmd/set/set_image.go +++ b/pkg/kubectl/cmd/set/set_image.go @@ -101,11 +101,11 @@ func NewCmdImage(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra. o := NewImageOptions(streams) cmd := &cobra.Command{ - Use: "image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N", + Use: "image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N", DisableFlagsInUseLine: true, - Short: i18n.T("Update image of a pod template"), - Long: image_long, - Example: image_example, + Short: i18n.T("Update image of a pod template"), + Long: image_long, + Example: image_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/set/set_resources.go b/pkg/kubectl/cmd/set/set_resources.go index d2010a79dd7..5d5d9440158 100644 --- a/pkg/kubectl/cmd/set/set_resources.go +++ b/pkg/kubectl/cmd/set/set_resources.go @@ -108,11 +108,11 @@ func NewCmdResources(f cmdutil.Factory, streams genericclioptions.IOStreams) *co o := NewResourcesOptions(streams) cmd := &cobra.Command{ - Use: "resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]", + Use: "resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]", DisableFlagsInUseLine: true, - Short: i18n.T("Update resource requests/limits on objects with pod templates"), - Long: fmt.Sprintf(resources_long, cmdutil.SuggestApiResources("kubectl")), - Example: resources_example, + Short: i18n.T("Update resource requests/limits on objects with pod templates"), + Long: fmt.Sprintf(resources_long, cmdutil.SuggestApiResources("kubectl")), + Example: resources_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/set/set_selector.go b/pkg/kubectl/cmd/set/set_selector.go index 8593f92fbd3..6613f24bda6 100644 --- a/pkg/kubectl/cmd/set/set_selector.go +++ b/pkg/kubectl/cmd/set/set_selector.go @@ -95,11 +95,11 @@ func NewCmdSelector(f cmdutil.Factory, streams genericclioptions.IOStreams) *cob o := NewSelectorOptions(streams) cmd := &cobra.Command{ - Use: "selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version]", + Use: "selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version]", DisableFlagsInUseLine: true, - Short: i18n.T("Set the selector on a resource"), - Long: fmt.Sprintf(selectorLong, validation.LabelValueMaxLength), - Example: selectorExample, + Short: i18n.T("Set the selector on a resource"), + Long: fmt.Sprintf(selectorLong, validation.LabelValueMaxLength), + Example: selectorExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/set/set_serviceaccount.go b/pkg/kubectl/cmd/set/set_serviceaccount.go index 2a41b12780a..612ef8af341 100644 --- a/pkg/kubectl/cmd/set/set_serviceaccount.go +++ b/pkg/kubectl/cmd/set/set_serviceaccount.go @@ -93,7 +93,7 @@ func NewCmdServiceAccount(f cmdutil.Factory, streams genericclioptions.IOStreams o := NewSetServiceAccountOptions(streams) cmd := &cobra.Command{ - Use: "serviceaccount (-f FILENAME | TYPE NAME) SERVICE_ACCOUNT", + Use: "serviceaccount (-f FILENAME | TYPE NAME) SERVICE_ACCOUNT", DisableFlagsInUseLine: true, Aliases: []string{"sa"}, Short: i18n.T("Update ServiceAccount of a resource"), diff --git a/pkg/kubectl/cmd/set/set_subject.go b/pkg/kubectl/cmd/set/set_subject.go index 7e0e896be2f..74c89636159 100644 --- a/pkg/kubectl/cmd/set/set_subject.go +++ b/pkg/kubectl/cmd/set/set_subject.go @@ -90,11 +90,11 @@ func NewSubjectOptions(streams genericclioptions.IOStreams) *SubjectOptions { func NewCmdSubject(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { o := NewSubjectOptions(streams) cmd := &cobra.Command{ - Use: "subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]", + Use: "subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run]", DisableFlagsInUseLine: true, - Short: i18n.T("Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding"), - Long: subject_long, - Example: subject_example, + Short: i18n.T("Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding"), + Long: subject_long, + Example: subject_example, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/kubectl/cmd/taint.go b/pkg/kubectl/cmd/taint.go index cb43d035679..0227afbeb1d 100644 --- a/pkg/kubectl/cmd/taint.go +++ b/pkg/kubectl/cmd/taint.go @@ -93,11 +93,11 @@ func NewCmdTaint(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra. validArgs := []string{"node"} cmd := &cobra.Command{ - Use: "taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N", + Use: "taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N", DisableFlagsInUseLine: true, - Short: i18n.T("Update the taints on one or more nodes"), - Long: fmt.Sprintf(taintLong, validation.DNS1123SubdomainMaxLength, validation.LabelValueMaxLength), - Example: taintExample, + Short: i18n.T("Update the taints on one or more nodes"), + Long: fmt.Sprintf(taintLong, validation.DNS1123SubdomainMaxLength, validation.LabelValueMaxLength), + Example: taintExample, Run: func(cmd *cobra.Command, args []string) { if err := options.Complete(f, cmd, args); err != nil { cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/top_node.go b/pkg/kubectl/cmd/top_node.go index 2c4b77657af..a60eaeacade 100644 --- a/pkg/kubectl/cmd/top_node.go +++ b/pkg/kubectl/cmd/top_node.go @@ -100,11 +100,11 @@ func NewCmdTopNode(f cmdutil.Factory, o *TopNodeOptions, streams genericclioptio } cmd := &cobra.Command{ - Use: "node [NAME | -l label]", + Use: "node [NAME | -l label]", DisableFlagsInUseLine: true, - Short: i18n.T("Display Resource (CPU/Memory/Storage) usage of nodes"), - Long: topNodeLong, - Example: topNodeExample, + Short: i18n.T("Display Resource (CPU/Memory/Storage) usage of nodes"), + Long: topNodeLong, + Example: topNodeExample, Run: func(cmd *cobra.Command, args []string) { if err := o.Complete(f, cmd, args); err != nil { cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/top_pod.go b/pkg/kubectl/cmd/top_pod.go index 657d1ff5a0f..39efa624d4d 100644 --- a/pkg/kubectl/cmd/top_pod.go +++ b/pkg/kubectl/cmd/top_pod.go @@ -89,11 +89,11 @@ func NewCmdTopPod(f cmdutil.Factory, o *TopPodOptions, streams genericclioptions } cmd := &cobra.Command{ - Use: "pod [NAME | -l label]", + Use: "pod [NAME | -l label]", DisableFlagsInUseLine: true, - Short: i18n.T("Display Resource (CPU/Memory/Storage) usage of pods"), - Long: topPodLong, - Example: topPodExample, + Short: i18n.T("Display Resource (CPU/Memory/Storage) usage of pods"), + Long: topPodLong, + Example: topPodExample, Run: func(cmd *cobra.Command, args []string) { if err := o.Complete(f, cmd, args); err != nil { cmdutil.CheckErr(err) diff --git a/pkg/kubectl/cmd/wait/wait.go b/pkg/kubectl/cmd/wait/wait.go index db63b8ef3a5..63bac24246f 100644 --- a/pkg/kubectl/cmd/wait/wait.go +++ b/pkg/kubectl/cmd/wait/wait.go @@ -102,11 +102,11 @@ func NewCmdWait(restClientGetter genericclioptions.RESTClientGetter, streams gen flags := NewWaitFlags(restClientGetter, streams) cmd := &cobra.Command{ - Use: "wait resource.group/name [--for=delete|--for condition=available]", + Use: "wait resource.group/name [--for=delete|--for condition=available]", DisableFlagsInUseLine: true, - Short: "Experimental: Wait for a specific condition on one or many resources.", - Long: wait_long, - Example: wait_example, + Short: "Experimental: Wait for a specific condition on one or many resources.", + Long: wait_long, + Example: wait_example, Run: func(cmd *cobra.Command, args []string) { o, err := flags.ToOptions(args) cmdutil.CheckErr(err) diff --git a/pkg/kubectl/service_test.go b/pkg/kubectl/service_test.go index 420ed8e7120..5c0ae4fd227 100644 --- a/pkg/kubectl/service_test.go +++ b/pkg/kubectl/service_test.go @@ -229,7 +229,7 @@ func TestGenerateService(t *testing.T) { "protocol": "UDP", "container-port": "foobar", "create-external-load-balancer": "true", // ignored when type is present - "type": string(v1.ServiceTypeNodePort), + "type": string(v1.ServiceTypeNodePort), }, expected: v1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/kubelet/cm/devicemanager/manager_test.go b/pkg/kubelet/cm/devicemanager/manager_test.go index 7168f2342c2..22faea96689 100644 --- a/pkg/kubelet/cm/devicemanager/manager_test.go +++ b/pkg/kubelet/cm/devicemanager/manager_test.go @@ -701,7 +701,7 @@ func TestPodContainerDeviceAllocation(t *testing.T) { expectedContainerOptsLen: []int{3, 2, 2}, expectedAllocatedResName1: 2, expectedAllocatedResName2: 1, - expErr: nil, + expErr: nil, }, { description: "Requesting to create a pod without enough resources should fail", @@ -709,7 +709,7 @@ func TestPodContainerDeviceAllocation(t *testing.T) { expectedContainerOptsLen: nil, expectedAllocatedResName1: 2, expectedAllocatedResName2: 1, - expErr: fmt.Errorf("requested number of devices unavailable for domain1.com/resource1. Requested: 1, Available: 0"), + expErr: fmt.Errorf("requested number of devices unavailable for domain1.com/resource1. Requested: 1, Available: 0"), }, { description: "Successful allocation of all available Res1 resources and Res2 resources", @@ -717,7 +717,7 @@ func TestPodContainerDeviceAllocation(t *testing.T) { expectedContainerOptsLen: []int{0, 0, 1}, expectedAllocatedResName1: 2, expectedAllocatedResName2: 2, - expErr: nil, + expErr: nil, }, } activePods := []*v1.Pod{} diff --git a/pkg/kubelet/config/file_linux_test.go b/pkg/kubelet/config/file_linux_test.go index 4c26b0ed819..545021cb815 100644 --- a/pkg/kubelet/config/file_linux_test.go +++ b/pkg/kubelet/config/file_linux_test.go @@ -182,8 +182,8 @@ func getTestCases(hostname types.NodeName) []*testCase { Effect: "NoExecute", }}, Containers: []v1.Container{{ - Name: "image", - Image: "test/image", + Name: "image", + Image: "test/image", TerminationMessagePath: "/dev/termination-log", ImagePullPolicy: "Always", SecurityContext: securitycontext.ValidSecurityContextWithContainerDefaults(), diff --git a/pkg/kubelet/config/http_test.go b/pkg/kubelet/config/http_test.go index 3b7f00b0be6..4cef337f7fb 100644 --- a/pkg/kubelet/config/http_test.go +++ b/pkg/kubelet/config/http_test.go @@ -177,8 +177,8 @@ func TestExtractPodsFromHTTP(t *testing.T) { EnableServiceLinks: &enableServiceLinks, Containers: []v1.Container{{ - Name: "1", - Image: "foo", + Name: "1", + Image: "foo", TerminationMessagePath: "/dev/termination-log", ImagePullPolicy: "Always", TerminationMessagePolicy: v1.TerminationMessageReadFile, @@ -249,8 +249,8 @@ func TestExtractPodsFromHTTP(t *testing.T) { EnableServiceLinks: &enableServiceLinks, Containers: []v1.Container{{ - Name: "1", - Image: "foo", + Name: "1", + Image: "foo", TerminationMessagePath: "/dev/termination-log", ImagePullPolicy: "Always", TerminationMessagePolicy: v1.TerminationMessageReadFile, @@ -278,8 +278,8 @@ func TestExtractPodsFromHTTP(t *testing.T) { EnableServiceLinks: &enableServiceLinks, Containers: []v1.Container{{ - Name: "2", - Image: "bar:bartag", + Name: "2", + Image: "bar:bartag", TerminationMessagePath: "/dev/termination-log", ImagePullPolicy: "IfNotPresent", TerminationMessagePolicy: v1.TerminationMessageReadFile, diff --git a/pkg/kubelet/dockershim/libdocker/kube_docker_client.go b/pkg/kubelet/dockershim/libdocker/kube_docker_client.go index 13a1eab5559..78671375410 100644 --- a/pkg/kubelet/dockershim/libdocker/kube_docker_client.go +++ b/pkg/kubelet/dockershim/libdocker/kube_docker_client.go @@ -318,10 +318,10 @@ type progressReporter struct { // newProgressReporter creates a new progressReporter for specific image with specified reporting interval func newProgressReporter(image string, cancel context.CancelFunc, imagePullProgressDeadline time.Duration) *progressReporter { return &progressReporter{ - progress: newProgress(), - image: image, - cancel: cancel, - stopCh: make(chan struct{}), + progress: newProgress(), + image: image, + cancel: cancel, + stopCh: make(chan struct{}), imagePullProgressDeadline: imagePullProgressDeadline, } } diff --git a/pkg/kubelet/dockershim/network/hostport/hostport_manager_test.go b/pkg/kubelet/dockershim/network/hostport/hostport_manager_test.go index e8b2c070bfd..644f1d39683 100644 --- a/pkg/kubelet/dockershim/network/hostport/hostport_manager_test.go +++ b/pkg/kubelet/dockershim/network/hostport/hostport_manager_test.go @@ -286,15 +286,15 @@ func TestHostportManager(t *testing.T) { lines := strings.Split(string(raw.Bytes()), "\n") expectedLines := map[string]bool{ - `*nat`: true, - `:KUBE-HOSTPORTS - [0:0]`: true, - `:OUTPUT - [0:0]`: true, - `:PREROUTING - [0:0]`: true, - `:POSTROUTING - [0:0]`: true, - `:KUBE-HP-IJHALPHTORMHHPPK - [0:0]`: true, - `:KUBE-HP-63UPIDJXVRSZGSUZ - [0:0]`: true, - `:KUBE-HP-WFBOALXEP42XEMJK - [0:0]`: true, - `:KUBE-HP-XU6AWMMJYOZOFTFZ - [0:0]`: true, + `*nat`: true, + `:KUBE-HOSTPORTS - [0:0]`: true, + `:OUTPUT - [0:0]`: true, + `:PREROUTING - [0:0]`: true, + `:POSTROUTING - [0:0]`: true, + `:KUBE-HP-IJHALPHTORMHHPPK - [0:0]`: true, + `:KUBE-HP-63UPIDJXVRSZGSUZ - [0:0]`: true, + `:KUBE-HP-WFBOALXEP42XEMJK - [0:0]`: true, + `:KUBE-HP-XU6AWMMJYOZOFTFZ - [0:0]`: true, "-A KUBE-HOSTPORTS -m comment --comment \"pod3_ns1 hostport 8443\" -m tcp -p tcp --dport 8443 -j KUBE-HP-WFBOALXEP42XEMJK": true, "-A KUBE-HOSTPORTS -m comment --comment \"pod1_ns1 hostport 8081\" -m udp -p udp --dport 8081 -j KUBE-HP-63UPIDJXVRSZGSUZ": true, "-A KUBE-HOSTPORTS -m comment --comment \"pod1_ns1 hostport 8080\" -m tcp -p tcp --dport 8080 -j KUBE-HP-IJHALPHTORMHHPPK": true, diff --git a/pkg/kubelet/eviction/eviction_manager.go b/pkg/kubelet/eviction/eviction_manager.go index 2b6fe919b26..20cf1fd95ae 100644 --- a/pkg/kubelet/eviction/eviction_manager.go +++ b/pkg/kubelet/eviction/eviction_manager.go @@ -106,14 +106,14 @@ func NewManager( clock clock.Clock, ) (Manager, lifecycle.PodAdmitHandler) { manager := &managerImpl{ - clock: clock, - killPodFunc: killPodFunc, - imageGC: imageGC, - containerGC: containerGC, - config: config, - recorder: recorder, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: clock, + killPodFunc: killPodFunc, + imageGC: imageGC, + containerGC: containerGC, + config: config, + recorder: recorder, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, dedicatedImageFs: nil, diff --git a/pkg/kubelet/eviction/eviction_manager_test.go b/pkg/kubelet/eviction/eviction_manager_test.go index e8b4a4e36d3..67d161aef6c 100644 --- a/pkg/kubelet/eviction/eviction_manager_test.go +++ b/pkg/kubelet/eviction/eviction_manager_test.go @@ -232,14 +232,14 @@ func TestMemoryPressure(t *testing.T) { } summaryProvider := &fakeSummaryProvider{result: summaryStatsMaker("2Gi", podStats)} manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, } @@ -453,14 +453,14 @@ func TestDiskPressureNodeFs(t *testing.T) { } summaryProvider := &fakeSummaryProvider{result: summaryStatsMaker("16Gi", "200Gi", podStats)} manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, } @@ -646,14 +646,14 @@ func TestMinReclaim(t *testing.T) { } summaryProvider := &fakeSummaryProvider{result: summaryStatsMaker("2Gi", podStats)} manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, } @@ -788,14 +788,14 @@ func TestNodeReclaimFuncs(t *testing.T) { summaryProvider := &fakeSummaryProvider{result: summaryStatsMaker("16Gi", "200Gi", podStats)} diskGC := &mockDiskGC{fakeSummaryProvider: summaryProvider, err: nil} manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, } @@ -993,14 +993,14 @@ func TestInodePressureNodeFsInodes(t *testing.T) { } summaryProvider := &fakeSummaryProvider{result: summaryStatsMaker("3Mi", "4Mi", podStats)} manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, } @@ -1197,14 +1197,14 @@ func TestCriticalPodsAreNotEvicted(t *testing.T) { } summaryProvider := &fakeSummaryProvider{result: summaryStatsMaker("2Gi", podStats)} manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, } @@ -1318,14 +1318,14 @@ func TestAllocatableMemoryPressure(t *testing.T) { } summaryProvider := &fakeSummaryProvider{result: summaryStatsMaker("4Gi", podStats)} manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, } @@ -1467,14 +1467,14 @@ func TestUpdateMemcgThreshold(t *testing.T) { thresholdNotifier.On("UpdateThreshold", summaryProvider.result).Return(nil).Twice() manager := &managerImpl{ - clock: fakeClock, - killPodFunc: podKiller.killPodNow, - imageGC: diskGC, - containerGC: diskGC, - config: config, - recorder: &record.FakeRecorder{}, - summaryProvider: summaryProvider, - nodeRef: nodeRef, + clock: fakeClock, + killPodFunc: podKiller.killPodNow, + imageGC: diskGC, + containerGC: diskGC, + config: config, + recorder: &record.FakeRecorder{}, + summaryProvider: summaryProvider, + nodeRef: nodeRef, nodeConditionsLastObservedAt: nodeConditionsObservedAt{}, thresholdsFirstObservedAt: thresholdsObservedAt{}, thresholdNotifiers: []ThresholdNotifier{thresholdNotifier}, diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 27c0a835aa1..510000f4fe0 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -485,47 +485,47 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, } klet := &Kubelet{ - hostname: hostname, - hostnameOverridden: len(hostnameOverride) > 0, - nodeName: nodeName, - kubeClient: kubeDeps.KubeClient, - csiClient: kubeDeps.CSIClient, - heartbeatClient: kubeDeps.HeartbeatClient, - onRepeatedHeartbeatFailure: kubeDeps.OnHeartbeatFailure, - rootDirectory: rootDirectory, - resyncInterval: kubeCfg.SyncFrequency.Duration, - sourcesReady: config.NewSourcesReady(kubeDeps.PodConfig.SeenAllSources), - registerNode: registerNode, - registerWithTaints: registerWithTaints, - registerSchedulable: registerSchedulable, - dnsConfigurer: dns.NewConfigurer(kubeDeps.Recorder, nodeRef, parsedNodeIP, clusterDNS, kubeCfg.ClusterDomain, kubeCfg.ResolverConfig), - serviceLister: serviceLister, - nodeInfo: nodeInfo, - masterServiceNamespace: masterServiceNamespace, - streamingConnectionIdleTimeout: kubeCfg.StreamingConnectionIdleTimeout.Duration, - recorder: kubeDeps.Recorder, - cadvisor: kubeDeps.CAdvisorInterface, - cloud: kubeDeps.Cloud, - externalCloudProvider: cloudprovider.IsExternal(cloudProvider), - providerID: providerID, - nodeRef: nodeRef, - nodeLabels: nodeLabels, - nodeStatusUpdateFrequency: kubeCfg.NodeStatusUpdateFrequency.Duration, - os: kubeDeps.OSInterface, - oomWatcher: oomWatcher, - cgroupsPerQOS: kubeCfg.CgroupsPerQOS, - cgroupRoot: kubeCfg.CgroupRoot, - mounter: kubeDeps.Mounter, - maxPods: int(kubeCfg.MaxPods), - podsPerCore: int(kubeCfg.PodsPerCore), - syncLoopMonitor: atomic.Value{}, - daemonEndpoints: daemonEndpoints, - containerManager: kubeDeps.ContainerManager, - containerRuntimeName: containerRuntime, - redirectContainerStreaming: crOptions.RedirectContainerStreaming, - nodeIP: parsedNodeIP, - nodeIPValidator: validateNodeIP, - clock: clock.RealClock{}, + hostname: hostname, + hostnameOverridden: len(hostnameOverride) > 0, + nodeName: nodeName, + kubeClient: kubeDeps.KubeClient, + csiClient: kubeDeps.CSIClient, + heartbeatClient: kubeDeps.HeartbeatClient, + onRepeatedHeartbeatFailure: kubeDeps.OnHeartbeatFailure, + rootDirectory: rootDirectory, + resyncInterval: kubeCfg.SyncFrequency.Duration, + sourcesReady: config.NewSourcesReady(kubeDeps.PodConfig.SeenAllSources), + registerNode: registerNode, + registerWithTaints: registerWithTaints, + registerSchedulable: registerSchedulable, + dnsConfigurer: dns.NewConfigurer(kubeDeps.Recorder, nodeRef, parsedNodeIP, clusterDNS, kubeCfg.ClusterDomain, kubeCfg.ResolverConfig), + serviceLister: serviceLister, + nodeInfo: nodeInfo, + masterServiceNamespace: masterServiceNamespace, + streamingConnectionIdleTimeout: kubeCfg.StreamingConnectionIdleTimeout.Duration, + recorder: kubeDeps.Recorder, + cadvisor: kubeDeps.CAdvisorInterface, + cloud: kubeDeps.Cloud, + externalCloudProvider: cloudprovider.IsExternal(cloudProvider), + providerID: providerID, + nodeRef: nodeRef, + nodeLabels: nodeLabels, + nodeStatusUpdateFrequency: kubeCfg.NodeStatusUpdateFrequency.Duration, + os: kubeDeps.OSInterface, + oomWatcher: oomWatcher, + cgroupsPerQOS: kubeCfg.CgroupsPerQOS, + cgroupRoot: kubeCfg.CgroupRoot, + mounter: kubeDeps.Mounter, + maxPods: int(kubeCfg.MaxPods), + podsPerCore: int(kubeCfg.PodsPerCore), + syncLoopMonitor: atomic.Value{}, + daemonEndpoints: daemonEndpoints, + containerManager: kubeDeps.ContainerManager, + containerRuntimeName: containerRuntime, + redirectContainerStreaming: crOptions.RedirectContainerStreaming, + nodeIP: parsedNodeIP, + nodeIPValidator: validateNodeIP, + clock: clock.RealClock{}, enableControllerAttachDetach: kubeCfg.EnableControllerAttachDetach, iptClient: utilipt.New(utilexec.New(), utildbus.New(), protocol), makeIPTablesUtilChains: kubeCfg.MakeIPTablesUtilChains, diff --git a/pkg/kubelet/kuberuntime/kuberuntime_container.go b/pkg/kubelet/kuberuntime/kuberuntime_container.go index 929afc7d8aa..6e0b0ce045c 100644 --- a/pkg/kubelet/kuberuntime/kuberuntime_container.go +++ b/pkg/kubelet/kuberuntime/kuberuntime_container.go @@ -516,8 +516,8 @@ func (m *kubeGenericRuntimeManager) restoreSpecsFromContainerLabels(containerID }, } container = &v1.Container{ - Name: l.ContainerName, - Ports: a.ContainerPorts, + Name: l.ContainerName, + Ports: a.ContainerPorts, TerminationMessagePath: a.TerminationMessagePath, } if a.PreStopHandler != nil { diff --git a/pkg/kubelet/kuberuntime/labels_test.go b/pkg/kubelet/kuberuntime/labels_test.go index 9b66ff79e2c..7f0652cbd41 100644 --- a/pkg/kubelet/kuberuntime/labels_test.go +++ b/pkg/kubelet/kuberuntime/labels_test.go @@ -48,15 +48,15 @@ func TestContainerLabels(t *testing.T) { }, } container := &v1.Container{ - Name: "test_container", + Name: "test_container", TerminationMessagePath: "/somepath", Lifecycle: lifecycle, } pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: "test_pod", - Namespace: "test_pod_namespace", - UID: "test_pod_uid", + Name: "test_pod", + Namespace: "test_pod_namespace", + UID: "test_pod_uid", DeletionGracePeriodSeconds: &deletionGracePeriod, }, Spec: v1.PodSpec{ @@ -193,16 +193,16 @@ func TestContainerAnnotations(t *testing.T) { }, } container := &v1.Container{ - Name: "test_container", - Ports: containerPorts, + Name: "test_container", + Ports: containerPorts, TerminationMessagePath: "/somepath", Lifecycle: lifecycle, } pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: "test_pod", - Namespace: "test_pod_namespace", - UID: "test_pod_uid", + Name: "test_pod", + Namespace: "test_pod_namespace", + UID: "test_pod_uid", DeletionGracePeriodSeconds: &deletionGracePeriod, }, Spec: v1.PodSpec{ @@ -214,10 +214,10 @@ func TestContainerAnnotations(t *testing.T) { ContainerPorts: containerPorts, PodDeletionGracePeriod: pod.DeletionGracePeriodSeconds, PodTerminationGracePeriod: pod.Spec.TerminationGracePeriodSeconds, - Hash: kubecontainer.HashContainer(container), - RestartCount: restartCount, - TerminationMessagePath: container.TerminationMessagePath, - PreStopHandler: container.Lifecycle.PreStop, + Hash: kubecontainer.HashContainer(container), + RestartCount: restartCount, + TerminationMessagePath: container.TerminationMessagePath, + PreStopHandler: container.Lifecycle.PreStop, } // Test whether we can get right information from label diff --git a/pkg/kubelet/network/dns/dns_test.go b/pkg/kubelet/network/dns/dns_test.go index f9249109d67..1c47aaa1982 100644 --- a/pkg/kubelet/network/dns/dns_test.go +++ b/pkg/kubelet/network/dns/dns_test.go @@ -229,13 +229,13 @@ func TestMergeDNSOptions(t *testing.T) { expectedOptions []string }{ { - desc: "Empty dnsConfigOptions", + desc: "Empty dnsConfigOptions", existingDNSConfigOptions: []string{"ndots:5", "debug"}, dnsConfigOptions: nil, expectedOptions: []string{"ndots:5", "debug"}, }, { - desc: "No duplicated entries", + desc: "No duplicated entries", existingDNSConfigOptions: []string{"ndots:5", "debug"}, dnsConfigOptions: []v1.PodDNSConfigOption{ {Name: "single-request"}, @@ -244,7 +244,7 @@ func TestMergeDNSOptions(t *testing.T) { expectedOptions: []string{"ndots:5", "debug", "single-request", "attempts:3"}, }, { - desc: "Overwrite duplicated entries", + desc: "Overwrite duplicated entries", existingDNSConfigOptions: []string{"ndots:5", "debug"}, dnsConfigOptions: []v1.PodDNSConfigOption{ {Name: "ndots", Value: &testOptionValue}, @@ -343,7 +343,7 @@ func TestGetPodDNSType(t *testing.T) { expectedDNSType: podDNSHost, }, { - desc: "valid DNSNone with feature gate", + desc: "valid DNSNone with feature gate", customPodDNSFeatureGate: true, dnsPolicy: v1.DNSNone, expectedDNSType: podDNSNone, @@ -547,13 +547,13 @@ func TestGetPodDNSCustom(t *testing.T) { }, }, { - desc: "feature gate is enabled, DNSNone without DNSConfig should have empty DNS settings", + desc: "feature gate is enabled, DNSNone without DNSConfig should have empty DNS settings", customPodDNSFeatureGate: true, dnsPolicy: v1.DNSNone, expectedDNSConfig: &runtimeapi.DNSConfig{}, }, { - desc: "feature gate is enabled, DNSNone with DNSConfig should have a merged DNS settings", + desc: "feature gate is enabled, DNSNone with DNSConfig should have a merged DNS settings", customPodDNSFeatureGate: true, dnsPolicy: v1.DNSNone, dnsConfig: &v1.PodDNSConfig{ @@ -571,7 +571,7 @@ func TestGetPodDNSCustom(t *testing.T) { }, }, { - desc: "feature gate is enabled, DNSClusterFirst with DNSConfig should have a merged DNS settings", + desc: "feature gate is enabled, DNSClusterFirst with DNSConfig should have a merged DNS settings", customPodDNSFeatureGate: true, dnsPolicy: v1.DNSClusterFirst, dnsConfig: &v1.PodDNSConfig{ @@ -589,7 +589,7 @@ func TestGetPodDNSCustom(t *testing.T) { }, }, { - desc: "feature gate is enabled, DNSClusterFirstWithHostNet with DNSConfig should have a merged DNS settings", + desc: "feature gate is enabled, DNSClusterFirstWithHostNet with DNSConfig should have a merged DNS settings", customPodDNSFeatureGate: true, hostnetwork: true, dnsPolicy: v1.DNSClusterFirstWithHostNet, @@ -608,7 +608,7 @@ func TestGetPodDNSCustom(t *testing.T) { }, }, { - desc: "feature gate is enabled, DNSDefault with DNSConfig should have a merged DNS settings", + desc: "feature gate is enabled, DNSDefault with DNSConfig should have a merged DNS settings", customPodDNSFeatureGate: true, dnsPolicy: v1.DNSDefault, dnsConfig: &v1.PodDNSConfig{ diff --git a/pkg/kubelet/nodelease/controller.go b/pkg/kubelet/nodelease/controller.go index 533adaf7171..5e587f6c593 100644 --- a/pkg/kubelet/nodelease/controller.go +++ b/pkg/kubelet/nodelease/controller.go @@ -67,11 +67,11 @@ func NewController(clock clock.Clock, client clientset.Interface, holderIdentity leaseClient = client.CoordinationV1beta1().Leases(corev1.NamespaceNodeLease) } return &controller{ - client: leaseClient, - holderIdentity: holderIdentity, - leaseDurationSeconds: leaseDurationSeconds, - renewInterval: renewInterval, - clock: clock, + client: leaseClient, + holderIdentity: holderIdentity, + leaseDurationSeconds: leaseDurationSeconds, + renewInterval: renewInterval, + clock: clock, onRepeatedHeartbeatFailure: onRepeatedHeartbeatFailure, } } diff --git a/pkg/kubelet/nodestatus/setters_test.go b/pkg/kubelet/nodestatus/setters_test.go index 35a9ab9b288..ad7fcc7eb3b 100644 --- a/pkg/kubelet/nodestatus/setters_test.go +++ b/pkg/kubelet/nodestatus/setters_test.go @@ -906,14 +906,14 @@ func TestReadyCondition(t *testing.T) { // to ensure an event is sent. }, { - desc: "new, ready: apparmor validator passed", - node: withCapacity.DeepCopy(), + desc: "new, ready: apparmor validator passed", + node: withCapacity.DeepCopy(), appArmorValidateHostFunc: func() error { return nil }, expectConditions: []v1.NodeCondition{*makeReadyCondition(true, "kubelet is posting ready status. AppArmor enabled", now, now)}, }, { - desc: "new, ready: apparmor validator failed", - node: withCapacity.DeepCopy(), + desc: "new, ready: apparmor validator failed", + node: withCapacity.DeepCopy(), appArmorValidateHostFunc: func() error { return fmt.Errorf("foo") }, // absence of an additional message is understood to mean that AppArmor is disabled expectConditions: []v1.NodeCondition{*makeReadyCondition(true, "kubelet is posting ready status", now, now)}, diff --git a/pkg/kubelet/server/portforward/httpstream.go b/pkg/kubelet/server/portforward/httpstream.go index be2426eaf42..06ed961e0e2 100644 --- a/pkg/kubelet/server/portforward/httpstream.go +++ b/pkg/kubelet/server/portforward/httpstream.go @@ -58,9 +58,9 @@ func handleHttpStreams(req *http.Request, w http.ResponseWriter, portForwarder P streamChan: streamChan, streamPairs: make(map[string]*httpStreamPair), streamCreationTimeout: streamCreationTimeout, - pod: podName, - uid: uid, - forwarder: portForwarder, + pod: podName, + uid: uid, + forwarder: portForwarder, } h.run() diff --git a/pkg/kubelet/stats/helper.go b/pkg/kubelet/stats/helper.go index a195b9c634a..e8917958ff6 100644 --- a/pkg/kubelet/stats/helper.go +++ b/pkg/kubelet/stats/helper.go @@ -211,8 +211,8 @@ func cadvisorInfoToUserDefinedMetrics(info *cadvisorapiv2.ContainerInfo) []stats for _, specVal := range udmMap { udm = append(udm, statsapi.UserDefinedMetric{ UserDefinedMetricDescriptor: specVal.ref, - Time: metav1.NewTime(specVal.time), - Value: specVal.value, + Time: metav1.NewTime(specVal.time), + Value: specVal.value, }) } return udm diff --git a/pkg/printers/internalversion/describe_test.go b/pkg/printers/internalversion/describe_test.go index a1840c28c32..381bb7f527c 100644 --- a/pkg/printers/internalversion/describe_test.go +++ b/pkg/printers/internalversion/describe_test.go @@ -1174,8 +1174,8 @@ func TestPersistentVolumeDescriber(t *testing.T) { CreationTimestamp: metav1.Time{Time: time.Now()}, DeletionTimestamp: &metav1.Time{Time: time.Now()}, DeletionGracePeriodSeconds: new(int64), - Labels: map[string]string{"label1": "label1", "label2": "label2", "label3": "label3"}, - Annotations: map[string]string{"annotation1": "annotation1", "annotation2": "annotation2", "annotation3": "annotation3"}, + Labels: map[string]string{"label1": "label1", "label2": "label2", "label3": "label3"}, + Annotations: map[string]string{"annotation1": "annotation1", "annotation2": "annotation2", "annotation3": "annotation3"}, }, Spec: api.PersistentVolumeSpec{ PersistentVolumeSource: api.PersistentVolumeSource{ @@ -1217,8 +1217,8 @@ func TestPersistentVolumeDescriber(t *testing.T) { CreationTimestamp: metav1.Time{Time: time.Now()}, DeletionTimestamp: &metav1.Time{Time: time.Now()}, DeletionGracePeriodSeconds: new(int64), - Labels: map[string]string{"label1": "label1", "label2": "label2", "label3": "label3"}, - Annotations: map[string]string{"annotation1": "annotation1", "annotation2": "annotation2", "annotation3": "annotation3"}, + Labels: map[string]string{"label1": "label1", "label2": "label2", "label3": "label3"}, + Annotations: map[string]string{"annotation1": "annotation1", "annotation2": "annotation2", "annotation3": "annotation3"}, }, Spec: api.PersistentVolumeSpec{ PersistentVolumeSource: api.PersistentVolumeSource{ diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go index f8dbf24bfc2..2b0acc7940a 100644 --- a/pkg/printers/internalversion/printers_test.go +++ b/pkg/printers/internalversion/printers_test.go @@ -1293,7 +1293,7 @@ func TestPrintHumanReadableWithNamespace(t *testing.T) { Spec: api.PodSpec{ Containers: []api.Container{ { - Image: "foo/bar", + Image: "foo/bar", TerminationMessagePath: api.TerminationMessagePathDefault, ImagePullPolicy: api.PullIfNotPresent, }, diff --git a/pkg/proxy/apis/config/validation/validation_test.go b/pkg/proxy/apis/config/validation/validation_test.go index ca6d9a88136..9a054683d40 100644 --- a/pkg/proxy/apis/config/validation/validation_test.go +++ b/pkg/proxy/apis/config/validation/validation_test.go @@ -56,9 +56,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -76,9 +76,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -96,9 +96,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -130,9 +130,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -154,9 +154,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -178,9 +178,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -202,9 +202,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -226,9 +226,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -250,9 +250,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -275,9 +275,9 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { // not specifying valid period in IPVS mode. Mode: kubeproxyconfig.ProxyModeIPVS, Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -448,16 +448,16 @@ func TestValidateKubeProxyIPVSConfiguration(t *testing.T) { func TestValidateKubeProxyConntrackConfiguration(t *testing.T) { successCases := []kubeproxyconfig.KubeProxyConntrackConfiguration{ { - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, { - Max: pointer.Int32Ptr(0), - MaxPerCore: pointer.Int32Ptr(0), - Min: pointer.Int32Ptr(0), + Max: pointer.Int32Ptr(0), + MaxPerCore: pointer.Int32Ptr(0), + Min: pointer.Int32Ptr(0), TCPEstablishedTimeout: &metav1.Duration{Duration: 0 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 0 * time.Second}, }, @@ -475,9 +475,9 @@ func TestValidateKubeProxyConntrackConfiguration(t *testing.T) { }{ { config: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(-1), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(-1), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -485,9 +485,9 @@ func TestValidateKubeProxyConntrackConfiguration(t *testing.T) { }, { config: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(-1), - Min: pointer.Int32Ptr(1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(-1), + Min: pointer.Int32Ptr(1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -495,9 +495,9 @@ func TestValidateKubeProxyConntrackConfiguration(t *testing.T) { }, { config: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(2), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(-1), + Max: pointer.Int32Ptr(2), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(-1), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -505,9 +505,9 @@ func TestValidateKubeProxyConntrackConfiguration(t *testing.T) { }, { config: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(4), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(3), + Max: pointer.Int32Ptr(4), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(3), TCPEstablishedTimeout: &metav1.Duration{Duration: -5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: 5 * time.Second}, }, @@ -515,9 +515,9 @@ func TestValidateKubeProxyConntrackConfiguration(t *testing.T) { }, { config: kubeproxyconfig.KubeProxyConntrackConfiguration{ - Max: pointer.Int32Ptr(4), - MaxPerCore: pointer.Int32Ptr(1), - Min: pointer.Int32Ptr(3), + Max: pointer.Int32Ptr(4), + MaxPerCore: pointer.Int32Ptr(1), + Min: pointer.Int32Ptr(3), TCPEstablishedTimeout: &metav1.Duration{Duration: 5 * time.Second}, TCPCloseWaitTimeout: &metav1.Duration{Duration: -5 * time.Second}, }, diff --git a/pkg/quota/v1/evaluator/core/persistent_volume_claims_test.go b/pkg/quota/v1/evaluator/core/persistent_volume_claims_test.go index 12e0dc89a3b..284395e3154 100644 --- a/pkg/quota/v1/evaluator/core/persistent_volume_claims_test.go +++ b/pkg/quota/v1/evaluator/core/persistent_volume_claims_test.go @@ -85,8 +85,8 @@ func TestPersistentVolumeClaimEvaluatorUsage(t *testing.T) { "pvc-usage": { pvc: validClaim, usage: corev1.ResourceList{ - corev1.ResourceRequestsStorage: resource.MustParse("10Gi"), - corev1.ResourcePersistentVolumeClaims: resource.MustParse("1"), + corev1.ResourceRequestsStorage: resource.MustParse("10Gi"), + corev1.ResourcePersistentVolumeClaims: resource.MustParse("1"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "persistentvolumeclaims"}): resource.MustParse("1"), }, }, diff --git a/pkg/quota/v1/evaluator/core/pods_test.go b/pkg/quota/v1/evaluator/core/pods_test.go index 8d0b93c9f8f..57d65de99d2 100644 --- a/pkg/quota/v1/evaluator/core/pods_test.go +++ b/pkg/quota/v1/evaluator/core/pods_test.go @@ -124,10 +124,10 @@ func TestPodEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceRequestsMemory: resource.MustParse("1m"), - corev1.ResourceLimitsMemory: resource.MustParse("2m"), - corev1.ResourcePods: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("1m"), + corev1.ResourceRequestsMemory: resource.MustParse("1m"), + corev1.ResourceLimitsMemory: resource.MustParse("2m"), + corev1.ResourcePods: resource.MustParse("1"), + corev1.ResourceMemory: resource.MustParse("1m"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "pods"}): resource.MustParse("1"), }, }, @@ -163,7 +163,7 @@ func TestPodEvaluatorUsage(t *testing.T) { usage: corev1.ResourceList{ corev1.ResourceName(corev1.ResourceHugePagesPrefix + "2Mi"): resource.MustParse("100Mi"), corev1.ResourceName(corev1.ResourceRequestsHugePagesPrefix + "2Mi"): resource.MustParse("100Mi"), - corev1.ResourcePods: resource.MustParse("1"), + corev1.ResourcePods: resource.MustParse("1"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "pods"}): resource.MustParse("1"), }, }, @@ -180,7 +180,7 @@ func TestPodEvaluatorUsage(t *testing.T) { }, usage: corev1.ResourceList{ corev1.ResourceName("requests.example.com/dongle"): resource.MustParse("3"), - corev1.ResourcePods: resource.MustParse("1"), + corev1.ResourcePods: resource.MustParse("1"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "pods"}): resource.MustParse("1"), }, }, @@ -215,10 +215,10 @@ func TestPodEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceRequestsMemory: resource.MustParse("1m"), - corev1.ResourceLimitsMemory: resource.MustParse("2m"), - corev1.ResourcePods: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("1m"), + corev1.ResourceRequestsMemory: resource.MustParse("1m"), + corev1.ResourceLimitsMemory: resource.MustParse("2m"), + corev1.ResourcePods: resource.MustParse("1"), + corev1.ResourceMemory: resource.MustParse("1m"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "pods"}): resource.MustParse("1"), }, }, @@ -254,7 +254,7 @@ func TestPodEvaluatorUsage(t *testing.T) { usage: corev1.ResourceList{ corev1.ResourceName(api.ResourceHugePagesPrefix + "2Mi"): resource.MustParse("100Mi"), corev1.ResourceName(api.ResourceRequestsHugePagesPrefix + "2Mi"): resource.MustParse("100Mi"), - corev1.ResourcePods: resource.MustParse("1"), + corev1.ResourcePods: resource.MustParse("1"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "pods"}): resource.MustParse("1"), }, }, @@ -271,7 +271,7 @@ func TestPodEvaluatorUsage(t *testing.T) { }, usage: corev1.ResourceList{ corev1.ResourceName("requests.example.com/dongle"): resource.MustParse("3"), - corev1.ResourcePods: resource.MustParse("1"), + corev1.ResourcePods: resource.MustParse("1"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "pods"}): resource.MustParse("1"), }, }, @@ -341,14 +341,14 @@ func TestPodEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceRequestsCPU: resource.MustParse("4"), - corev1.ResourceRequestsMemory: resource.MustParse("100M"), - corev1.ResourceLimitsCPU: resource.MustParse("8"), - corev1.ResourceLimitsMemory: resource.MustParse("200M"), - corev1.ResourcePods: resource.MustParse("1"), - corev1.ResourceCPU: resource.MustParse("4"), - corev1.ResourceMemory: resource.MustParse("100M"), - corev1.ResourceName("requests.example.com/dongle"): resource.MustParse("4"), + corev1.ResourceRequestsCPU: resource.MustParse("4"), + corev1.ResourceRequestsMemory: resource.MustParse("100M"), + corev1.ResourceLimitsCPU: resource.MustParse("8"), + corev1.ResourceLimitsMemory: resource.MustParse("200M"), + corev1.ResourcePods: resource.MustParse("1"), + corev1.ResourceCPU: resource.MustParse("4"), + corev1.ResourceMemory: resource.MustParse("100M"), + corev1.ResourceName("requests.example.com/dongle"): resource.MustParse("4"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "pods"}): resource.MustParse("1"), }, }, diff --git a/pkg/quota/v1/evaluator/core/services_test.go b/pkg/quota/v1/evaluator/core/services_test.go index b9f227a0c82..7817bd8156a 100644 --- a/pkg/quota/v1/evaluator/core/services_test.go +++ b/pkg/quota/v1/evaluator/core/services_test.go @@ -62,9 +62,9 @@ func TestServiceEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceServicesNodePorts: resource.MustParse("0"), - corev1.ResourceServicesLoadBalancers: resource.MustParse("1"), - corev1.ResourceServices: resource.MustParse("1"), + corev1.ResourceServicesNodePorts: resource.MustParse("0"), + corev1.ResourceServicesLoadBalancers: resource.MustParse("1"), + corev1.ResourceServices: resource.MustParse("1"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "services"}): resource.MustParse("1"), }, }, @@ -80,9 +80,9 @@ func TestServiceEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceServicesNodePorts: resource.MustParse("1"), - corev1.ResourceServicesLoadBalancers: resource.MustParse("1"), - corev1.ResourceServices: resource.MustParse("1"), + corev1.ResourceServicesNodePorts: resource.MustParse("1"), + corev1.ResourceServicesLoadBalancers: resource.MustParse("1"), + corev1.ResourceServices: resource.MustParse("1"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "services"}): resource.MustParse("1"), }, }, @@ -93,9 +93,9 @@ func TestServiceEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceServices: resource.MustParse("1"), - corev1.ResourceServicesNodePorts: resource.MustParse("0"), - corev1.ResourceServicesLoadBalancers: resource.MustParse("0"), + corev1.ResourceServices: resource.MustParse("1"), + corev1.ResourceServicesNodePorts: resource.MustParse("0"), + corev1.ResourceServicesLoadBalancers: resource.MustParse("0"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "services"}): resource.MustParse("1"), }, }, @@ -111,9 +111,9 @@ func TestServiceEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceServices: resource.MustParse("1"), - corev1.ResourceServicesNodePorts: resource.MustParse("1"), - corev1.ResourceServicesLoadBalancers: resource.MustParse("0"), + corev1.ResourceServices: resource.MustParse("1"), + corev1.ResourceServicesNodePorts: resource.MustParse("1"), + corev1.ResourceServicesLoadBalancers: resource.MustParse("0"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "services"}): resource.MustParse("1"), }, }, @@ -132,9 +132,9 @@ func TestServiceEvaluatorUsage(t *testing.T) { }, }, usage: corev1.ResourceList{ - corev1.ResourceServices: resource.MustParse("1"), - corev1.ResourceServicesNodePorts: resource.MustParse("2"), - corev1.ResourceServicesLoadBalancers: resource.MustParse("0"), + corev1.ResourceServices: resource.MustParse("1"), + corev1.ResourceServicesNodePorts: resource.MustParse("2"), + corev1.ResourceServicesLoadBalancers: resource.MustParse("0"), generic.ObjectCountQuotaResourceNameFor(schema.GroupResource{Resource: "services"}): resource.MustParse("1"), }, }, diff --git a/pkg/registry/authorization/subjectaccessreview/rest_test.go b/pkg/registry/authorization/subjectaccessreview/rest_test.go index cde4aa18811..b85173baed8 100644 --- a/pkg/registry/authorization/subjectaccessreview/rest_test.go +++ b/pkg/registry/authorization/subjectaccessreview/rest_test.go @@ -61,7 +61,7 @@ func TestCreate(t *testing.T) { "nonresource rejected": { spec: authorizationapi.SubjectAccessReviewSpec{ - User: "bob", + User: "bob", NonResourceAttributes: &authorizationapi.NonResourceAttributes{Verb: "get", Path: "/mypath"}, }, decision: authorizer.DecisionNoOpinion, @@ -82,7 +82,7 @@ func TestCreate(t *testing.T) { "nonresource allowed": { spec: authorizationapi.SubjectAccessReviewSpec{ - User: "bob", + User: "bob", NonResourceAttributes: &authorizationapi.NonResourceAttributes{Verb: "get", Path: "/mypath"}, }, decision: authorizer.DecisionAllow, diff --git a/pkg/registry/core/node/storage/storage.go b/pkg/registry/core/node/storage/storage.go index 2e76aff461c..bbd64b537aa 100644 --- a/pkg/registry/core/node/storage/storage.go +++ b/pkg/registry/core/node/storage/storage.go @@ -129,9 +129,9 @@ func NewStorage(optsGetter generic.RESTOptionsGetter, kubeletClientConfig client proxyREST.Connection = connectionInfoGetter return &NodeStorage{ - Node: nodeREST, - Status: statusREST, - Proxy: proxyREST, + Node: nodeREST, + Status: statusREST, + Proxy: proxyREST, KubeletConnectionInfo: connectionInfoGetter, }, nil } diff --git a/pkg/registry/core/rest/storage_core.go b/pkg/registry/core/rest/storage_core.go index 45cf9592fb4..4208f940a89 100644 --- a/pkg/registry/core/rest/storage_core.go +++ b/pkg/registry/core/rest/storage_core.go @@ -98,9 +98,9 @@ func (c LegacyRESTStorageProvider) NewLegacyRESTStorage(restOptionsGetter generi apiGroupInfo := genericapiserver.APIGroupInfo{ PrioritizedVersions: legacyscheme.Scheme.PrioritizedVersionsForGroup(""), VersionedResourcesStorageMap: map[string]map[string]rest.Storage{}, - Scheme: legacyscheme.Scheme, - ParameterCodec: legacyscheme.ParameterCodec, - NegotiatedSerializer: legacyscheme.Codecs, + Scheme: legacyscheme.Scheme, + ParameterCodec: legacyscheme.ParameterCodec, + NegotiatedSerializer: legacyscheme.Codecs, } var podDisruptionClient policyclient.PodDisruptionBudgetsGetter diff --git a/pkg/registry/extensions/controller/storage/storage.go b/pkg/registry/extensions/controller/storage/storage.go index 18caae3694b..8f5f32de43d 100644 --- a/pkg/registry/extensions/controller/storage/storage.go +++ b/pkg/registry/extensions/controller/storage/storage.go @@ -46,7 +46,7 @@ func NewStorage(optsGetter generic.RESTOptionsGetter) ContainerStorage { return ContainerStorage{ ReplicationController: &RcREST{}, - Scale: &ScaleREST{store: controllerREST.Store}, + Scale: &ScaleREST{store: controllerREST.Store}, } } diff --git a/pkg/scheduler/algorithm/predicates/metadata.go b/pkg/scheduler/algorithm/predicates/metadata.go index d24b8968563..94a0e72546a 100644 --- a/pkg/scheduler/algorithm/predicates/metadata.go +++ b/pkg/scheduler/algorithm/predicates/metadata.go @@ -143,10 +143,10 @@ func (pfactory *PredicateMetadataFactory) GetMetadata(pod *v1.Pod, nodeNameToInf return nil } predicateMetadata := &predicateMetadata{ - pod: pod, - podBestEffort: isPodBestEffort(pod), - podRequest: GetResourceRequest(pod), - podPorts: schedutil.GetContainerPorts(pod), + pod: pod, + podBestEffort: isPodBestEffort(pod), + podRequest: GetResourceRequest(pod), + podPorts: schedutil.GetContainerPorts(pod), topologyPairsPotentialAffinityPods: incomingPodAffinityMap, topologyPairsPotentialAntiAffinityPods: incomingPodAntiAffinityMap, topologyPairsAntiAffinityPodsMap: existingPodAntiAffinityMap, diff --git a/pkg/scheduler/algorithm/predicates/predicates_test.go b/pkg/scheduler/algorithm/predicates/predicates_test.go index 42d795819e4..f4a5693b5e9 100644 --- a/pkg/scheduler/algorithm/predicates/predicates_test.go +++ b/pkg/scheduler/algorithm/predicates/predicates_test.go @@ -349,9 +349,9 @@ func TestPodFitsResources(t *testing.T) { schedulercache.Resource{MilliCPU: 1, Memory: 1, ScalarResources: map[v1.ResourceName]int64{extendedResourceB: 1}}), nodeInfo: schedulercache.NewNodeInfo( newResourcePod(schedulercache.Resource{MilliCPU: 0, Memory: 0})), - fits: true, + fits: true, ignoredExtendedResources: sets.NewString(string(extendedResourceB)), - name: "skip checking ignored extended resource", + name: "skip checking ignored extended resource", }, } @@ -2983,7 +2983,7 @@ func TestInterPodAffinityWithMultipleNodes(t *testing.T) { "machine3": false, }, nodesExpectAffinityFailureReasons: [][]algorithm.PredicateFailureReason{nil, nil, {ErrPodAffinityNotMatch, ErrPodAffinityRulesNotMatch}}, - name: "A pod can be scheduled onto all the nodes that have the same topology key & label value with one of them has an existing pod that match the affinity rules", + name: "A pod can be scheduled onto all the nodes that have the same topology key & label value with one of them has an existing pod that match the affinity rules", }, { pod: &v1.Pod{ diff --git a/pkg/scheduler/cache/node_tree_test.go b/pkg/scheduler/cache/node_tree_test.go index 135c7c0bb4c..5af35721026 100644 --- a/pkg/scheduler/cache/node_tree_test.go +++ b/pkg/scheduler/cache/node_tree_test.go @@ -203,7 +203,7 @@ func TestNodeTree_RemoveNode(t *testing.T) { existingNodes: allNodes[:7], nodesToRemove: allNodes[1:4], expectedTree: map[string]*nodeArray{ - "": {[]string{"node-0"}, 0}, + "": {[]string{"node-0"}, 0}, "region-1:\x00:zone-2": {[]string{"node-4"}, 0}, "region-1:\x00:zone-3": {[]string{"node-5"}, 0}, "region-2:\x00:zone-2": {[]string{"node-6"}, 0}, @@ -294,7 +294,7 @@ func TestNodeTree_UpdateNode(t *testing.T) { }, }, expectedTree: map[string]*nodeArray{ - "": {[]string{"node-0"}, 0}, + "": {[]string{"node-0"}, 0}, "region-1:\x00:zone-2": {[]string{"node-new"}, 0}, }, }, diff --git a/pkg/scheduler/core/equivalence/eqivalence_test.go b/pkg/scheduler/core/equivalence/eqivalence_test.go index 35111918bdf..f0f70b27b54 100644 --- a/pkg/scheduler/core/equivalence/eqivalence_test.go +++ b/pkg/scheduler/core/equivalence/eqivalence_test.go @@ -388,9 +388,9 @@ func TestLookupResult(t *testing.T) { expectedPredicateItem predicateItemType }{ { - name: "test 1", - podName: "testPod", - nodeName: "node1", + name: "test 1", + podName: "testPod", + nodeName: "node1", equivalenceHashForUpdatePredicate: 123, equivalenceHashForCalPredicate: 123, predicateKey: "GeneralPredicates", @@ -406,9 +406,9 @@ func TestLookupResult(t *testing.T) { }, }, { - name: "test 2", - podName: "testPod", - nodeName: "node2", + name: "test 2", + podName: "testPod", + nodeName: "node2", equivalenceHashForUpdatePredicate: 123, equivalenceHashForCalPredicate: 123, predicateKey: "GeneralPredicates", @@ -423,9 +423,9 @@ func TestLookupResult(t *testing.T) { }, }, { - name: "test 3", - podName: "testPod", - nodeName: "node3", + name: "test 3", + podName: "testPod", + nodeName: "node3", equivalenceHashForUpdatePredicate: 123, equivalenceHashForCalPredicate: 123, predicateKey: "GeneralPredicates", @@ -441,9 +441,9 @@ func TestLookupResult(t *testing.T) { }, }, { - name: "test 4", - podName: "testPod", - nodeName: "node4", + name: "test 4", + podName: "testPod", + nodeName: "node4", equivalenceHashForUpdatePredicate: 123, equivalenceHashForCalPredicate: 456, predicateKey: "GeneralPredicates", @@ -651,9 +651,9 @@ func TestInvalidateCachedPredicateItemOfAllNodes(t *testing.T) { cachedItem predicateItemType }{ { - name: "hash predicate 123 not fits host ports", - podName: "testPod", - nodeName: "node1", + name: "hash predicate 123 not fits host ports", + podName: "testPod", + nodeName: "node1", equivalenceHashForUpdatePredicate: 123, cachedItem: predicateItemType{ fit: false, @@ -663,9 +663,9 @@ func TestInvalidateCachedPredicateItemOfAllNodes(t *testing.T) { }, }, { - name: "hash predicate 456 not fits host ports", - podName: "testPod", - nodeName: "node2", + name: "hash predicate 456 not fits host ports", + podName: "testPod", + nodeName: "node2", equivalenceHashForUpdatePredicate: 456, cachedItem: predicateItemType{ fit: false, @@ -675,9 +675,9 @@ func TestInvalidateCachedPredicateItemOfAllNodes(t *testing.T) { }, }, { - name: "hash predicate 123 fits", - podName: "testPod", - nodeName: "node3", + name: "hash predicate 123 fits", + podName: "testPod", + nodeName: "node3", equivalenceHashForUpdatePredicate: 123, cachedItem: predicateItemType{ fit: true, @@ -733,9 +733,9 @@ func TestInvalidateAllCachedPredicateItemOfNode(t *testing.T) { cachedItem predicateItemType }{ { - name: "hash predicate 123 not fits host ports", - podName: "testPod", - nodeName: "node1", + name: "hash predicate 123 not fits host ports", + podName: "testPod", + nodeName: "node1", equivalenceHashForUpdatePredicate: 123, cachedItem: predicateItemType{ fit: false, @@ -743,9 +743,9 @@ func TestInvalidateAllCachedPredicateItemOfNode(t *testing.T) { }, }, { - name: "hash predicate 456 not fits host ports", - podName: "testPod", - nodeName: "node2", + name: "hash predicate 456 not fits host ports", + podName: "testPod", + nodeName: "node2", equivalenceHashForUpdatePredicate: 456, cachedItem: predicateItemType{ fit: false, @@ -753,9 +753,9 @@ func TestInvalidateAllCachedPredicateItemOfNode(t *testing.T) { }, }, { - name: "hash predicate 123 fits host ports", - podName: "testPod", - nodeName: "node3", + name: "hash predicate 123 fits host ports", + podName: "testPod", + nodeName: "node3", equivalenceHashForUpdatePredicate: 123, cachedItem: predicateItemType{ fit: true, diff --git a/pkg/scheduler/core/extender.go b/pkg/scheduler/core/extender.go index 94d14349365..6235f33074e 100644 --- a/pkg/scheduler/core/extender.go +++ b/pkg/scheduler/core/extender.go @@ -138,7 +138,7 @@ func (h *HTTPExtender) ProcessPreemption( // If extender has cached node info, pass NodeNameToMetaVictims in args. nodeNameToMetaVictims := convertToNodeNameToMetaVictims(nodeToVictims) args = &schedulerapi.ExtenderPreemptionArgs{ - Pod: pod, + Pod: pod, NodeNameToMetaVictims: nodeNameToMetaVictims, } } else { diff --git a/pkg/scheduler/core/generic_scheduler_test.go b/pkg/scheduler/core/generic_scheduler_test.go index 7501b19ace9..b94150633d3 100644 --- a/pkg/scheduler/core/generic_scheduler_test.go +++ b/pkg/scheduler/core/generic_scheduler_test.go @@ -411,9 +411,9 @@ func TestGenericScheduler(t *testing.T) { predicates: map[string]algorithm.FitPredicate{"true": truePredicate, "matches": matchesPredicate, "false": falsePredicate}, prioritizers: []algorithm.PriorityConfig{{Map: EqualPriorityMap, Weight: 1}}, alwaysCheckAllPredicates: true, - nodes: []string{"1"}, - pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, - name: "test alwaysCheckAllPredicates is true", + nodes: []string{"1"}, + pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, + name: "test alwaysCheckAllPredicates is true", wErr: &FitError{ Pod: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2", UID: types.UID("2")}}, NumAllNodes: 1, diff --git a/pkg/scheduler/factory/factory_test.go b/pkg/scheduler/factory/factory_test.go index d45a8d1d356..d9fc655d73f 100644 --- a/pkg/scheduler/factory/factory_test.go +++ b/pkg/scheduler/factory/factory_test.go @@ -424,12 +424,12 @@ func TestInvalidFactoryArgs(t *testing.T) { expectErr string }{ { - name: "symmetric weight below range", + name: "symmetric weight below range", hardPodAffinitySymmetricWeight: -1, expectErr: "invalid hardPodAffinitySymmetricWeight: -1, must be in the range 0-100", }, { - name: "symmetric weight above range", + name: "symmetric weight above range", hardPodAffinitySymmetricWeight: 101, expectErr: "invalid hardPodAffinitySymmetricWeight: 101, must be in the range 0-100", }, diff --git a/pkg/security/apparmor/validate_test.go b/pkg/security/apparmor/validate_test.go index 54da00e5577..6ec4ce6f1c3 100644 --- a/pkg/security/apparmor/validate_test.go +++ b/pkg/security/apparmor/validate_test.go @@ -49,10 +49,10 @@ func TestValidateHost(t *testing.T) { func TestValidateProfile(t *testing.T) { loadedProfiles := map[string]bool{ - "docker-default": true, - "foo-bar": true, - "baz": true, - "/usr/sbin/ntpd": true, + "docker-default": true, + "foo-bar": true, + "baz": true, + "/usr/sbin/ntpd": true, "/usr/lib/connman/scripts/dhclient-script": true, "/usr/lib/NetworkManager/nm-dhcp-client.action": true, "/usr/bin/evince-previewer//sanitized_helper": true, diff --git a/pkg/volume/awsebs/aws_ebs_test.go b/pkg/volume/awsebs/aws_ebs_test.go index c18282f4f2c..acaa4f65ed8 100644 --- a/pkg/volume/awsebs/aws_ebs_test.go +++ b/pkg/volume/awsebs/aws_ebs_test.go @@ -167,7 +167,7 @@ func TestPlugin(t *testing.T) { // Test Provisioner options := volume.VolumeOptions{ - PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } provisioner, err := plug.(*awsElasticBlockStorePlugin).newProvisionerInternal(options, &fakePDManager{}) diff --git a/pkg/volume/cinder/cinder_test.go b/pkg/volume/cinder/cinder_test.go index 409cedcf23c..7a4a5266771 100644 --- a/pkg/volume/cinder/cinder_test.go +++ b/pkg/volume/cinder/cinder_test.go @@ -195,7 +195,7 @@ func TestPlugin(t *testing.T) { // Test Provisioner options := volume.VolumeOptions{ - PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } provisioner, err := plug.(*cinderPlugin).newProvisionerInternal(options, &fakePDManager{0}) diff --git a/pkg/volume/flocker/flocker_util_test.go b/pkg/volume/flocker/flocker_util_test.go index bfb48663815..4f18a187a96 100644 --- a/pkg/volume/flocker/flocker_util_test.go +++ b/pkg/volume/flocker/flocker_util_test.go @@ -34,7 +34,7 @@ func TestFlockerUtil_CreateVolume(t *testing.T) { // test CreateVolume happy path pvc := volumetest.CreateTestPVC("3Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}) options := volume.VolumeOptions{ - PVC: pvc, + PVC: pvc, PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } diff --git a/pkg/volume/flocker/flocker_volume_test.go b/pkg/volume/flocker/flocker_volume_test.go index 7a46232d412..1410f3f2e71 100644 --- a/pkg/volume/flocker/flocker_volume_test.go +++ b/pkg/volume/flocker/flocker_volume_test.go @@ -50,7 +50,7 @@ func TestProvision(t *testing.T) { pvc := volumetest.CreateTestPVC("3Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}) options := volume.VolumeOptions{ - PVC: pvc, + PVC: pvc, PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } @@ -76,7 +76,7 @@ func TestProvision(t *testing.T) { // parameters are not supported options = volume.VolumeOptions{ - PVC: pvc, + PVC: pvc, PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, Parameters: map[string]string{ "not-supported-params": "test123", @@ -91,7 +91,7 @@ func TestProvision(t *testing.T) { // selectors are not supported pvc.Spec.Selector = &metav1.LabelSelector{MatchLabels: map[string]string{"key": "value"}} options = volume.VolumeOptions{ - PVC: pvc, + PVC: pvc, PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } diff --git a/pkg/volume/gcepd/gce_pd_test.go b/pkg/volume/gcepd/gce_pd_test.go index 317404f6758..a3200de5795 100644 --- a/pkg/volume/gcepd/gce_pd_test.go +++ b/pkg/volume/gcepd/gce_pd_test.go @@ -174,7 +174,7 @@ func TestPlugin(t *testing.T) { // Test Provisioner options := volume.VolumeOptions{ - PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } provisioner, err := plug.(*gcePersistentDiskPlugin).newProvisionerInternal(options, &fakePDManager{}) diff --git a/pkg/volume/host_path/host_path_test.go b/pkg/volume/host_path/host_path_test.go index 3824acede12..f29e1599475 100644 --- a/pkg/volume/host_path/host_path_test.go +++ b/pkg/volume/host_path/host_path_test.go @@ -170,7 +170,7 @@ func TestProvisioner(t *testing.T) { t.Errorf("Can't find the plugin by name") } options := volume.VolumeOptions{ - PVC: volumetest.CreateTestPVC("1Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVC: volumetest.CreateTestPVC("1Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } creater, err := plug.NewProvisioner(options) diff --git a/pkg/volume/iscsi/iscsi_test.go b/pkg/volume/iscsi/iscsi_test.go index 58668f4c483..4c2f3f960f5 100644 --- a/pkg/volume/iscsi/iscsi_test.go +++ b/pkg/volume/iscsi/iscsi_test.go @@ -488,8 +488,8 @@ func TestGetISCSICHAP(t *testing.T) { expectedError: nil, }, { - name: "no volume", - spec: &volume.Spec{}, + name: "no volume", + spec: &volume.Spec{}, expectedDiscoveryCHAP: false, expectedSessionCHAP: false, expectedError: fmt.Errorf("Spec does not reference an ISCSI volume type"), diff --git a/pkg/volume/photon_pd/photon_pd_test.go b/pkg/volume/photon_pd/photon_pd_test.go index d3c14a229db..a20eefc1635 100644 --- a/pkg/volume/photon_pd/photon_pd_test.go +++ b/pkg/volume/photon_pd/photon_pd_test.go @@ -159,7 +159,7 @@ func TestPlugin(t *testing.T) { // Test Provisioner options := volume.VolumeOptions{ - PVC: volumetest.CreateTestPVC("10Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVC: volumetest.CreateTestPVC("10Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } provisioner, err := plug.(*photonPersistentDiskPlugin).newProvisionerInternal(options, &fakePDManager{}) diff --git a/pkg/volume/portworx/portworx_test.go b/pkg/volume/portworx/portworx_test.go index 72be62500fe..76c51f2cf3b 100644 --- a/pkg/volume/portworx/portworx_test.go +++ b/pkg/volume/portworx/portworx_test.go @@ -196,7 +196,7 @@ func TestPlugin(t *testing.T) { // Test Provisioner options := volume.VolumeOptions{ - PVC: volumetest.CreateTestPVC("100Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVC: volumetest.CreateTestPVC("100Gi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } diff --git a/pkg/volume/scaleio/sio_client.go b/pkg/volume/scaleio/sio_client.go index d789bfd6cf8..de5b050019f 100644 --- a/pkg/volume/scaleio/sio_client.go +++ b/pkg/volume/scaleio/sio_client.go @@ -236,7 +236,7 @@ func (c *sioClient) AttachVolume(id sioVolumeID, multipleMappings bool) error { } params := &siotypes.MapVolumeSdcParam{ - SdcID: iid, + SdcID: iid, AllowMultipleMappings: strconv.FormatBool(multipleMappings), AllSdcs: "", } diff --git a/pkg/volume/scaleio/sio_volume_test.go b/pkg/volume/scaleio/sio_volume_test.go index 8d725af8647..7f122143f51 100644 --- a/pkg/volume/scaleio/sio_volume_test.go +++ b/pkg/volume/scaleio/sio_volume_test.go @@ -263,8 +263,8 @@ func TestVolumeProvisioner(t *testing.T) { } options := volume.VolumeOptions{ - ClusterName: "testcluster", - PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), + ClusterName: "testcluster", + PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete, } options.PVC.Name = "testpvc" @@ -408,9 +408,9 @@ func TestVolumeProvisionerWithIncompleteConfig(t *testing.T) { } options := volume.VolumeOptions{ - ClusterName: "testcluster", - PVName: "pvc-sio-dynamic-vol", - PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), + ClusterName: "testcluster", + PVName: "pvc-sio-dynamic-vol", + PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete, } options.PVC.Namespace = testns @@ -440,9 +440,9 @@ func TestVolumeProvisionerWithZeroCapacity(t *testing.T) { } options := volume.VolumeOptions{ - ClusterName: "testcluster", - PVName: "pvc-sio-dynamic-vol", - PVC: volumetest.CreateTestPVC("0Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), + ClusterName: "testcluster", + PVName: "pvc-sio-dynamic-vol", + PVC: volumetest.CreateTestPVC("0Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete, } options.PVC.Namespace = testns @@ -488,9 +488,9 @@ func TestVolumeProvisionerWithSecretNamespace(t *testing.T) { } options := volume.VolumeOptions{ - ClusterName: "testcluster", - PVName: "pvc-sio-dynamic-vol", - PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), + ClusterName: "testcluster", + PVName: "pvc-sio-dynamic-vol", + PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete, } diff --git a/pkg/volume/storageos/storageos_util_test.go b/pkg/volume/storageos/storageos_util_test.go index be912b64d72..598bfd5a212 100644 --- a/pkg/volume/storageos/storageos_util_test.go +++ b/pkg/volume/storageos/storageos_util_test.go @@ -133,8 +133,8 @@ func TestCreateVolume(t *testing.T) { } options := volume.VolumeOptions{ - PVName: testPVName, - PVC: volumetest.CreateTestPVC(fmt.Sprintf("%dGi", testSize), []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVName: testPVName, + PVC: volumetest.CreateTestPVC(fmt.Sprintf("%dGi", testSize), []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } diff --git a/pkg/volume/util/device_util_linux_test.go b/pkg/volume/util/device_util_linux_test.go index 7acb52bd894..a8c0b6243c4 100644 --- a/pkg/volume/util/device_util_linux_test.go +++ b/pkg/volume/util/device_util_linux_test.go @@ -159,8 +159,8 @@ func (handler *mockOsIOHandler) Lstat(name string) (os.FileInfo, error) { func (handler *mockOsIOHandler) EvalSymlinks(path string) (string, error) { links := map[string]string{ - "/returns/a/dev": "/dev/sde", - "/returns/non/dev": "/sys/block", + "/returns/a/dev": "/dev/sde", + "/returns/non/dev": "/sys/block", "/dev/disk/by-path/127.0.0.1:3260-eui.02004567A425678D-lun-0": "/dev/sda", "/dev/disk/by-path/127.0.0.3:3260-eui.03004567A425678D-lun-0": "/dev/sdb", "/dev/dm-2": "/dev/dm-2", diff --git a/pkg/volume/util/operationexecutor/operation_generator.go b/pkg/volume/util/operationexecutor/operation_generator.go index 074e38613fa..95e478246ab 100644 --- a/pkg/volume/util/operationexecutor/operation_generator.go +++ b/pkg/volume/util/operationexecutor/operation_generator.go @@ -72,11 +72,11 @@ func NewOperationGenerator(kubeClient clientset.Interface, blkUtil volumepathhandler.BlockVolumePathHandler) OperationGenerator { return &operationGenerator{ - kubeClient: kubeClient, - volumePluginMgr: volumePluginMgr, - recorder: recorder, + kubeClient: kubeClient, + volumePluginMgr: volumePluginMgr, + recorder: recorder, checkNodeCapabilitiesBeforeMount: checkNodeCapabilitiesBeforeMount, - blkUtil: blkUtil, + blkUtil: blkUtil, } } diff --git a/pkg/volume/vsphere_volume/vsphere_volume_test.go b/pkg/volume/vsphere_volume/vsphere_volume_test.go index 92c4b4d0b95..866694ebc9a 100644 --- a/pkg/volume/vsphere_volume/vsphere_volume_test.go +++ b/pkg/volume/vsphere_volume/vsphere_volume_test.go @@ -152,7 +152,7 @@ func TestPlugin(t *testing.T) { // Test Provisioner options := volume.VolumeOptions{ - PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), + PVC: volumetest.CreateTestPVC("100Mi", []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}), PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete, } provisioner, err := plug.(*vsphereVolumePlugin).newProvisionerInternal(options, &fakePDManager{}) diff --git a/plugin/pkg/admission/imagepolicy/admission_test.go b/plugin/pkg/admission/imagepolicy/admission_test.go index 48a808390bf..3bb47380b8d 100644 --- a/plugin/pkg/admission/imagepolicy/admission_test.go +++ b/plugin/pkg/admission/imagepolicy/admission_test.go @@ -930,9 +930,9 @@ func TestAnnotationFiltering(t *testing.T) { annotations: map[string]string{ "my.image-policy.k8s.io/test": "test", "other.image-policy.k8s.io/test2": "annotation", - "test": "test", - "another": "another", - "": "", + "test": "test", + "another": "another", + "": "", }, outAnnotations: map[string]string{ "my.image-policy.k8s.io/test": "test", diff --git a/plugin/pkg/admission/podnodeselector/admission_test.go b/plugin/pkg/admission/podnodeselector/admission_test.go index f9aad7bebb8..c48c795ef7a 100644 --- a/plugin/pkg/admission/podnodeselector/admission_test.go +++ b/plugin/pkg/admission/podnodeselector/admission_test.go @@ -73,16 +73,16 @@ func TestPodAdmission(t *testing.T) { podNodeSelector: map[string]string{}, mergedNodeSelector: labels.Set{}, ignoreTestNamespaceNodeSelector: true, - admit: true, - testName: "No node selectors", + admit: true, + testName: "No node selectors", }, { defaultNodeSelector: "infra = false", podNodeSelector: map[string]string{}, mergedNodeSelector: labels.Set{"infra": "false"}, ignoreTestNamespaceNodeSelector: true, - admit: true, - testName: "Default node selector and no conflicts", + admit: true, + testName: "Default node selector and no conflicts", }, { defaultNodeSelector: "", diff --git a/plugin/pkg/admission/podtolerationrestriction/admission_test.go b/plugin/pkg/admission/podtolerationrestriction/admission_test.go index 7cb49d5f75e..52fdf816c37 100644 --- a/plugin/pkg/admission/podtolerationrestriction/admission_test.go +++ b/plugin/pkg/admission/podtolerationrestriction/admission_test.go @@ -98,7 +98,7 @@ func TestPodAdmission(t *testing.T) { testName string }{ { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, namespaceTolerations: nil, podTolerations: []api.Toleration{}, @@ -107,7 +107,7 @@ func TestPodAdmission(t *testing.T) { testName: "default cluster tolerations with empty pod tolerations and nil namespace tolerations", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, namespaceTolerations: []api.Toleration{}, podTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, @@ -116,7 +116,7 @@ func TestPodAdmission(t *testing.T) { testName: "default cluster tolerations with pod tolerations specified", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{}, namespaceTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, podTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, @@ -125,7 +125,7 @@ func TestPodAdmission(t *testing.T) { testName: "namespace tolerations", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{}, namespaceTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, podTolerations: []api.Toleration{}, @@ -134,7 +134,7 @@ func TestPodAdmission(t *testing.T) { testName: "no pod tolerations", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{}, namespaceTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, podTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue1", Effect: "NoSchedule", TolerationSeconds: nil}}, @@ -142,7 +142,7 @@ func TestPodAdmission(t *testing.T) { testName: "conflicting pod and namespace tolerations", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue2", Effect: "NoSchedule", TolerationSeconds: nil}}, namespaceTolerations: []api.Toleration{}, podTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue1", Effect: "NoSchedule", TolerationSeconds: nil}}, @@ -151,7 +151,7 @@ func TestPodAdmission(t *testing.T) { testName: "conflicting pod and default cluster tolerations but overridden by empty namespace tolerations", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{}, namespaceTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, whitelist: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, @@ -161,7 +161,7 @@ func TestPodAdmission(t *testing.T) { testName: "merged pod tolerations satisfy whitelist", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, namespaceTolerations: []api.Toleration{}, podTolerations: []api.Toleration{}, @@ -179,7 +179,7 @@ func TestPodAdmission(t *testing.T) { testName: "pod toleration conflicts with default cluster white list which is overridden by empty namespace whitelist", }, { - pod: bestEffortPod, + pod: bestEffortPod, defaultClusterTolerations: []api.Toleration{}, namespaceTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, whitelist: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue1", Effect: "NoSchedule", TolerationSeconds: nil}}, @@ -188,7 +188,7 @@ func TestPodAdmission(t *testing.T) { testName: "merged pod tolerations conflict with the whitelist", }, { - pod: burstablePod, + pod: burstablePod, defaultClusterTolerations: []api.Toleration{}, namespaceTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, whitelist: []api.Toleration{}, @@ -201,7 +201,7 @@ func TestPodAdmission(t *testing.T) { testName: "added memoryPressure/DiskPressure for Burstable pod", }, { - pod: guaranteedPod, + pod: guaranteedPod, defaultClusterTolerations: []api.Toleration{}, namespaceTolerations: []api.Toleration{{Key: "testKey", Operator: "Equal", Value: "testValue", Effect: "NoSchedule", TolerationSeconds: nil}}, whitelist: []api.Toleration{}, diff --git a/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go index 85fb159ddcc..7e992c58469 100644 --- a/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go @@ -96,7 +96,7 @@ func (DaemonSetSpec) SwaggerDoc() map[string]string { } var map_DaemonSetStatus = map[string]string{ - "": "DaemonSetStatus represents the current status of a daemon set.", + "": "DaemonSetStatus represents the current status of a daemon set.", "currentNumberScheduled": "The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "numberMisscheduled": "The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "desiredNumberScheduled": "The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", diff --git a/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go b/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go index 627df3ab76d..f8229ceda82 100644 --- a/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go @@ -96,7 +96,7 @@ func (DaemonSetSpec) SwaggerDoc() map[string]string { } var map_DaemonSetStatus = map[string]string{ - "": "DaemonSetStatus represents the current status of a daemon set.", + "": "DaemonSetStatus represents the current status of a daemon set.", "currentNumberScheduled": "The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "numberMisscheduled": "The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "desiredNumberScheduled": "The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", diff --git a/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go index a6e874f3da9..72ac9727121 100644 --- a/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go @@ -196,8 +196,8 @@ func (PodsMetricStatus) SwaggerDoc() map[string]string { } var map_ResourceMetricSource = map[string]string{ - "": "ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.", - "name": "name is the name of the resource in question.", + "": "ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.", + "name": "name is the name of the resource in question.", "targetAverageUtilization": "targetAverageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.", "targetAverageValue": "targetAverageValue is the target value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type.", } @@ -207,8 +207,8 @@ func (ResourceMetricSource) SwaggerDoc() map[string]string { } var map_ResourceMetricStatus = map[string]string{ - "": "ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", - "name": "name is the name of the resource in question.", + "": "ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", + "name": "name is the name of the resource in question.", "currentAverageUtilization": "currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. It will only be present if `targetAverageValue` was set in the corresponding metric specification.", "currentAverageValue": "currentAverageValue is the current value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type. It will always be set, regardless of the corresponding metric specification.", } diff --git a/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go index 411b817d04e..589408ace0c 100644 --- a/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/autoscaling/v2beta1/types_swagger_doc_generated.go @@ -197,8 +197,8 @@ func (PodsMetricStatus) SwaggerDoc() map[string]string { } var map_ResourceMetricSource = map[string]string{ - "": "ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.", - "name": "name is the name of the resource in question.", + "": "ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set.", + "name": "name is the name of the resource in question.", "targetAverageUtilization": "targetAverageUtilization is the target value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.", "targetAverageValue": "targetAverageValue is the target value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type.", } @@ -208,8 +208,8 @@ func (ResourceMetricSource) SwaggerDoc() map[string]string { } var map_ResourceMetricStatus = map[string]string{ - "": "ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", - "name": "name is the name of the resource in question.", + "": "ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", + "name": "name is the name of the resource in question.", "currentAverageUtilization": "currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods. It will only be present if `targetAverageValue` was set in the corresponding metric specification.", "currentAverageValue": "currentAverageValue is the current value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type. It will always be set, regardless of the corresponding metric specification.", } diff --git a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go index 840972873f4..c56c4edc512 100644 --- a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -1637,7 +1637,7 @@ func (PreferredSchedulingTerm) SwaggerDoc() map[string]string { } var map_Probe = map[string]string{ - "": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", + "": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", "initialDelaySeconds": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "timeoutSeconds": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "periodSeconds": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", @@ -2202,7 +2202,7 @@ func (TopologySelectorLabelRequirement) SwaggerDoc() map[string]string { } var map_TopologySelectorTerm = map[string]string{ - "": "A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future.", + "": "A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future.", "matchLabelExpressions": "A list of topology selector requirements by labels.", } @@ -2286,23 +2286,23 @@ var map_VolumeSource = map[string]string{ "iscsi": "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md", "glusterfs": "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", "persistentVolumeClaim": "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - "rbd": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", - "flexVolume": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - "cinder": "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - "cephfs": "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - "flocker": "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", - "downwardAPI": "DownwardAPI represents downward API about the pod that should populate this volume", - "fc": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - "azureFile": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - "configMap": "ConfigMap represents a configMap that should populate this volume", - "vsphereVolume": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - "quobyte": "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - "azureDisk": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - "photonPersistentDisk": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - "projected": "Items for all in one resources secrets, configmaps, and downward API", - "portworxVolume": "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - "scaleIO": "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - "storageos": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", + "rbd": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", + "flexVolume": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", + "cinder": "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", + "cephfs": "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", + "flocker": "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", + "downwardAPI": "DownwardAPI represents downward API about the pod that should populate this volume", + "fc": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", + "azureFile": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", + "configMap": "ConfigMap represents a configMap that should populate this volume", + "vsphereVolume": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", + "quobyte": "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", + "azureDisk": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", + "photonPersistentDisk": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", + "projected": "Items for all in one resources secrets, configmaps, and downward API", + "portworxVolume": "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", + "scaleIO": "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", + "storageos": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", } func (VolumeSource) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go index cdbc490a5ef..a4b8ca67251 100644 --- a/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go @@ -114,7 +114,7 @@ func (DaemonSetSpec) SwaggerDoc() map[string]string { } var map_DaemonSetStatus = map[string]string{ - "": "DaemonSetStatus represents the current status of a daemon set.", + "": "DaemonSetStatus represents the current status of a daemon set.", "currentNumberScheduled": "The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "numberMisscheduled": "The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", "desiredNumberScheduled": "The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", diff --git a/staging/src/k8s.io/api/rbac/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/rbac/v1/types_swagger_doc_generated.go index 0ec20c88e79..83ce310e6fa 100644 --- a/staging/src/k8s.io/api/rbac/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/rbac/v1/types_swagger_doc_generated.go @@ -28,7 +28,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_AggregationRule = map[string]string{ - "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", + "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", "clusterRoleSelectors": "ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", } diff --git a/staging/src/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go index 1d6ef30b0eb..d7b194ae407 100644 --- a/staging/src/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go @@ -28,7 +28,7 @@ package v1alpha1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_AggregationRule = map[string]string{ - "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", + "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", "clusterRoleSelectors": "ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", } diff --git a/staging/src/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go index 66dba6ca13e..c80327593d7 100644 --- a/staging/src/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go @@ -28,7 +28,7 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_AggregationRule = map[string]string{ - "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", + "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", "clusterRoleSelectors": "ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", } diff --git a/staging/src/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go index 32d7dcc52f9..3701b08640d 100644 --- a/staging/src/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go @@ -49,7 +49,7 @@ func (VolumeAttachmentList) SwaggerDoc() map[string]string { } var map_VolumeAttachmentSource = map[string]string{ - "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", + "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", "persistentVolumeName": "Name of the persistent volume to attach.", } diff --git a/staging/src/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go index 044d69f5855..834553e1a80 100644 --- a/staging/src/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go @@ -75,7 +75,7 @@ func (VolumeAttachmentList) SwaggerDoc() map[string]string { } var map_VolumeAttachmentSource = map[string]string{ - "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", + "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", "persistentVolumeName": "Name of the persistent volume to attach.", } diff --git a/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go b/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go index 1c2a83cfacb..854bd30fa3d 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go @@ -132,12 +132,12 @@ func AsPartialObjectMetadata(m metav1.Object) *metav1beta1.PartialObjectMetadata CreationTimestamp: m.GetCreationTimestamp(), DeletionTimestamp: m.GetDeletionTimestamp(), DeletionGracePeriodSeconds: m.GetDeletionGracePeriodSeconds(), - Labels: m.GetLabels(), - Annotations: m.GetAnnotations(), - OwnerReferences: m.GetOwnerReferences(), - Finalizers: m.GetFinalizers(), - ClusterName: m.GetClusterName(), - Initializers: m.GetInitializers(), + Labels: m.GetLabels(), + Annotations: m.GetAnnotations(), + OwnerReferences: m.GetOwnerReferences(), + Finalizers: m.GetFinalizers(), + ClusterName: m.GetClusterName(), + Initializers: m.GetInitializers(), }, } } diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/scheme_test.go b/staging/src/k8s.io/apimachinery/pkg/runtime/scheme_test.go index 66f652faaf6..aef8f7ea87f 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/scheme_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/scheme_test.go @@ -670,7 +670,7 @@ func TestConvertToVersion(t *testing.T) { gv: schema.GroupVersions{{Version: runtime.APIVersionInternal}, {Version: "v1"}}, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // unversioned type returned as-is @@ -681,7 +681,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.UnversionedType{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "UnversionedType"}, - A: "test", + A: "test", }, }, // unversioned type returned when not included in the target types @@ -692,7 +692,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.UnversionedType{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "UnversionedType"}, - A: "test", + A: "test", }, }, // detected as already being in the target version @@ -703,7 +703,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // detected as already being in the first target version @@ -714,7 +714,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // detected as already being in the first target version @@ -725,7 +725,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // the external type is registered in multiple groups, versions, and kinds, and can be targeted to all of them (1/3): different kind @@ -736,7 +736,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType3"}, - A: "test", + A: "test", }, }, // the external type is registered in multiple groups, versions, and kinds, and can be targeted to all of them (2/3): different gv @@ -747,7 +747,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "custom/v1", ObjectKind: "TestType3"}, - A: "test", + A: "test", }, }, // the external type is registered in multiple groups, versions, and kinds, and can be targeted to all of them (3/3): different gvk @@ -758,7 +758,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "custom/v1", ObjectKind: "TestType5"}, - A: "test", + A: "test", }, }, // multi group versioner recognizes multiple groups and forces the output to a particular version, copies because version differs @@ -768,7 +768,7 @@ func TestConvertToVersion(t *testing.T) { gv: runtime.NewMultiGroupVersioner(schema.GroupVersion{Group: "other", Version: "v2"}, schema.GroupKind{Group: "custom", Kind: "TestType3"}, schema.GroupKind{Kind: "TestType1"}), out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "other/v2", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // multi group versioner recognizes multiple groups and forces the output to a particular version, copies because version differs @@ -778,7 +778,7 @@ func TestConvertToVersion(t *testing.T) { gv: runtime.NewMultiGroupVersioner(schema.GroupVersion{Group: "other", Version: "v2"}, schema.GroupKind{Kind: "TestType1"}, schema.GroupKind{Group: "custom", Kind: "TestType3"}), out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "other/v2", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // multi group versioner is unable to find a match when kind AND group don't match (there is no TestType1 kind in group "other", and no kind "TestType5" in the default group) @@ -798,7 +798,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // multi group versioner recognizes multiple groups and forces the output to a particular version, performs no copy @@ -809,7 +809,7 @@ func TestConvertToVersion(t *testing.T) { same: true, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType1"}, - A: "test", + A: "test", }, }, // group versioner can choose a particular target kind for a given input when kind is the same across group versions @@ -819,7 +819,7 @@ func TestConvertToVersion(t *testing.T) { gv: testGroupVersioner{ok: true, target: schema.GroupVersionKind{Version: "v1", Kind: "TestType3"}}, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "v1", ObjectKind: "TestType3"}, - A: "test", + A: "test", }, }, // group versioner can choose a different kind @@ -829,7 +829,7 @@ func TestConvertToVersion(t *testing.T) { gv: testGroupVersioner{ok: true, target: schema.GroupVersionKind{Kind: "TestType5", Group: "custom", Version: "v1"}}, out: &runtimetesting.ExternalTestType1{ MyWeirdCustomEmbeddedVersionKindField: runtimetesting.MyWeirdCustomEmbeddedVersionKindField{APIVersion: "custom/v1", ObjectKind: "TestType5"}, - A: "test", + A: "test", }, }, } diff --git a/staging/src/k8s.io/apimachinery/pkg/util/validation/validation_test.go b/staging/src/k8s.io/apimachinery/pkg/util/validation/validation_test.go index b3892e1c9c8..c4d5aba2978 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/validation/validation_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/validation/validation_test.go @@ -297,7 +297,7 @@ func TestIsValidLabelValue(t *testing.T) { "end-with-num-1", "1234", // only num strings.Repeat("a", 63), // to the limit - "", // empty value + "", // empty value } for i := range successCases { if errs := IsValidLabelValue(successCases[i]); len(errs) != 0 { diff --git a/staging/src/k8s.io/apiserver/pkg/audit/request.go b/staging/src/k8s.io/apiserver/pkg/audit/request.go index 9593b6c8ab4..3aafde910f9 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/request.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/request.go @@ -45,10 +45,10 @@ const ( func NewEventFromRequest(req *http.Request, level auditinternal.Level, attribs authorizer.Attributes) (*auditinternal.Event, error) { ev := &auditinternal.Event{ RequestReceivedTimestamp: metav1.NewMicroTime(time.Now()), - Verb: attribs.GetVerb(), - RequestURI: req.URL.RequestURI(), - UserAgent: maybeTruncateUserAgent(req), - Level: level, + Verb: attribs.GetVerb(), + RequestURI: req.URL.RequestURI(), + UserAgent: maybeTruncateUserAgent(req), + Level: level, } // prefer the id from the headers. If not available, create a new one. diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/etcd_test.go b/staging/src/k8s.io/apiserver/pkg/server/options/etcd_test.go index 27fc3c4aff7..6b1e44019b8 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/etcd_test.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/etcd_test.go @@ -36,16 +36,16 @@ func TestEtcdOptionsValidate(t *testing.T) { name: "test when ServerList is not specified", testOptions: &EtcdOptions{ StorageConfig: storagebackend.Config{ - Type: "etcd2", - ServerList: nil, - Prefix: "/registry", + Type: "etcd2", + ServerList: nil, + Prefix: "/registry", DeserializationCacheSize: 0, - Quorum: false, - KeyFile: "/var/run/kubernetes/etcd.key", - CAFile: "/var/run/kubernetes/etcdca.crt", - CertFile: "/var/run/kubernetes/etcdce.crt", - CompactionInterval: storagebackend.DefaultCompactInterval, - CountMetricPollPeriod: time.Minute, + Quorum: false, + KeyFile: "/var/run/kubernetes/etcd.key", + CAFile: "/var/run/kubernetes/etcdca.crt", + CertFile: "/var/run/kubernetes/etcdce.crt", + CompactionInterval: storagebackend.DefaultCompactInterval, + CountMetricPollPeriod: time.Minute, }, DefaultStorageMediaType: "application/vnd.kubernetes.protobuf", DeleteCollectionWorkers: 1, @@ -60,16 +60,16 @@ func TestEtcdOptionsValidate(t *testing.T) { name: "test when storage-backend is invalid", testOptions: &EtcdOptions{ StorageConfig: storagebackend.Config{ - Type: "etcd4", - ServerList: []string{"http://127.0.0.1"}, - Prefix: "/registry", + Type: "etcd4", + ServerList: []string{"http://127.0.0.1"}, + Prefix: "/registry", DeserializationCacheSize: 0, - Quorum: false, - KeyFile: "/var/run/kubernetes/etcd.key", - CAFile: "/var/run/kubernetes/etcdca.crt", - CertFile: "/var/run/kubernetes/etcdce.crt", - CompactionInterval: storagebackend.DefaultCompactInterval, - CountMetricPollPeriod: time.Minute, + Quorum: false, + KeyFile: "/var/run/kubernetes/etcd.key", + CAFile: "/var/run/kubernetes/etcdca.crt", + CertFile: "/var/run/kubernetes/etcdce.crt", + CompactionInterval: storagebackend.DefaultCompactInterval, + CountMetricPollPeriod: time.Minute, }, DefaultStorageMediaType: "application/vnd.kubernetes.protobuf", DeleteCollectionWorkers: 1, @@ -84,16 +84,16 @@ func TestEtcdOptionsValidate(t *testing.T) { name: "test when etcd-servers-overrides is invalid", testOptions: &EtcdOptions{ StorageConfig: storagebackend.Config{ - Type: "etcd3", - ServerList: []string{"http://127.0.0.1"}, - Prefix: "/registry", + Type: "etcd3", + ServerList: []string{"http://127.0.0.1"}, + Prefix: "/registry", DeserializationCacheSize: 0, - Quorum: false, - KeyFile: "/var/run/kubernetes/etcd.key", - CAFile: "/var/run/kubernetes/etcdca.crt", - CertFile: "/var/run/kubernetes/etcdce.crt", - CompactionInterval: storagebackend.DefaultCompactInterval, - CountMetricPollPeriod: time.Minute, + Quorum: false, + KeyFile: "/var/run/kubernetes/etcd.key", + CAFile: "/var/run/kubernetes/etcdca.crt", + CertFile: "/var/run/kubernetes/etcdce.crt", + CompactionInterval: storagebackend.DefaultCompactInterval, + CountMetricPollPeriod: time.Minute, }, DefaultStorageMediaType: "application/vnd.kubernetes.protobuf", DeleteCollectionWorkers: 1, @@ -108,16 +108,16 @@ func TestEtcdOptionsValidate(t *testing.T) { name: "test when EtcdOptions is valid", testOptions: &EtcdOptions{ StorageConfig: storagebackend.Config{ - Type: "etcd3", - ServerList: []string{"http://127.0.0.1"}, - Prefix: "/registry", + Type: "etcd3", + ServerList: []string{"http://127.0.0.1"}, + Prefix: "/registry", DeserializationCacheSize: 0, - Quorum: false, - KeyFile: "/var/run/kubernetes/etcd.key", - CAFile: "/var/run/kubernetes/etcdca.crt", - CertFile: "/var/run/kubernetes/etcdce.crt", - CompactionInterval: storagebackend.DefaultCompactInterval, - CountMetricPollPeriod: time.Minute, + Quorum: false, + KeyFile: "/var/run/kubernetes/etcd.key", + CAFile: "/var/run/kubernetes/etcdca.crt", + CertFile: "/var/run/kubernetes/etcdce.crt", + CompactionInterval: storagebackend.DefaultCompactInterval, + CountMetricPollPeriod: time.Minute, }, DefaultStorageMediaType: "application/vnd.kubernetes.protobuf", DeleteCollectionWorkers: 1, diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/serving_test.go b/staging/src/k8s.io/apiserver/pkg/server/options/serving_test.go index 6d8899fd90e..73375bb70c2 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/serving_test.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/serving_test.go @@ -684,7 +684,7 @@ func generateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, BasicConstraintsValid: true, - IsCA: true, + IsCA: true, } if ip := net.ParseIP(host); ip != nil { diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go index deafcfce975..65bce88b62e 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go @@ -297,7 +297,7 @@ func NewUnsecuredEtcd3TestClientServer(t *testing.T) (*EtcdTestServer, *storageb Prefix: etcdtest.PathPrefix(), ServerList: server.V3Client.Endpoints(), DeserializationCacheSize: etcdtest.DeserializationCacheSize, - Paging: true, + Paging: true, } return server, config } diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go index dc06ac52077..e7e554c6270 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go @@ -51,7 +51,7 @@ func newDefaultLeaseManager(client *clientv3.Client) *leaseManager { // value x means x*100%. func newLeaseManager(client *clientv3.Client, leaseReuseDurationSeconds int64, leaseReuseDurationPercent float64) *leaseManager { return &leaseManager{ - client: client, + client: client, leaseReuseDurationSeconds: leaseReuseDurationSeconds, leaseReuseDurationPercent: leaseReuseDurationPercent, } diff --git a/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/config.go b/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/config.go index cff8672863a..e94f81b349e 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/config.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/config.go @@ -72,8 +72,8 @@ func NewDefaultConfig(prefix string, codec runtime.Codec) *Config { // Default cache size to 0 - if unset, its size will be set based on target // memory usage. DeserializationCacheSize: 0, - Codec: codec, - CompactionInterval: DefaultCompactInterval, - Quorum: true, + Codec: codec, + CompactionInterval: DefaultCompactInterval, + Quorum: true, } } diff --git a/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go b/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go index 0399ed8435e..48d9764301a 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go +++ b/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go @@ -49,7 +49,7 @@ const ( var ( defaultCluster = v1.NamedCluster{ Cluster: v1.Cluster{ - Server: "https://webhook.example.com", + Server: "https://webhook.example.com", CertificateAuthorityData: caCert, }, } @@ -61,7 +61,7 @@ var ( } namedCluster = v1.NamedCluster{ Cluster: v1.Cluster{ - Server: "https://webhook.example.com", + Server: "https://webhook.example.com", CertificateAuthorityData: caCert, }, Name: "test-cluster", @@ -159,7 +159,7 @@ func TestKubeConfigFile(t *testing.T) { test: "cluster with invalid CA certificate ", cluster: &v1.NamedCluster{ Cluster: v1.Cluster{ - Server: namedCluster.Cluster.Server, + Server: namedCluster.Cluster.Server, CertificateAuthorityData: caKey, }, }, @@ -371,7 +371,7 @@ func TestTLSConfig(t *testing.T) { Clusters: []v1.NamedCluster{ { Cluster: v1.Cluster{ - Server: server.URL, + Server: server.URL, CertificateAuthorityData: tt.clientCA, }, }, @@ -436,7 +436,7 @@ func TestRequestTimeout(t *testing.T) { Clusters: []v1.NamedCluster{ { Cluster: v1.Cluster{ - Server: server.URL, + Server: server.URL, CertificateAuthorityData: caCert, }, }, @@ -522,7 +522,7 @@ func TestWithExponentialBackoff(t *testing.T) { Clusters: []v1.NamedCluster{ { Cluster: v1.Cluster{ - Server: server.URL, + Server: server.URL, CertificateAuthorityData: caCert, }, }, diff --git a/staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go b/staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go index 6f26b227579..05faf48eba1 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go +++ b/staging/src/k8s.io/apiserver/pkg/util/wsstream/conn.go @@ -137,7 +137,7 @@ type ChannelProtocolConfig struct { // channels. func NewDefaultChannelProtocols(channels []ChannelType) map[string]ChannelProtocolConfig { return map[string]ChannelProtocolConfig{ - "": {Binary: true, Channels: channels}, + "": {Binary: true, Channels: channels}, ChannelWebSocketProtocol: {Binary: true, Channels: channels}, Base64ChannelWebSocketProtocol: {Binary: false, Channels: channels}, } diff --git a/staging/src/k8s.io/apiserver/pkg/util/wsstream/stream.go b/staging/src/k8s.io/apiserver/pkg/util/wsstream/stream.go index 9dd165bfabc..4253c17cf57 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/wsstream/stream.go +++ b/staging/src/k8s.io/apiserver/pkg/util/wsstream/stream.go @@ -48,7 +48,7 @@ type ReaderProtocolConfig struct { // subprotocols "", "channel.k8s.io", "base64.channel.k8s.io". func NewDefaultReaderProtocols() map[string]ReaderProtocolConfig { return map[string]ReaderProtocolConfig{ - "": {Binary: true}, + "": {Binary: true}, binaryWebSocketProtocol: {Binary: true}, base64BinaryWebSocketProtocol: {Binary: false}, } diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook_test.go b/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook_test.go index f637af6f209..7fecf7796f8 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook_test.go +++ b/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook_test.go @@ -479,7 +479,7 @@ func TestWebhook(t *testing.T) { want: v1beta1.SubjectAccessReview{ TypeMeta: expTypeMeta, Spec: v1beta1.SubjectAccessReviewSpec{ - User: "jane", + User: "jane", NonResourceAttributes: &v1beta1.NonResourceAttributes{}, }, }, diff --git a/staging/src/k8s.io/client-go/tools/cache/shared_informer.go b/staging/src/k8s.io/client-go/tools/cache/shared_informer.go index 5f8c507f9e9..f29a4b33126 100644 --- a/staging/src/k8s.io/client-go/tools/cache/shared_informer.go +++ b/staging/src/k8s.io/client-go/tools/cache/shared_informer.go @@ -86,7 +86,7 @@ func NewSharedIndexInformer(lw ListerWatcher, objType runtime.Object, defaultEve resyncCheckPeriod: defaultEventHandlerResyncPeriod, defaultEventHandlerResyncPeriod: defaultEventHandlerResyncPeriod, cacheMutationDetector: NewCacheMutationDetector(fmt.Sprintf("%T", objType)), - clock: realClock, + clock: realClock, } return sharedIndexInformer } diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/client_config_test.go b/staging/src/k8s.io/client-go/tools/clientcmd/client_config_test.go index 21a7d32271c..798aa3dd89d 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/client_config_test.go +++ b/staging/src/k8s.io/client-go/tools/clientcmd/client_config_test.go @@ -243,7 +243,7 @@ func TestCertificateData(t *testing.T) { config := clientcmdapi.NewConfig() config.Clusters["clean"] = &clientcmdapi.Cluster{ - Server: "https://localhost:8443", + Server: "https://localhost:8443", CertificateAuthorityData: caData, } config.AuthInfos["clean"] = &clientcmdapi.AuthInfo{ diff --git a/staging/src/k8s.io/client-go/transport/round_trippers_test.go b/staging/src/k8s.io/client-go/transport/round_trippers_test.go index 74d3dc21203..abe5ab53d97 100644 --- a/staging/src/k8s.io/client-go/transport/round_trippers_test.go +++ b/staging/src/k8s.io/client-go/transport/round_trippers_test.go @@ -135,7 +135,7 @@ func TestImpersonationRoundTripper(t *testing.T) { }, }, expected: map[string][]string{ - ImpersonateUserHeader: {"user"}, + ImpersonateUserHeader: {"user"}, ImpersonateUserExtraHeaderPrefix + `Test.example.com%2fthing.thing`: {"A", "a"}, }, }, @@ -219,11 +219,11 @@ func TestAuthProxyRoundTripper(t *testing.T) { username: "user", groups: []string{"groupA", "groupB"}, extra: map[string][]string{ - "one": {"alpha", "bravo"}, + "one": {"alpha", "bravo"}, "example.com/two%20three": {"charlie", "delta"}, }, expectedExtra: map[string][]string{ - "one": {"alpha", "bravo"}, + "one": {"alpha", "bravo"}, "example.com%2ftwo%2520three": {"charlie", "delta"}, }, }, diff --git a/staging/src/k8s.io/client-go/util/cert/cert.go b/staging/src/k8s.io/client-go/util/cert/cert.go index d9fb18e912c..0e160dabd66 100644 --- a/staging/src/k8s.io/client-go/util/cert/cert.go +++ b/staging/src/k8s.io/client-go/util/cert/cert.go @@ -77,7 +77,7 @@ func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, erro NotAfter: now.Add(duration365d * 10).UTC(), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, BasicConstraintsValid: true, - IsCA: true, + IsCA: true, } certDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &tmpl, &tmpl, key.Public(), key) @@ -188,7 +188,7 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, BasicConstraintsValid: true, - IsCA: true, + IsCA: true, } caDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &caTemplate, &caTemplate, &caKey.PublicKey, caKey) diff --git a/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/packages.go b/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/packages.go index 2cc0372f89e..642f9a466ef 100644 --- a/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/packages.go +++ b/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/packages.go @@ -320,9 +320,9 @@ func versionPackage(basePackage string, groupPkgName string, gv clientgentypes.G DefaultGen: generator.DefaultGen{ OptionalName: "interface", }, - outputPackage: packagePath, - imports: generator.NewImportTracker(), - types: typesToGenerate, + outputPackage: packagePath, + imports: generator.NewImportTracker(), + types: typesToGenerate, internalInterfacesPackage: packageForInternalInterfaces(basePackage), }) diff --git a/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go b/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go index 1cd27d5cddd..f80350c5f6a 100644 --- a/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go +++ b/staging/src/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go @@ -63,7 +63,7 @@ func (g *versionInterfaceGenerator) GenerateType(c *generator.Context, t *types. m := map[string]interface{}{ "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "types": g.types, + "types": g.types, } sw.Do(versionTemplate, m) diff --git a/staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go b/staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go index 0718da301b6..6f236e873ab 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go @@ -153,14 +153,14 @@ func (c completedConfig) NewWithDelegate(delegationTarget genericapiserver.Deleg ) s := &APIAggregator{ - GenericAPIServer: genericServer, - delegateHandler: delegationTarget.UnprotectedHandler(), - proxyClientCert: c.ExtraConfig.ProxyClientCert, - proxyClientKey: c.ExtraConfig.ProxyClientKey, - proxyTransport: c.ExtraConfig.ProxyTransport, - proxyHandlers: map[string]*proxyHandler{}, - handledGroups: sets.String{}, - lister: informerFactory.Apiregistration().InternalVersion().APIServices().Lister(), + GenericAPIServer: genericServer, + delegateHandler: delegationTarget.UnprotectedHandler(), + proxyClientCert: c.ExtraConfig.ProxyClientCert, + proxyClientKey: c.ExtraConfig.ProxyClientKey, + proxyTransport: c.ExtraConfig.ProxyTransport, + proxyHandlers: map[string]*proxyHandler{}, + handledGroups: sets.String{}, + lister: informerFactory.Apiregistration().InternalVersion().APIServices().Lister(), APIRegistrationInformers: informerFactory, serviceResolver: c.ExtraConfig.ServiceResolver, } diff --git a/staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go b/staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go index a5ff16f574b..354c8d8b94a 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy_test.go @@ -344,9 +344,9 @@ func TestProxyUpgrade(t *testing.T) { APIService: &apiregistration.APIService{ Spec: apiregistration.APIServiceSpec{ InsecureSkipTLSVerify: true, - Group: "mygroup", - Version: "v1", - Service: &apiregistration.ServiceReference{Name: "invalid-service", Namespace: "invalid-ns"}, + Group: "mygroup", + Version: "v1", + Service: &apiregistration.ServiceReference{Name: "invalid-service", Namespace: "invalid-ns"}, }, Status: apiregistration.APIServiceStatus{ Conditions: []apiregistration.APIServiceCondition{ diff --git a/test/e2e/common/runtime.go b/test/e2e/common/runtime.go index 06030f6d40e..d3fe67cfbca 100644 --- a/test/e2e/common/runtime.go +++ b/test/e2e/common/runtime.go @@ -140,9 +140,9 @@ while true; do sleep 1; done { name: "if TerminationMessagePath is set [NodeConformance]", container: v1.Container{ - Image: framework.BusyBoxImage, - Command: []string{"/bin/sh", "-c"}, - Args: []string{"/bin/echo -n DONE > /dev/termination-log"}, + Image: framework.BusyBoxImage, + Command: []string{"/bin/sh", "-c"}, + Args: []string{"/bin/echo -n DONE > /dev/termination-log"}, TerminationMessagePath: "/dev/termination-log", SecurityContext: &v1.SecurityContext{ RunAsUser: &rootUser, @@ -155,9 +155,9 @@ while true; do sleep 1; done { name: "if TerminationMessagePath is set as non-root user and at a non-default path [NodeConformance]", container: v1.Container{ - Image: framework.BusyBoxImage, - Command: []string{"/bin/sh", "-c"}, - Args: []string{"/bin/echo -n DONE > /dev/termination-custom-log"}, + Image: framework.BusyBoxImage, + Command: []string{"/bin/sh", "-c"}, + Args: []string{"/bin/echo -n DONE > /dev/termination-custom-log"}, TerminationMessagePath: "/dev/termination-custom-log", SecurityContext: &v1.SecurityContext{ RunAsUser: &nonRootUser, @@ -170,9 +170,9 @@ while true; do sleep 1; done { name: "from log output if TerminationMessagePolicy FallbackToLogOnError is set [NodeConformance]", container: v1.Container{ - Image: framework.BusyBoxImage, - Command: []string{"/bin/sh", "-c"}, - Args: []string{"/bin/echo -n DONE; /bin/false"}, + Image: framework.BusyBoxImage, + Command: []string{"/bin/sh", "-c"}, + Args: []string{"/bin/echo -n DONE; /bin/false"}, TerminationMessagePath: "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, }, @@ -183,9 +183,9 @@ while true; do sleep 1; done { name: "as empty when pod succeeds and TerminationMessagePolicy FallbackToLogOnError is set [NodeConformance]", container: v1.Container{ - Image: framework.BusyBoxImage, - Command: []string{"/bin/sh", "-c"}, - Args: []string{"/bin/echo DONE; /bin/true"}, + Image: framework.BusyBoxImage, + Command: []string{"/bin/sh", "-c"}, + Args: []string{"/bin/echo DONE; /bin/true"}, TerminationMessagePath: "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, }, @@ -196,9 +196,9 @@ while true; do sleep 1; done { name: "from file when pod succeeds and TerminationMessagePolicy FallbackToLogOnError is set [NodeConformance]", container: v1.Container{ - Image: framework.BusyBoxImage, - Command: []string{"/bin/sh", "-c"}, - Args: []string{"/bin/echo -n OK > /dev/termination-log; /bin/echo DONE; /bin/true"}, + Image: framework.BusyBoxImage, + Command: []string{"/bin/sh", "-c"}, + Args: []string{"/bin/echo -n OK > /dev/termination-log; /bin/echo DONE; /bin/true"}, TerminationMessagePath: "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, }, diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 839eefa7a5d..495dab8592e 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -262,8 +262,8 @@ func (f *Framework) BeforeEach() { } f.gatherer, err = NewResourceUsageGatherer(f.ClientSet, ResourceGathererOptions{ - InKubemark: ProviderIs("kubemark"), - Nodes: nodeMode, + InKubemark: ProviderIs("kubemark"), + Nodes: nodeMode, ResourceDataGatheringPeriod: 60 * time.Second, ProbeDuration: 15 * time.Second, PrintVerboseLogs: false, diff --git a/test/e2e/framework/resource_usage_gatherer.go b/test/e2e/framework/resource_usage_gatherer.go index d5711e6210e..93aa16a412c 100644 --- a/test/e2e/framework/resource_usage_gatherer.go +++ b/test/e2e/framework/resource_usage_gatherer.go @@ -149,7 +149,7 @@ func (w *resourceGatherWorker) singleProbe() { } for k, v := range kubemarkData { data[k] = &ContainerResourceUsage{ - Name: v.Name, + Name: v.Name, MemoryWorkingSetInBytes: v.MemoryWorkingSetInBytes, CPUUsageInCores: v.CPUUsageInCores, } diff --git a/test/e2e/scheduling/taints_test.go b/test/e2e/scheduling/taints_test.go index 7f582b8f927..a018f736e00 100644 --- a/test/e2e/scheduling/taints_test.go +++ b/test/e2e/scheduling/taints_test.go @@ -52,9 +52,9 @@ func createPodForTaintsTest(hasToleration bool, tolerationSeconds int, podName, if !hasToleration { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: podName, - Namespace: ns, - Labels: map[string]string{"name": podName}, + Name: podName, + Namespace: ns, + Labels: map[string]string{"name": podName}, DeletionGracePeriodSeconds: &grace, }, Spec: v1.PodSpec{ @@ -70,9 +70,9 @@ func createPodForTaintsTest(hasToleration bool, tolerationSeconds int, podName, if tolerationSeconds <= 0 { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: podName, - Namespace: ns, - Labels: map[string]string{"name": podName}, + Name: podName, + Namespace: ns, + Labels: map[string]string{"name": podName}, DeletionGracePeriodSeconds: &grace, // default - tolerate forever }, @@ -90,9 +90,9 @@ func createPodForTaintsTest(hasToleration bool, tolerationSeconds int, podName, ts := int64(tolerationSeconds) return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: podName, - Namespace: ns, - Labels: map[string]string{"name": podName}, + Name: podName, + Namespace: ns, + Labels: map[string]string{"name": podName}, DeletionGracePeriodSeconds: &grace, }, Spec: v1.PodSpec{