From ad7cb45bb24a21d7f391c10985d0af850471f426 Mon Sep 17 00:00:00 2001 From: Nathan Baulch Date: Sun, 11 Aug 2024 09:22:30 +1000 Subject: [PATCH] Fix kubeadm typos --- cmd/kubeadm/app/apis/kubeadm/types.go | 2 +- cmd/kubeadm/app/apis/kubeadm/v1beta3/types.go | 2 +- cmd/kubeadm/app/apis/kubeadm/v1beta4/conversion.go | 2 +- cmd/kubeadm/app/apis/kubeadm/v1beta4/types.go | 2 +- .../app/apis/kubeadm/validation/validation_test.go | 2 +- cmd/kubeadm/app/cmd/config.go | 2 +- cmd/kubeadm/app/cmd/join.go | 4 ++-- cmd/kubeadm/app/cmd/phases/init/bootstraptoken.go | 2 +- cmd/kubeadm/app/cmd/phases/workflow/phase.go | 2 +- cmd/kubeadm/app/cmd/phases/workflow/runner.go | 2 +- cmd/kubeadm/app/cmd/token_test.go | 6 +++--- cmd/kubeadm/app/componentconfigs/fakeconfig_test.go | 4 ++-- cmd/kubeadm/app/componentconfigs/kubelet_test.go | 2 +- .../app/componentconfigs/kubelet_unix_test.go | 2 +- .../app/componentconfigs/kubelet_windows_test.go | 2 +- cmd/kubeadm/app/componentconfigs/kubeproxy_test.go | 2 +- cmd/kubeadm/app/constants/constants.go | 4 ++-- cmd/kubeadm/app/discovery/discovery.go | 4 ++-- .../app/phases/bootstraptoken/node/tlsbootstrap.go | 4 ++-- .../phases/bootstraptoken/node/tlsbootstrap_test.go | 6 +++--- cmd/kubeadm/app/phases/certs/renewal/manager_test.go | 2 +- cmd/kubeadm/app/phases/controlplane/manifests.go | 2 +- .../app/phases/controlplane/manifests_test.go | 2 +- cmd/kubeadm/app/phases/copycerts/copycerts.go | 2 +- cmd/kubeadm/app/phases/upgrade/compute.go | 2 +- cmd/kubeadm/app/phases/upgrade/compute_test.go | 2 +- cmd/kubeadm/app/phases/upgrade/postupgrade.go | 6 +++--- cmd/kubeadm/app/phases/upgrade/staticpods.go | 12 ++++++------ cmd/kubeadm/app/phases/upgrade/staticpods_test.go | 2 +- cmd/kubeadm/app/phases/upgrade/versiongetter.go | 2 +- cmd/kubeadm/app/util/config/common.go | 2 +- cmd/kubeadm/app/util/config/strict/strict.go | 2 +- .../app/util/config/upgradeconfiguration_test.go | 2 +- cmd/kubeadm/app/util/marshal_test.go | 4 ++-- cmd/kubeadm/app/util/pkiutil/pki_helpers.go | 4 ++-- cmd/kubeadm/app/util/users/users_linux.go | 4 ++-- 36 files changed, 55 insertions(+), 55 deletions(-) diff --git a/cmd/kubeadm/app/apis/kubeadm/types.go b/cmd/kubeadm/app/apis/kubeadm/types.go index 7b284925de1..8f2005d2784 100644 --- a/cmd/kubeadm/app/apis/kubeadm/types.go +++ b/cmd/kubeadm/app/apis/kubeadm/types.go @@ -338,7 +338,7 @@ type JoinConfiguration struct { NodeRegistration NodeRegistrationOptions // CACertPath is the path to the SSL certificate authority used to - // secure comunications between node and control-plane. + // secure communications between node and control-plane. // Defaults to "/etc/kubernetes/pki/ca.crt". CACertPath string diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta3/types.go b/cmd/kubeadm/app/apis/kubeadm/v1beta3/types.go index e5ca733d070..f46ce0fdaef 100644 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta3/types.go +++ b/cmd/kubeadm/app/apis/kubeadm/v1beta3/types.go @@ -322,7 +322,7 @@ type JoinConfiguration struct { NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` // CACertPath is the path to the SSL certificate authority used to - // secure comunications between node and control-plane. + // secure communications between node and control-plane. // Defaults to "/etc/kubernetes/pki/ca.crt". // +optional CACertPath string `json:"caCertPath,omitempty"` diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta4/conversion.go b/cmd/kubeadm/app/apis/kubeadm/v1beta4/conversion.go index fa0ef37f3b1..3df3ffa5c9b 100644 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta4/conversion.go +++ b/cmd/kubeadm/app/apis/kubeadm/v1beta4/conversion.go @@ -63,7 +63,7 @@ func Convert_v1beta4_JoinConfiguration_To_kubeadm_JoinConfiguration(in *JoinConf return err } -// Convert_kubeadm_JoinConfiguration_To_v1beta4_JoinConfiguration converts a private JoinConfinguration to a public JoinCOnfiguration. +// Convert_kubeadm_JoinConfiguration_To_v1beta4_JoinConfiguration converts a private JoinConfiguration to a public JoinConfiguration. func Convert_kubeadm_JoinConfiguration_To_v1beta4_JoinConfiguration(in *kubeadm.JoinConfiguration, out *JoinConfiguration, s conversion.Scope) error { err := autoConvert_kubeadm_JoinConfiguration_To_v1beta4_JoinConfiguration(in, out, s) timeoutControlPlane := kubeadm.GetConversionTimeoutControlPlane() // Remove with v1beta3. diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta4/types.go b/cmd/kubeadm/app/apis/kubeadm/v1beta4/types.go index 87c4ce242a7..519b6bf09d8 100644 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta4/types.go +++ b/cmd/kubeadm/app/apis/kubeadm/v1beta4/types.go @@ -371,7 +371,7 @@ type JoinConfiguration struct { NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` // CACertPath is the path to the SSL certificate authority used to - // secure comunications between node and control-plane. + // secure communications between node and control-plane. // Defaults to "/etc/kubernetes/pki/ca.crt". // +optional CACertPath string `json:"caCertPath,omitempty"` diff --git a/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go b/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go index 60c5ebf0586..5782f4a3f5f 100644 --- a/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go +++ b/cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go @@ -1067,7 +1067,7 @@ func TestValidateSocketPath(t *testing.T) { {name: "valid socket URL", criSocket: kubeadmapiv1.DefaultContainerRuntimeURLScheme + "://" + "/some/path", expectedErrors: false}, {name: "unsupported URL scheme", criSocket: "bla:///some/path", expectedErrors: true}, {name: "missing URL scheme", criSocket: "/some/path", expectedErrors: true}, - {name: "unparseable URL", criSocket: ":::", expectedErrors: true}, + {name: "unparsable URL", criSocket: ":::", expectedErrors: true}, {name: "empty CRISocket", criSocket: "", expectedErrors: true}, } for _, tc := range tests { diff --git a/cmd/kubeadm/app/cmd/config.go b/cmd/kubeadm/app/cmd/config.go index dfc6f7e0e6a..3816bdc6546 100644 --- a/cmd/kubeadm/app/cmd/config.go +++ b/cmd/kubeadm/app/cmd/config.go @@ -59,7 +59,7 @@ func newCmdConfig(out io.Writer) *cobra.Command { Long: fmt.Sprintf(dedent.Dedent(` There is a ConfigMap in the %s namespace called %q that kubeadm uses to store internal configuration about the cluster. kubeadm CLI v1.8.0+ automatically creates this ConfigMap with the config used with 'kubeadm init', but if you - initialized your cluster using kubeadm v1.7.x or lower, you must use the 'kubeadm init phase upload-config' command to + initialized your cluster using kubeadm v1.7.x or lower, you must use the 'kubeadm init phase upload-config' command to create this ConfigMap. This is required so that 'kubeadm upgrade' can configure your upgraded cluster correctly. `), metav1.NamespaceSystem, constants.KubeadmConfigConfigMap), // Without this callback, if a user runs just the "upload" diff --git a/cmd/kubeadm/app/cmd/join.go b/cmd/kubeadm/app/cmd/join.go index ae38da06b7f..8e4092b88c8 100644 --- a/cmd/kubeadm/app/cmd/join.go +++ b/cmd/kubeadm/app/cmd/join.go @@ -59,7 +59,7 @@ var ( `) - joinControPlaneDoneTemp = template.Must(template.New("join").Parse(dedent.Dedent(` + joinControlPlaneDoneTemp = template.Must(template.New("join").Parse(dedent.Dedent(` This node has joined the cluster and a new control plane instance was created: * Certificate signing request was sent to apiserver and approval was received. @@ -196,7 +196,7 @@ func newCmdJoin(out io.Writer, joinOptions *joinOptions) *cobra.Command { "KubeConfigPath": kubeadmconstants.GetAdminKubeConfigPath(), "etcdMessage": etcdMessage, } - if err := joinControPlaneDoneTemp.Execute(data.outputWriter, ctx); err != nil { + if err := joinControlPlaneDoneTemp.Execute(data.outputWriter, ctx); err != nil { return err } diff --git a/cmd/kubeadm/app/cmd/phases/init/bootstraptoken.go b/cmd/kubeadm/app/cmd/phases/init/bootstraptoken.go index 34fbd284610..85c3a2fc39c 100644 --- a/cmd/kubeadm/app/cmd/phases/init/bootstraptoken.go +++ b/cmd/kubeadm/app/cmd/phases/init/bootstraptoken.go @@ -88,7 +88,7 @@ func runBootstrapToken(c workflow.RunData) error { return errors.Wrap(err, "error updating or creating token") } // Create RBAC rules that makes the bootstrap tokens able to get nodes - if err := nodebootstraptokenphase.AllowBoostrapTokensToGetNodes(client); err != nil { + if err := nodebootstraptokenphase.AllowBootstrapTokensToGetNodes(client); err != nil { return errors.Wrap(err, "error allowing bootstrap tokens to get Nodes") } // Create RBAC rules that makes the bootstrap tokens able to post CSRs diff --git a/cmd/kubeadm/app/cmd/phases/workflow/phase.go b/cmd/kubeadm/app/cmd/phases/workflow/phase.go index 3c3488e6e39..896748e08b6 100644 --- a/cmd/kubeadm/app/cmd/phases/workflow/phase.go +++ b/cmd/kubeadm/app/cmd/phases/workflow/phase.go @@ -54,7 +54,7 @@ type Phase struct { RunAllSiblings bool // Run defines a function implementing the phase action. - // It is recommended to implent type assertion, e.g. using golang type switch, + // It is recommended to implement type assertion, e.g. using golang type switch, // for validating the RunData type. Run func(data RunData) error diff --git a/cmd/kubeadm/app/cmd/phases/workflow/runner.go b/cmd/kubeadm/app/cmd/phases/workflow/runner.go index c2502632300..07e65f86d5e 100644 --- a/cmd/kubeadm/app/cmd/phases/workflow/runner.go +++ b/cmd/kubeadm/app/cmd/phases/workflow/runner.go @@ -284,7 +284,7 @@ func (e *Runner) Help(cmdUse string) string { }) // prints the list of phases indented by level and formatted using the maxlength - // the list is enclosed in a mardown code block for ensuring better readability in the public web site + // the list is enclosed in a markdown code block for ensuring better readability in the public web site line := fmt.Sprintf("The %q command executes the following phases:\n", cmdUse) line += "```\n" offset := 2 diff --git a/cmd/kubeadm/app/cmd/token_test.go b/cmd/kubeadm/app/cmd/token_test.go index 23eb2c8c98f..96c9abf8475 100644 --- a/cmd/kubeadm/app/cmd/token_test.go +++ b/cmd/kubeadm/app/cmd/token_test.go @@ -271,12 +271,12 @@ func TestGetClientSet(t *testing.T) { defer os.RemoveAll(tmpDir) fullPath := filepath.Join(tmpDir, testConfigTokenFile) - // test dryRun = false on a non-exisiting file + // test dryRun = false on a non-existing file if _, err = cmdutil.GetClientSet(fullPath, false); err == nil { t.Errorf("GetClientSet(); dry-run: false; did no fail for test file %q: %v", fullPath, err) } - // test dryRun = true on a non-exisiting file + // test dryRun = true on a non-existing file if _, err = cmdutil.GetClientSet(fullPath, true); err == nil { t.Errorf("GetClientSet(); dry-run: true; did no fail for test file %q: %v", fullPath, err) } @@ -291,7 +291,7 @@ func TestGetClientSet(t *testing.T) { t.Errorf("Unable to write test file %q: %v", fullPath, err) } - // test dryRun = true on an exisiting file + // test dryRun = true on an existing file if _, err = cmdutil.GetClientSet(fullPath, true); err != nil { t.Errorf("GetClientSet(); dry-run: true; failed for test file %q: %v", fullPath, err) } diff --git a/cmd/kubeadm/app/componentconfigs/fakeconfig_test.go b/cmd/kubeadm/app/componentconfigs/fakeconfig_test.go index 3af5e949f48..1c1ac7301a4 100644 --- a/cmd/kubeadm/app/componentconfigs/fakeconfig_test.go +++ b/cmd/kubeadm/app/componentconfigs/fakeconfig_test.go @@ -279,7 +279,7 @@ func TestConfigBaseMarshal(t *testing.T) { `, kubeadmapiv1.SchemeGroupVersion.String()))) if expected != got { - t.Fatalf("Missmatch between expected and got:\nExpected:\n%s\n---\nGot:\n%s", expected, got) + t.Fatalf("Mismatch between expected and got:\nExpected:\n%s\n---\nGot:\n%s", expected, got) } }) } @@ -332,7 +332,7 @@ func TestGeneratedConfigFromCluster(t *testing.T) { hash: testYAMLHash, }, { - name: "Missmatching hash means user supplied config", + name: "Mismatching hash means user supplied config", hash: mismatchHash, userSupplied: true, }, diff --git a/cmd/kubeadm/app/componentconfigs/kubelet_test.go b/cmd/kubeadm/app/componentconfigs/kubelet_test.go index 04ed7156805..06d357a9b31 100644 --- a/cmd/kubeadm/app/componentconfigs/kubelet_test.go +++ b/cmd/kubeadm/app/componentconfigs/kubelet_test.go @@ -230,7 +230,7 @@ func TestKubeletDefault(t *testing.T) { got.Default(&test.clusterCfg, &kubeadmapi.APIEndpoint{}, &kubeadmapi.NodeRegistrationOptions{}) if !reflect.DeepEqual(got, &expected) { - t.Fatalf("Missmatch between expected and got:\nExpected:\n%v\n---\nGot:\n%v", expected, *got) + t.Fatalf("Mismatch between expected and got:\nExpected:\n%v\n---\nGot:\n%v", expected, *got) } }) } diff --git a/cmd/kubeadm/app/componentconfigs/kubelet_unix_test.go b/cmd/kubeadm/app/componentconfigs/kubelet_unix_test.go index 726e9f3d509..c706bb8c534 100644 --- a/cmd/kubeadm/app/componentconfigs/kubelet_unix_test.go +++ b/cmd/kubeadm/app/componentconfigs/kubelet_unix_test.go @@ -75,7 +75,7 @@ func TestMutateResolverConfig(t *testing.T) { t.Fatalf("failed to mutate ResolverConfig for KubeletConfiguration, %v", err) } if !reflect.DeepEqual(test.cfg, test.expected) { - t.Errorf("Missmatch between expected and got:\nExpected:\n%+v\n---\nGot:\n%+v", + t.Errorf("Mismatch between expected and got:\nExpected:\n%+v\n---\nGot:\n%+v", test.expected, test.cfg) } }) diff --git a/cmd/kubeadm/app/componentconfigs/kubelet_windows_test.go b/cmd/kubeadm/app/componentconfigs/kubelet_windows_test.go index 1973eff5c02..ea6c45c4641 100644 --- a/cmd/kubeadm/app/componentconfigs/kubelet_windows_test.go +++ b/cmd/kubeadm/app/componentconfigs/kubelet_windows_test.go @@ -85,7 +85,7 @@ func TestMutatePaths(t *testing.T) { t.Run(test.name, func(t *testing.T) { mutatePaths(test.cfg, drive) if !reflect.DeepEqual(test.cfg, test.expected) { - t.Errorf("Missmatch between expected and got:\nExpected:\n%+v\n---\nGot:\n%+v", + t.Errorf("Mismatch between expected and got:\nExpected:\n%+v\n---\nGot:\n%+v", test.expected, test.cfg) } }) diff --git a/cmd/kubeadm/app/componentconfigs/kubeproxy_test.go b/cmd/kubeadm/app/componentconfigs/kubeproxy_test.go index a716505aea5..bc4969c5da0 100644 --- a/cmd/kubeadm/app/componentconfigs/kubeproxy_test.go +++ b/cmd/kubeadm/app/componentconfigs/kubeproxy_test.go @@ -118,7 +118,7 @@ func TestKubeProxyDefault(t *testing.T) { } got.Default(&test.clusterCfg, &test.endpoint, &kubeadmapi.NodeRegistrationOptions{}) if !reflect.DeepEqual(got, &expected) { - t.Fatalf("Missmatch between expected and got:\nExpected:\n%v\n---\nGot:\n%v", expected, got) + t.Fatalf("Mismatch between expected and got:\nExpected:\n%v\n---\nGot:\n%v", expected, got) } }) } diff --git a/cmd/kubeadm/app/constants/constants.go b/cmd/kubeadm/app/constants/constants.go index 32b5451e15a..9bcf8fa470f 100644 --- a/cmd/kubeadm/app/constants/constants.go +++ b/cmd/kubeadm/app/constants/constants.go @@ -195,7 +195,7 @@ const ( // KubeletBaseConfigMapRole defines the base kubelet configuration ConfigMap. KubeletBaseConfigMapRole = "kubeadm:kubelet-config" - // KubeProxyClusterRoleBindingName sets the name for the kube-proxy CluterRoleBinding + // KubeProxyClusterRoleBindingName sets the name for the kube-proxy ClusterRoleBinding KubeProxyClusterRoleBindingName = "kubeadm:node-proxier" // NodeKubeletBootstrap defines the name of the ClusterRoleBinding that lets kubelets post CSRs NodeKubeletBootstrap = "kubeadm:kubelet-bootstrap" @@ -236,7 +236,7 @@ const ( // KubeletHealthCheckTimeout specifies the default kubelet timeout KubeletHealthCheckTimeout = 4 * time.Minute - // UpgradeManifestsTimeout specifies the default timeout for upgradring static Pod manifests + // UpgradeManifestsTimeout specifies the default timeout for upgrading static Pod manifests UpgradeManifestsTimeout = 5 * time.Minute // PullImageRetry specifies how many times ContainerRuntime retries when pulling image failed diff --git a/cmd/kubeadm/app/discovery/discovery.go b/cmd/kubeadm/app/discovery/discovery.go index 3920fb9e70d..c22f68ff46c 100644 --- a/cmd/kubeadm/app/discovery/discovery.go +++ b/cmd/kubeadm/app/discovery/discovery.go @@ -61,13 +61,13 @@ func For(cfg *kubeadmapi.JoinConfiguration) (*clientcmdapi.Config, error) { ), nil } - // if the config returned from discovery has authentication credentials, proceed with the TLS boostrap process + // if the config returned from discovery has authentication credentials, proceed with the TLS bootstrap process if kubeconfigutil.HasAuthenticationCredentials(config) { return config, nil } // if there are no authentication credentials (nor in the config returned from discovery, nor in the TLSBootstrapToken), fail - return nil, errors.New("couldn't find authentication credentials for the TLS boostrap process. Please use Token discovery, a discovery file with embedded authentication credentials or a discovery file without authentication credentials but with the TLSBootstrapToken flag") + return nil, errors.New("couldn't find authentication credentials for the TLS bootstrap process. Please use Token discovery, a discovery file with embedded authentication credentials or a discovery file without authentication credentials but with the TLSBootstrapToken flag") } // DiscoverValidatedKubeConfig returns a validated Config object that specifies where the cluster is and the CA cert to trust diff --git a/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go b/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go index a01cd3fbf17..c3e9d4d4a3b 100644 --- a/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go +++ b/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go @@ -49,8 +49,8 @@ func AllowBootstrapTokensToPostCSRs(client clientset.Interface) error { }) } -// AllowBoostrapTokensToGetNodes creates RBAC rules to allow Node Bootstrap Tokens to list nodes -func AllowBoostrapTokensToGetNodes(client clientset.Interface) error { +// AllowBootstrapTokensToGetNodes creates RBAC rules to allow Node Bootstrap Tokens to list nodes +func AllowBootstrapTokensToGetNodes(client clientset.Interface) error { fmt.Println("[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes") if err := apiclient.CreateOrUpdateClusterRole(client, &rbac.ClusterRole{ diff --git a/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap_test.go b/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap_test.go index 6574d61e554..6efecabbfde 100644 --- a/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap_test.go +++ b/cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap_test.go @@ -198,7 +198,7 @@ func TestAutoApproveNodeCertificateRotation(t *testing.T) { } } -func TestAllowBoostrapTokensToGetNodes(t *testing.T) { +func TestAllowBootstrapTokensToGetNodes(t *testing.T) { tests := []struct { name string client clientset.Interface @@ -270,8 +270,8 @@ func TestAllowBoostrapTokensToGetNodes(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if err := AllowBoostrapTokensToGetNodes(tt.client); err != nil { - t.Errorf("AllowBoostrapTokensToGetNodes() return error = %v", err) + if err := AllowBootstrapTokensToGetNodes(tt.client); err != nil { + t.Errorf("AllowBootstrapTokensToGetNodes() return error = %v", err) } }) } diff --git a/cmd/kubeadm/app/phases/certs/renewal/manager_test.go b/cmd/kubeadm/app/phases/certs/renewal/manager_test.go index 780e4c2a572..6c971a1fa9f 100644 --- a/cmd/kubeadm/app/phases/certs/renewal/manager_test.go +++ b/cmd/kubeadm/app/phases/certs/renewal/manager_test.go @@ -184,7 +184,7 @@ func TestRenewUsingLocalCA(t *testing.T) { } if !newCert.NotAfter.After(cert.NotAfter) { - t.Fatalf("expected new certificate with updated expiration, but renewed certificate has same NotAfter value: saw %s, expected greather than %s", newCert.NotAfter, cert.NotAfter) + t.Fatalf("expected new certificate with updated expiration, but renewed certificate has same NotAfter value: saw %s, expected greater than %s", newCert.NotAfter, cert.NotAfter) } certtestutil.AssertCertificateIsSignedByCa(t, newCert, testCACert) diff --git a/cmd/kubeadm/app/phases/controlplane/manifests.go b/cmd/kubeadm/app/phases/controlplane/manifests.go index 2c2b7f8b35e..70e876189f7 100644 --- a/cmd/kubeadm/app/phases/controlplane/manifests.go +++ b/cmd/kubeadm/app/phases/controlplane/manifests.go @@ -179,7 +179,7 @@ func getAPIServerCommand(cfg *kubeadmapi.ClusterConfiguration, localAPIEndpoint {Name: "secure-port", Value: fmt.Sprintf("%d", localAPIEndpoint.BindPort)}, {Name: "allow-privileged", Value: "true"}, {Name: "kubelet-preferred-address-types", Value: "InternalIP,ExternalIP,Hostname"}, - // add options to configure the front proxy. Without the generated client cert, this will never be useable + // add options to configure the front proxy. Without the generated client cert, this will never be usable // so add it unconditionally with recommended values {Name: "requestheader-username-headers", Value: "X-Remote-User"}, {Name: "requestheader-group-headers", Value: "X-Remote-Group"}, diff --git a/cmd/kubeadm/app/phases/controlplane/manifests_test.go b/cmd/kubeadm/app/phases/controlplane/manifests_test.go index b1516f179d0..fd7a90a353f 100644 --- a/cmd/kubeadm/app/phases/controlplane/manifests_test.go +++ b/cmd/kubeadm/app/phases/controlplane/manifests_test.go @@ -636,7 +636,7 @@ func errorDiffArguments(t *testing.T, name string, actual, expected []string) { } // removeCommon removes common items from left list -// makes compairing two cmdline (with lots of arguments) easier +// makes comparing two cmdline (with lots of arguments) easier func removeCommon(left, right []string) []string { origSet := sets.New(left...) origSet.Delete(right...) diff --git a/cmd/kubeadm/app/phases/copycerts/copycerts.go b/cmd/kubeadm/app/phases/copycerts/copycerts.go index 7c20fe784a5..866677c06e1 100644 --- a/cmd/kubeadm/app/phases/copycerts/copycerts.go +++ b/cmd/kubeadm/app/phases/copycerts/copycerts.go @@ -85,7 +85,7 @@ func CreateCertificateKey() (string, error) { return hex.EncodeToString(randBytes), nil } -// UploadCerts save certs needs to join a new control-plane on kubeadm-certs sercret. +// UploadCerts save certs needs to join a new control-plane on kubeadm-certs secret. func UploadCerts(client clientset.Interface, cfg *kubeadmapi.InitConfiguration, key string) error { fmt.Printf("[upload-certs] Storing the certificates in Secret %q in the %q Namespace\n", kubeadmconstants.KubeadmCertsSecret, metav1.NamespaceSystem) decodedKey, err := hex.DecodeString(key) diff --git a/cmd/kubeadm/app/phases/upgrade/compute.go b/cmd/kubeadm/app/phases/upgrade/compute.go index 2c6eabb8d36..3463b259d7e 100644 --- a/cmd/kubeadm/app/phases/upgrade/compute.go +++ b/cmd/kubeadm/app/phases/upgrade/compute.go @@ -94,7 +94,7 @@ func GetAvailableUpgrades(versionGetterImpl VersionGetter, experimentalUpgradesA " nodes to the same version of Kubernetes", strings.Join(verMsg, ", ")) } - // Get the lastest cluster version + // Get the latest cluster version clusterVersion, err := getLatestClusterVersion(kubeAPIServerVersions) if err != nil { return upgrades, err diff --git a/cmd/kubeadm/app/phases/upgrade/compute_test.go b/cmd/kubeadm/app/phases/upgrade/compute_test.go index 6007585adfd..2a372028ce5 100644 --- a/cmd/kubeadm/app/phases/upgrade/compute_test.go +++ b/cmd/kubeadm/app/phases/upgrade/compute_test.go @@ -127,7 +127,7 @@ const fakeCurrentCoreDNSVersion = "1.0.6" func TestGetAvailableUpgrades(t *testing.T) { - // constansts for test cases + // constants for test cases // variables are in the form v{MAJOR}{MINOR}{PATCH}, where MINOR is a variable so test are automatically uptodate to the latest MinimumControlPlaneVersion/ // v1.X series, e.g. v1.14 diff --git a/cmd/kubeadm/app/phases/upgrade/postupgrade.go b/cmd/kubeadm/app/phases/upgrade/postupgrade.go index f6cb20d8e70..0e5710924df 100644 --- a/cmd/kubeadm/app/phases/upgrade/postupgrade.go +++ b/cmd/kubeadm/app/phases/upgrade/postupgrade.go @@ -78,7 +78,7 @@ func PerformPostUpgradeTasks(client clientset.Interface, cfg *kubeadmapi.InitCon } // Create RBAC rules that makes the bootstrap tokens able to get nodes - if err := nodebootstraptoken.AllowBoostrapTokensToGetNodes(client); err != nil { + if err := nodebootstraptoken.AllowBootstrapTokensToGetNodes(client); err != nil { errs = append(errs, err) } @@ -186,7 +186,7 @@ func PerformAddonsUpgrade(client clientset.Interface, cfg *kubeadmapi.InitConfig return errorsutil.NewAggregate(errs) } -// unupgradedControlPlaneInstances returns a list of control palne instances that have not yet been upgraded. +// unupgradedControlPlaneInstances returns a list of control plane instances that have not yet been upgraded. // // NB. This function can only be called after the current control plane instance has been upgraded already. // Because it determines whether the other control plane instances have been upgraded by checking whether @@ -325,7 +325,7 @@ func UpdateKubeletLocalMode(cfg *kubeadmapi.InitConfiguration, dryRun bool) erro return err } - // Skip changing kubeconfig file if Server does not match the ControlPlaneEndoint. + // Skip changing kubeconfig file if Server does not match the ControlPlaneEndpoint. if config.Clusters[configContext.Cluster].Server != controlPlaneAPIEndpoint || controlPlaneAPIEndpoint == localAPIEndpoint { klog.V(2).Infof("Skipping update of the Server URL in %s, because it's already not equal to %q or already matches the localAPIEndpoint", kubeletKubeConfigFilePath, cfg.ControlPlaneEndpoint) return nil diff --git a/cmd/kubeadm/app/phases/upgrade/staticpods.go b/cmd/kubeadm/app/phases/upgrade/staticpods.go index 851732ace99..da3a1cd1540 100644 --- a/cmd/kubeadm/app/phases/upgrade/staticpods.go +++ b/cmd/kubeadm/app/phases/upgrade/staticpods.go @@ -60,11 +60,11 @@ type StaticPodPathManager interface { TempManifestPath(component string) string // TempManifestDir should point to the temporary directory created for generating new manifests for the upgrade TempManifestDir() string - // BackupManifestPath gets the file path for the component in the backup directory used for backuping manifests during the transition + // BackupManifestPath gets the file path for the component in the backup directory used for backing up manifests during the transition BackupManifestPath(component string) string - // BackupManifestDir should point to the backup directory used for backuping manifests during the transition + // BackupManifestDir should point to the backup directory used for backing up manifests during the transition BackupManifestDir() string - // BackupEtcdDir should point to the backup directory used for backuping manifests during the transition + // BackupEtcdDir should point to the backup directory used for backing up manifests during the transition BackupEtcdDir() string // CleanupDirs cleans up all temporary directories CleanupDirs() error @@ -151,17 +151,17 @@ func (spm *KubeStaticPodPathManager) TempManifestDir() string { return spm.tempManifestDir } -// BackupManifestPath gets the file path for the component in the backup directory used for backuping manifests during the transition +// BackupManifestPath gets the file path for the component in the backup directory used for backing up manifests during the transition func (spm *KubeStaticPodPathManager) BackupManifestPath(component string) string { return constants.GetStaticPodFilepath(component, spm.backupManifestDir) } -// BackupManifestDir should point to the backup directory used for backuping manifests during the transition +// BackupManifestDir should point to the backup directory used for backing up manifests during the transition func (spm *KubeStaticPodPathManager) BackupManifestDir() string { return spm.backupManifestDir } -// BackupEtcdDir should point to the backup directory used for backuping manifests during the transition +// BackupEtcdDir should point to the backup directory used for backing up manifests during the transition func (spm *KubeStaticPodPathManager) BackupEtcdDir() string { return spm.backupEtcdDir } diff --git a/cmd/kubeadm/app/phases/upgrade/staticpods_test.go b/cmd/kubeadm/app/phases/upgrade/staticpods_test.go index 2dd4ab74498..ae524135658 100644 --- a/cmd/kubeadm/app/phases/upgrade/staticpods_test.go +++ b/cmd/kubeadm/app/phases/upgrade/staticpods_test.go @@ -792,7 +792,7 @@ func TestRenewCertsByComponent(t *testing.T) { t.Run(test.name, func(t *testing.T) { pkiutiltesting.Reset() - // Setup up basic requities + // Setup up basic requisites tmpDir := testutil.SetupTempDir(t) defer os.RemoveAll(tmpDir) diff --git a/cmd/kubeadm/app/phases/upgrade/versiongetter.go b/cmd/kubeadm/app/phases/upgrade/versiongetter.go index 836eed06139..fe4e9582940 100644 --- a/cmd/kubeadm/app/phases/upgrade/versiongetter.go +++ b/cmd/kubeadm/app/phases/upgrade/versiongetter.go @@ -72,7 +72,7 @@ func (g *KubeVersionGetter) ClusterVersion() (string, *versionutil.Version, erro // common.go#getClient() // The problem here is that during upgrade dry-run client reactors are backed by a dynamic client // via NewClientBackedDryRunGetterFromKubeconfig() and for GetActions there seems to be no analog to - // Discovery().Serverversion() resource for a dynamic client(?). + // Discovery().ServerVersion() resource for a dynamic client(?). fakeclientDiscovery, ok := g.client.Discovery().(*fakediscovery.FakeDiscovery) if ok { clusterVersionInfo = fakeclientDiscovery.FakedServerVersion diff --git a/cmd/kubeadm/app/util/config/common.go b/cmd/kubeadm/app/util/config/common.go index f417a39fba1..1e78452058d 100644 --- a/cmd/kubeadm/app/util/config/common.go +++ b/cmd/kubeadm/app/util/config/common.go @@ -110,7 +110,7 @@ func validateSupportedVersion(gvk schema.GroupVersionKind, allowDeprecated, allo // NormalizeKubernetesVersion resolves version labels, sets alternative // image registry if requested for CI builds, and validates minimal -// version that kubeadm SetInitDynamicDefaultssupports. +// version that kubeadm SetInitDynamicDefaults supports. func NormalizeKubernetesVersion(cfg *kubeadmapi.ClusterConfiguration) error { isCIVersion := kubeadmutil.KubernetesIsCIVersion(cfg.KubernetesVersion) diff --git a/cmd/kubeadm/app/util/config/strict/strict.go b/cmd/kubeadm/app/util/config/strict/strict.go index b82e7a98ff2..28c730e2dac 100644 --- a/cmd/kubeadm/app/util/config/strict/strict.go +++ b/cmd/kubeadm/app/util/config/strict/strict.go @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer/json" ) -// VerifyUnmarshalStrict takes a slice of schems, a JSON/YAML byte slice and a GroupVersionKind +// VerifyUnmarshalStrict takes a slice of schemes, a JSON/YAML byte slice and a GroupVersionKind // and verifies if the schema is known and if the byte slice unmarshals with strict mode. func VerifyUnmarshalStrict(schemes []*runtime.Scheme, gvk schema.GroupVersionKind, bytes []byte) error { var scheme *runtime.Scheme diff --git a/cmd/kubeadm/app/util/config/upgradeconfiguration_test.go b/cmd/kubeadm/app/util/config/upgradeconfiguration_test.go index 17e2fe25d7d..6c38218e429 100644 --- a/cmd/kubeadm/app/util/config/upgradeconfiguration_test.go +++ b/cmd/kubeadm/app/util/config/upgradeconfiguration_test.go @@ -104,7 +104,7 @@ func TestDocMapToUpgradeConfiguration(t *testing.T) { } docmap, err := kubeadmutil.SplitYAMLDocuments(b) if err != nil { - t.Fatalf("Unexpect error of SplitYAMLDocuments: %v", err) + t.Fatalf("Unexpected error of SplitYAMLDocuments: %v", err) } cfg, err := DocMapToUpgradeConfiguration(docmap) if err != nil { diff --git a/cmd/kubeadm/app/util/marshal_test.go b/cmd/kubeadm/app/util/marshal_test.go index a477a4b6ae0..4814fc6292d 100644 --- a/cmd/kubeadm/app/util/marshal_test.go +++ b/cmd/kubeadm/app/util/marshal_test.go @@ -439,14 +439,14 @@ func TestGroupVersionKindsHasClusterConfiguration(t *testing.T) { expected bool }{ { - name: "does not have ClusterConfiguraiton", + name: "does not have ClusterConfiguration", gvks: []schema.GroupVersionKind{ {Group: "foo.k8s.io", Version: "v1", Kind: "Foo"}, }, expected: false, }, { - name: "has ClusterConfiguraiton", + name: "has ClusterConfiguration", gvks: []schema.GroupVersionKind{ {Group: "foo.k8s.io", Version: "v1", Kind: "Foo"}, {Group: "foo.k8s.io", Version: "v1", Kind: "ClusterConfiguration"}, diff --git a/cmd/kubeadm/app/util/pkiutil/pki_helpers.go b/cmd/kubeadm/app/util/pkiutil/pki_helpers.go index 3113bfff861..4c3bfb9a1f9 100644 --- a/cmd/kubeadm/app/util/pkiutil/pki_helpers.go +++ b/cmd/kubeadm/app/util/pkiutil/pki_helpers.go @@ -517,7 +517,7 @@ func NewCSR(cfg CertConfig, key crypto.Signer) (*x509.CertificateRequest, error) return x509.ParseCertificateRequest(csrBytes) } -// EncodeCertPEM returns PEM-endcoded certificate data +// EncodeCertPEM returns PEM-encoded certificate data func EncodeCertPEM(cert *x509.Certificate) []byte { block := pem.Block{ Type: CertificateBlockType, @@ -526,7 +526,7 @@ func EncodeCertPEM(cert *x509.Certificate) []byte { return pem.EncodeToMemory(&block) } -// EncodeCertBundlePEM returns PEM-endcoded certificate bundle +// EncodeCertBundlePEM returns PEM-encoded certificate bundle func EncodeCertBundlePEM(certs []*x509.Certificate) ([]byte, error) { buf := bytes.Buffer{} diff --git a/cmd/kubeadm/app/util/users/users_linux.go b/cmd/kubeadm/app/util/users/users_linux.go index 7d1e2f79514..9683544f6f4 100644 --- a/cmd/kubeadm/app/util/users/users_linux.go +++ b/cmd/kubeadm/app/util/users/users_linux.go @@ -53,7 +53,7 @@ type UsersAndGroups struct { } // entry is a structure that holds information about a UNIX user or group. -// It partialially conforms parsing of both users from /etc/passwd and groups from /etc/group. +// It partially conforms parsing of both users from /etc/passwd and groups from /etc/group. type entry struct { name string id int64 @@ -568,7 +568,7 @@ func entriesToString(entries []*entry) string { return strings.Join(lines, ",") } -// openFileWithLock opens the file at path by acquiring an exclive write lock. +// openFileWithLock opens the file at path by acquiring an exclusive write lock. // The returned close() function should be called to release the lock and close the file. // If a lock cannot be obtained the function fails after a period of time. func openFileWithLock(path string) (f *os.File, close func(), err error) {