Skip to content

Commit da234c9

Browse files
committed
kubeadm: improve some grammar issues
1 parent ea61d04 commit da234c9

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

cmd/kubeadm/app/cmd/phases/upgrade/apply/addons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func runCoreDNSAddon(c workflow.RunData) error {
106106
return nil
107107
}
108108

109-
// runKubeProxyAddon upgrades the KubeProxy addon.
109+
// runKubeProxyAddon upgrades the kube-proxy addon.
110110
func runKubeProxyAddon(c workflow.RunData) error {
111111
cfg, client, _, out, dryRun, err := getInitData(c)
112112
if err != nil {

cmd/kubeadm/app/cmd/phases/upgrade/apply/kubeletconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
var (
3232
kubeletConfigLongDesc = cmdutil.LongDesc(`
33-
Download the kubelet configuration from the kubelet-config ConfigMap stored in the cluster
33+
Upgrade the kubelet configuration for this node by downloading it from the kubelet-config ConfigMap stored in the cluster
3434
`)
3535
)
3636

cmd/kubeadm/app/cmd/phases/upgrade/apply/postupgrade.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
func NewPostUpgradePhase() workflow.Phase {
2929
return workflow.Phase{
3030
Name: "post-upgrade",
31-
Short: "Run the post upgrade tasks",
31+
Short: "Run post upgrade tasks",
3232
Run: runPostUpgrade,
3333
InheritFlags: []string{
3434
options.CfgPath,
@@ -43,7 +43,7 @@ func runPostUpgrade(c workflow.RunData) error {
4343
if !ok {
4444
return errors.New("preflight phase invoked with an invalid data struct")
4545
}
46-
// TODO: add the post upgrade tasks here when needed
46+
// PLACEHOLDER: this phase should contain any release specific post-upgrade tasks.
4747

4848
return nil
4949
}

cmd/kubeadm/app/cmd/phases/upgrade/apply/preflight.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,30 @@ func runPreflight(c workflow.RunData) error {
6868

6969
initCfg, client, ignorePreflightErrors := data.InitCfg(), data.Client(), data.IgnorePreflightErrors()
7070

71-
// First, check if we're root separately from the other preflight checks and fail fast
71+
// First, check if we're root separately from the other preflight checks and fail fast.
7272
if err := preflight.RunRootCheckOnly(ignorePreflightErrors); err != nil {
7373
return err
7474
}
7575

76-
// Run CoreDNS migration check
76+
// Run CoreDNS migration check.
7777
if err := upgrade.RunCoreDNSMigrationCheck(client, ignorePreflightErrors); err != nil {
7878
return err
7979
}
8080

81-
// Run healthchecks against the cluster
81+
// Run healthchecks against the cluster.
8282
klog.V(1).Infoln("[upgrade/preflight] Verifying the cluster health")
8383
if err := upgrade.CheckClusterHealth(client, &initCfg.ClusterConfiguration, ignorePreflightErrors, printer); err != nil {
8484
return err
8585
}
8686

87-
// Check if feature gate flags used in the cluster are consistent with the set of features currently supported by kubeadm
87+
// Check if feature gate flags used in the cluster are consistent with the set of features currently supported by kubeadm.
8888
if msg := features.CheckDeprecatedFlags(&features.InitFeatureGates, initCfg.FeatureGates); len(msg) > 0 {
8989
for _, m := range msg {
9090
_, _ = printer.Printf("[upgrade/preflight] %s\n", m)
9191
}
9292
}
9393

94-
// Validate requested and validate actual version
94+
// Validate requested and validate actual version.
9595
klog.V(1).Infoln("[upgrade/preflight] Validating requested and actual version")
9696
if err := configutil.NormalizeKubernetesVersion(&initCfg.ClusterConfiguration); err != nil {
9797
return err
@@ -132,8 +132,8 @@ func runPreflight(c workflow.RunData) error {
132132
return nil
133133
}
134134

135-
// enforceVersionPolicies makes sure that the version the user specified is valid to upgrade to
136-
// There are both fatal and skippable (with --force) errors
135+
// enforceVersionPolicies makes sure that the version the user specified is valid to upgrade to.
136+
// It handles both fatal and skippable (with --force) errors.
137137
func enforceVersionPolicies(newK8sVersionStr string, newK8sVersion *version.Version, allowExperimentalUpgrades, allowRCUpgrades, force bool, versionGetter upgrade.VersionGetter) error {
138138
fmt.Printf("[upgrade/preflight] You have chosen to upgrade the cluster version to %q\n", newK8sVersionStr)
139139

@@ -146,12 +146,12 @@ func enforceVersionPolicies(newK8sVersionStr string, newK8sVersion *version.Vers
146146
}
147147

148148
if len(versionSkewErrs.Skippable) > 0 {
149-
// Return the error if the user hasn't specified the --force flag
149+
// Return the error if the user hasn't specified the --force flag.
150150
if !force {
151151
return errors.Errorf("the version argument is invalid due to these errors:\n\n%v\nCan be bypassed if you pass the --force flag",
152152
kubeadmutil.FormatErrMsg(versionSkewErrs.Skippable))
153153
}
154-
// Soft errors found, but --force was specified
154+
// Soft errors found, but --force was specified.
155155
fmt.Printf("[upgrade/preflight] Found %d potential version compatibility errors but skipping since the --force flag is set: \n\n%v", len(versionSkewErrs.Skippable), kubeadmutil.FormatErrMsg(versionSkewErrs.Skippable))
156156
}
157157
}

cmd/kubeadm/app/cmd/phases/upgrade/apply/uploadconfig.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func getUploadConfigPhaseFlags() []string {
7272
}
7373
}
7474

75-
// runUploadKubeadmConfig uploads the kubeadm configuration to a ConfigMap
75+
// runUploadKubeadmConfig uploads the kubeadm configuration to a ConfigMap.
7676
func runUploadKubeadmConfig(c workflow.RunData) error {
7777
cfg, client, dryRun, err := getUploadConfigData(c)
7878
if err != nil {
@@ -91,7 +91,7 @@ func runUploadKubeadmConfig(c workflow.RunData) error {
9191
return nil
9292
}
9393

94-
// runUploadKubeletConfig uploads the kubelet configuration to a ConfigMap
94+
// runUploadKubeletConfig uploads the kubelet configuration to a ConfigMap.
9595
func runUploadKubeletConfig(c workflow.RunData) error {
9696
cfg, client, dryRun, err := getUploadConfigData(c)
9797
if err != nil {
@@ -109,7 +109,7 @@ func runUploadKubeletConfig(c workflow.RunData) error {
109109
return errors.Wrap(err, "error creating kubelet configuration ConfigMap")
110110
}
111111

112-
klog.V(1).Infoln("[upgrade/upload-config] Preserving the CRISocket information for the control-plane node")
112+
klog.V(1).Infoln("[upgrade/upload-config] Preserving the CRISocket information for this control-plane node")
113113
if err := patchnodephase.AnnotateCRISocket(client, cfg.NodeRegistration.Name, cfg.NodeRegistration.CRISocket); err != nil {
114114
return errors.Wrap(err, "error writing Crisocket information for the control-plane node")
115115
}

cmd/kubeadm/app/cmd/upgrade/apply.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ func newCmdApply(apf *applyPlanFlags) *cobra.Command {
139139
applyRunner.AppendPhase(phases.NewAddonPhase())
140140
applyRunner.AppendPhase(phases.NewPostUpgradePhase())
141141

142-
// Sets the data builder function, that will be used by the runner
143-
// both when running the entire workflow or single phases
142+
// Sets the data builder function, that will be used by the runner,
143+
// both when running the entire workflow or single phases.
144144
applyRunner.SetDataInitializer(func(cmd *cobra.Command, args []string) (workflow.RunData, error) {
145145
data, err := newApplyData(cmd, args, flags)
146146
if err != nil {
@@ -154,7 +154,7 @@ func newCmdApply(apf *applyPlanFlags) *cobra.Command {
154154
})
155155

156156
// Binds the Runner to kubeadm upgrade apply command by altering
157-
// command help, adding --skip-phases flag and by adding phases subcommands
157+
// command help, adding --skip-phases flag and by adding phases subcommands.
158158
applyRunner.BindToCommand(cmd)
159159

160160
return cmd
@@ -170,7 +170,7 @@ func newApplyData(cmd *cobra.Command, args []string, applyFlags *applyFlags) (*a
170170
}
171171

172172
upgradeVersion := upgradeCfg.Apply.KubernetesVersion
173-
// The version arg is mandatory, unless it's specified in the config file
173+
// The version arg is mandatory, unless it's specified in the config file.
174174
if upgradeVersion == "" {
175175
if err := cmdutil.ValidateExactArgNumber(args, []string{"version"}); err != nil {
176176
return nil, err
@@ -229,7 +229,7 @@ func newApplyData(cmd *cobra.Command, args []string, applyFlags *applyFlags) (*a
229229

230230
printer := &output.TextPrinter{}
231231

232-
// Fetches the cluster configuration
232+
// Fetches the cluster configuration.
233233
klog.V(1).Infoln("[upgrade] retrieving configuration from cluster")
234234
initCfg, err := configutil.FetchInitConfigurationFromCluster(client, nil, "upgrade", false, false)
235235
if err != nil {
@@ -238,7 +238,7 @@ func newApplyData(cmd *cobra.Command, args []string, applyFlags *applyFlags) (*a
238238
_, _ = printer.Printf("[upgrade] Use 'kubeadm init phase upload-config --config your-config.yaml' to re-upload it.\n")
239239
err = errors.Errorf("the ConfigMap %q in the %q namespace was not found", constants.KubeadmConfigConfigMap, metav1.NamespaceSystem)
240240
}
241-
return nil, errors.Wrap(err, "[upgrade/init config] FATAL")
241+
return nil, errors.Wrap(err, "[upgrade] FATAL")
242242
}
243243

244244
// Also set the union of pre-flight errors to InitConfiguration, to provide a consistent view of the runtime configuration:

cmd/kubeadm/app/cmd/upgrade/apply_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestNewApplyData(t *testing.T) {
112112
}
113113
for _, tc := range testCases {
114114
t.Run(tc.name, func(t *testing.T) {
115-
// initialize an external apply flags and inject it to the apply cmd
115+
// Initialize an external apply flags and inject it to the apply cmd.
116116
apf := &applyPlanFlags{
117117
kubeConfigPath: kubeadmconstants.GetAdminKubeConfigPath(),
118118
cfgPath: "",
@@ -125,7 +125,7 @@ func TestNewApplyData(t *testing.T) {
125125

126126
cmd := newCmdApply(apf)
127127

128-
// sets cmd flags (that will be reflected on the init options)
128+
// Sets cmd flags (that will be reflected on the init options).
129129
for f, v := range tc.flags {
130130
_ = cmd.Flags().Set(f, v)
131131
}
@@ -136,7 +136,7 @@ func TestNewApplyData(t *testing.T) {
136136
renewCerts: true,
137137
}
138138

139-
// test newApplyData method
139+
// Test newApplyData method.
140140
data, err := newApplyData(cmd, tc.args, flags)
141141
if err == nil && len(tc.expectedError) != 0 {
142142
t.Error("Expected error, but got success")
@@ -145,7 +145,7 @@ func TestNewApplyData(t *testing.T) {
145145
t.Fatalf("newApplyData returned unexpected error, expected: %s, got %v", tc.expectedError, err)
146146
}
147147

148-
// exec additional validation on the returned value
148+
// Exec additional validation on the returned value.
149149
if tc.validate != nil {
150150
tc.validate(t, data)
151151
}

cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func AllowBootstrapTokensToPostCSRs(client clientset.Interface) error {
4949
})
5050
}
5151

52-
// AllowBootstrapTokensToGetNodes creates RBAC rules to allow Node Bootstrap Tokens to list nodes
52+
// AllowBootstrapTokensToGetNodes creates RBAC rules to allow Node Bootstrap Tokens to list nodes.
5353
func AllowBootstrapTokensToGetNodes(client clientset.Interface) error {
5454
fmt.Println("[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes")
5555

cmd/kubeadm/app/phases/upgrade/postupgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func PerformAddonsUpgrade(client clientset.Interface, cfg *kubeadmapi.InitConfig
109109
return errorsutil.NewAggregate(errs)
110110
}
111111

112-
// UnupgradedControlPlaneInstances returns a list of control palne instances that have not yet been upgraded.
112+
// UnupgradedControlPlaneInstances returns a list of control plane instances that have not yet been upgraded.
113113
//
114114
// NB. This function can only be called after the current control plane instance has been upgraded already.
115115
// Because it determines whether the other control plane instances have been upgraded by checking whether

0 commit comments

Comments
 (0)