diff --git a/cmd/kubeadm/app/cmd/config.go b/cmd/kubeadm/app/cmd/config.go index c9f7fa01f17..00684a884a2 100644 --- a/cmd/kubeadm/app/cmd/config.go +++ b/cmd/kubeadm/app/cmd/config.go @@ -65,7 +65,7 @@ func NewCmdConfig(out io.Writer) *cobra.Command { return cmd } -// NewCmdConfigUpload returs cobra.Command for "kubeadm config upload" command +// NewCmdConfigUpload returns cobra.Command for "kubeadm config upload" command func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command { cmd := &cobra.Command{ Use: "upload", @@ -78,7 +78,7 @@ func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command { return cmd } -// NewCmdConfigView returs cobra.Command for "kubeadm config view" command +// NewCmdConfigView returns cobra.Command for "kubeadm config view" command func NewCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command { return &cobra.Command{ Use: "view", @@ -98,7 +98,7 @@ func NewCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command { } } -// NewCmdConfigUploadFromFile verifies given kubernetes config file and returs cobra.Command for +// NewCmdConfigUploadFromFile verifies given kubernetes config file and returns cobra.Command for // "kubeadm config upload from-file" command func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Command { var cfgPath string @@ -131,7 +131,7 @@ func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Co return cmd } -// NewCmdConfigUploadFromFlags returs cobra.Command for "kubeadm config upload from-flags" command +// NewCmdConfigUploadFromFlags returns cobra.Command for "kubeadm config upload from-flags" command func NewCmdConfigUploadFromFlags(out io.Writer, kubeConfigFile *string) *cobra.Command { cfg := &kubeadmapiext.MasterConfiguration{} legacyscheme.Scheme.Default(cfg) diff --git a/cmd/kubeadm/app/cmd/phases/certs.go b/cmd/kubeadm/app/cmd/phases/certs.go index 6f37c6d20dd..3c87983ad2b 100644 --- a/cmd/kubeadm/app/cmd/phases/certs.go +++ b/cmd/kubeadm/app/cmd/phases/certs.go @@ -206,7 +206,7 @@ func getCertsSubCommands(defaultKubernetesVersion string) []*cobra.Command { // runCmdFunc creates a cobra.Command Run function, by composing the call to the given cmdFunc with necessary additional steps (e.g preparation of input parameters) func runCmdFunc(cmdFunc func(cfg *kubeadmapi.MasterConfiguration) error, cfgPath *string, cfg *kubeadmapiext.MasterConfiguration) func(cmd *cobra.Command, args []string) { - // the following statement build a clousure that wraps a call to a cmdFunc, binding + // the following statement build a closure that wraps a call to a cmdFunc, binding // the function itself with the specific parameters of each sub command. // Please note that specific parameter should be passed as value, while other parameters - passed as reference - // are shared between sub commands and gets access to current value e.g. flags value. diff --git a/cmd/kubeadm/app/cmd/phases/controlplane.go b/cmd/kubeadm/app/cmd/phases/controlplane.go index 183c13981a8..726294990a5 100644 --- a/cmd/kubeadm/app/cmd/phases/controlplane.go +++ b/cmd/kubeadm/app/cmd/phases/controlplane.go @@ -82,7 +82,7 @@ func getControlPlaneSubCommands(outDir, defaultKubernetesVersion string) []*cobr // This is used for unit testing only... // If we wouldn't set this to something, the code would dynamically look up the version from the internet - // By setting this explicitely for tests workarounds that + // By setting this explicitly for tests workarounds that if defaultKubernetesVersion != "" { cfg.KubernetesVersion = defaultKubernetesVersion } @@ -164,7 +164,7 @@ func getControlPlaneSubCommands(outDir, defaultKubernetesVersion string) []*cobr // runCmdControlPlane creates a cobra.Command Run function, by composing the call to the given cmdFunc with necessary additional steps (e.g preparation of input parameters) func runCmdControlPlane(cmdFunc func(outDir string, cfg *kubeadmapi.MasterConfiguration) error, outDir, cfgPath *string, featureGatesString *string, cfg *kubeadmapiext.MasterConfiguration) func(cmd *cobra.Command, args []string) { - // the following statement build a clousure that wraps a call to a cmdFunc, binding + // the following statement build a closure that wraps a call to a cmdFunc, binding // the function itself with the specific parameters of each sub command. // Please note that specific parameter should be passed as value, while other parameters - passed as reference - // are shared between sub commands and gets access to current value e.g. flags value. diff --git a/cmd/kubeadm/app/cmd/phases/kubeconfig_test.go b/cmd/kubeadm/app/cmd/phases/kubeconfig_test.go index d3a4d93b0c0..089147ada70 100644 --- a/cmd/kubeadm/app/cmd/phases/kubeconfig_test.go +++ b/cmd/kubeadm/app/cmd/phases/kubeconfig_test.go @@ -170,10 +170,10 @@ func TestKubeConfigSubCommandsThatCreateFilesWithFlags(t *testing.T) { outputdir := tmpdir - // Retrives ca cert for assertions + // Retrieves ca cert for assertions caCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(pkidir, kubeadmconstants.CACertAndKeyBaseName) if err != nil { - t.Fatalf("couldn't retrive ca cert: %v", err) + t.Fatalf("couldn't retrieve ca cert: %v", err) } // Get subcommands working in the temporary directory @@ -272,10 +272,10 @@ func TestKubeConfigSubCommandsThatCreateFilesWithConfigFile(t *testing.T) { // Adds a pki folder with a ca certs to the temp folder pkidir := testutil.SetupPkiDirWithCertificateAuthorithy(t, tmpdir) - // Retrives ca cert for assertions + // Retrieves ca cert for assertions caCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(pkidir, kubeadmconstants.CACertAndKeyBaseName) if err != nil { - t.Fatalf("couldn't retrive ca cert: %v", err) + t.Fatalf("couldn't retrieve ca cert: %v", err) } // Adds a master configuration file @@ -327,10 +327,10 @@ func TestKubeConfigSubCommandsThatWritesToOut(t *testing.T) { outputdir := tmpdir - // Retrives ca cert for assertions + // Retrieves ca cert for assertions caCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(pkidir, kubeadmconstants.CACertAndKeyBaseName) if err != nil { - t.Fatalf("couldn't retrive ca cert: %v", err) + t.Fatalf("couldn't retrieve ca cert: %v", err) } commonFlags := []string{ diff --git a/cmd/kubeadm/app/cmd/phases/util.go b/cmd/kubeadm/app/cmd/phases/util.go index 32b7f3fb1d4..92be3a187c3 100644 --- a/cmd/kubeadm/app/cmd/phases/util.go +++ b/cmd/kubeadm/app/cmd/phases/util.go @@ -29,7 +29,7 @@ import ( // runCmdPhase creates a cobra.Command Run function, by composing the call to the given cmdFunc with necessary additional steps (e.g preparation of input parameters) func runCmdPhase(cmdFunc func(outDir string, cfg *kubeadmapi.MasterConfiguration) error, outDir, cfgPath *string, cfg *kubeadmapiext.MasterConfiguration) func(cmd *cobra.Command, args []string) { - // the following statement build a clousure that wraps a call to a cmdFunc, binding + // the following statement build a closure that wraps a call to a cmdFunc, binding // the function itself with the specific parameters of each sub command. // Please note that specific parameter should be passed as value, while other parameters - passed as reference - // are shared between sub commands and gets access to current value e.g. flags value. diff --git a/cmd/kubeadm/app/discovery/file/file.go b/cmd/kubeadm/app/discovery/file/file.go index 5dc0188e37c..60d3d48d08b 100644 --- a/cmd/kubeadm/app/discovery/file/file.go +++ b/cmd/kubeadm/app/discovery/file/file.go @@ -75,7 +75,7 @@ func ValidateClusterInfo(clusterinfo *clientcmdapi.Config) (*clientcmdapi.Cluste clusterinfoCM, err = client.CoreV1().ConfigMaps(metav1.NamespacePublic).Get(bootstrapapi.ConfigMapClusterInfo, metav1.GetOptions{}) if err != nil { if apierrors.IsForbidden(err) { - // If the request is unauthorized, the cluster admin has not granted access to the cluster info configmap for unauthenicated users + // If the request is unauthorized, the cluster admin has not granted access to the cluster info configmap for unauthenticated users // In that case, trust the cluster admin and do not refresh the cluster-info credentials fmt.Printf("[discovery] Could not access the %s ConfigMap for refreshing the cluster-info information, but the TLS cert is valid so proceeding...\n", bootstrapapi.ConfigMapClusterInfo) return true, nil diff --git a/cmd/kubeadm/app/features/features_test.go b/cmd/kubeadm/app/features/features_test.go index 6d24ad9c4fa..1d64da4046e 100644 --- a/cmd/kubeadm/app/features/features_test.go +++ b/cmd/kubeadm/app/features/features_test.go @@ -46,7 +46,7 @@ func TestKnownFeatures(t *testing.T) { if r[1] != f2 { t.Errorf("KnownFeatures returned %s values, expected %s", r[1], f2) } - // check the second value is feature3; prerelease should not shown fo GA features; default should be present + // check the second value is feature3; prerelease should not be shown for GA features; default should be present f3 := "feature3=true|false (default=false)" if r[2] != f3 { t.Errorf("KnownFeatures returned %s values, expected %s", r[2], f3) diff --git a/cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go b/cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go index 5290b2fb598..947bc75ab2f 100644 --- a/cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go +++ b/cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go @@ -143,7 +143,7 @@ func TestBuildKubeConfigFromSpecWithClientAuth(t *testing.T) { // Creates a CA caCert, caKey := certstestutil.SetupCertificateAuthorithy(t) - // Executes buildKubeConfigFromSpec passing a KubeConfigSpec wiht a ClientAuth + // Executes buildKubeConfigFromSpec passing a KubeConfigSpec with a ClientAuth config := setupdKubeConfigWithClientAuth(t, caCert, caKey, "https://1.2.3.4:1234", "myClientName", "myOrg1", "myOrg2") // Asserts spec data are propagated to the kubeconfig @@ -155,7 +155,7 @@ func TestBuildKubeConfigFromSpecWithTokenAuth(t *testing.T) { // Creates a CA caCert, _ := certstestutil.SetupCertificateAuthorithy(t) - // Executes buildKubeConfigFromSpec passing a KubeConfigSpec wiht a Token + // Executes buildKubeConfigFromSpec passing a KubeConfigSpec with a Token config := setupdKubeConfigWithTokenAuth(t, caCert, "https://1.2.3.4:1234", "myClientName", "123456") // Asserts spec data are propagated to the kubeconfig @@ -219,7 +219,7 @@ func TestCreateKubeConfigFileIfNotExists(t *testing.T) { t.Errorf("createKubeConfigFileIfNotExists failed") } - // Assert creted files is there + // Assert that the created file is there testutil.AssertFileExists(t, tmpdir, "test.conf") } } @@ -338,10 +338,10 @@ func TestWriteKubeConfig(t *testing.T) { // Adds a pki folder with a ca cert to the temp folder pkidir := testutil.SetupPkiDirWithCertificateAuthorithy(t, tmpdir) - // Retrives ca cert for assertions + // Retrieves ca cert for assertions caCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(pkidir, kubeadmconstants.CACertAndKeyBaseName) if err != nil { - t.Fatalf("couldn't retrive ca cert: %v", err) + t.Fatalf("couldn't retrieve ca cert: %v", err) } // Creates a Master Configuration pointing to the pkidir folder diff --git a/cmd/kubeadm/app/phases/selfhosting/selfhosting.go b/cmd/kubeadm/app/phases/selfhosting/selfhosting.go index 8e894d64863..8456313a66d 100644 --- a/cmd/kubeadm/app/phases/selfhosting/selfhosting.go +++ b/cmd/kubeadm/app/phases/selfhosting/selfhosting.go @@ -112,7 +112,7 @@ func CreateSelfHostedControlPlane(manifestsDir, kubeConfigDir string, cfg *kubea } // Wait for the mirror Pod hash to be removed; otherwise we'll run into race conditions here when the kubelet hasn't had time to - // remove the Static Pod (or the mirror Pod respectively). This implicitely also tests that the API server endpoint is healthy, + // remove the Static Pod (or the mirror Pod respectively). This implicitly also tests that the API server endpoint is healthy, // because this blocks until the API server returns a 404 Not Found when getting the Static Pod staticPodName := fmt.Sprintf("%s-%s", componentName, cfg.NodeName) if err := waiter.WaitForPodToDisappear(staticPodName); err != nil { @@ -129,7 +129,7 @@ func CreateSelfHostedControlPlane(manifestsDir, kubeConfigDir string, cfg *kubea return nil } -// BuildDaemonSet is responsible for mutating the PodSpec and return a DaemonSet which is suitable for the self-hosting purporse +// BuildDaemonSet is responsible for mutating the PodSpec and returns a DaemonSet which is suitable for self-hosting func BuildDaemonSet(name string, podSpec *v1.PodSpec, mutators map[string][]PodSpecMutatorFunc) *apps.DaemonSet { // Mutate the PodSpec so it's suitable for self-hosting diff --git a/cmd/kubeadm/app/phases/upgrade/prepull.go b/cmd/kubeadm/app/phases/upgrade/prepull.go index f4094dbf715..c3ec257a743 100644 --- a/cmd/kubeadm/app/phases/upgrade/prepull.go +++ b/cmd/kubeadm/app/phases/upgrade/prepull.go @@ -41,7 +41,7 @@ type Prepuller interface { DeleteFunc(string) error } -// DaemonSetPrepuller makes sure the control plane images are availble on all masters +// DaemonSetPrepuller makes sure the control plane images are available on all masters type DaemonSetPrepuller struct { client clientset.Interface cfg *kubeadmapi.MasterConfiguration @@ -99,11 +99,11 @@ func PrepullImagesInParallel(kubePrepuller Prepuller, timeout time.Duration) err } } - // Create a channel for streaming data from goroutines that run in parallell to a blocking for loop that cleans up + // Create a channel for streaming data from goroutines that run in parallel to a blocking for loop that cleans up prePulledChan := make(chan string, len(componentsToPrepull)) for _, component := range componentsToPrepull { go func(c string) { - // Wait as long as needed. This WaitFunc call should be blocking until completetion + // Wait as long as needed. This WaitFunc call should be blocking until completion kubePrepuller.WaitFunc(c) // When the task is done, go ahead and cleanup by sending the name to the channel prePulledChan <- c diff --git a/cmd/kubeadm/app/phases/upgrade/staticpods.go b/cmd/kubeadm/app/phases/upgrade/staticpods.go index b661ea20593..8ea3b2559f5 100644 --- a/cmd/kubeadm/app/phases/upgrade/staticpods.go +++ b/cmd/kubeadm/app/phases/upgrade/staticpods.go @@ -337,7 +337,7 @@ func rollbackOldManifests(oldManifests map[string]string, origErr error, pathMgr errs = append(errs, err) } } - // Let the user know there we're problems, but we tried to reçover + // Let the user know there were problems, but we tried to recover return fmt.Errorf("couldn't upgrade control plane. kubeadm has tried to recover everything into the earlier state. Errors faced: %v", errs) } diff --git a/cmd/kubeadm/app/util/apiclient/dryrunclient.go b/cmd/kubeadm/app/util/apiclient/dryrunclient.go index 030187987d4..6c0d796e6fa 100644 --- a/cmd/kubeadm/app/util/apiclient/dryrunclient.go +++ b/cmd/kubeadm/app/util/apiclient/dryrunclient.go @@ -85,10 +85,10 @@ func NewDryRunClient(drg DryRunGetter, w io.Writer) clientset.Interface { // This client doesn't apply changes to the backend. The client gets GET/LIST values from the DryRunGetter implementation. // This client logs all I/O to the writer w in YAML format func NewDryRunClientWithOpts(opts DryRunClientOptions) clientset.Interface { - // Build a chain of reactors to act like a normal clientset; but log everything's that happening and don't change any state + // Build a chain of reactors to act like a normal clientset; but log everything that is happening and don't change any state client := fakeclientset.NewSimpleClientset() - // Build the chain of reactors. Order matters; first item here will be invoked first on match, then the second one will be evaluted, etc. + // Build the chain of reactors. Order matters; first item here will be invoked first on match, then the second one will be evaluated, etc. defaultReactorChain := []core.Reactor{ // Log everything that happens. Default the object if it's about to be created/updated so that the logged object is representative. &core.SimpleReactor{ @@ -223,7 +223,7 @@ func logDryRunAction(action core.Action, w io.Writer, marshalFunc MarshalFunc) { patchAction, ok := action.(core.PatchAction) if ok { - // Replace all occurences of \" with a simple " when printing + // Replace all occurrences of \" with a simple " when printing fmt.Fprintf(w, "[dryrun] Attached patch:\n\t%s\n", strings.Replace(string(patchAction.GetPatch()), `\"`, `"`, -1)) } }