Skip to content

Commit fabfd95

Browse files
committed
cleanup: fix some log and error capitalizations
Part of kubernetes#15863
1 parent 2e6eea5 commit fabfd95

File tree

40 files changed

+76
-76
lines changed

40 files changed

+76
-76
lines changed

cluster/gce/gci/mounter/mounter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ func mountInChroot(rootfsPath string, args []string) error {
7979
// Mount failed because it is NFS V3 and we need to run rpcBind
8080
output, err = exec.Command(chrootCmd, rootfsPath, rpcBindCmd, "-w").CombinedOutput()
8181
if err != nil {
82-
return fmt.Errorf("Mount issued for NFS V3 but unable to run rpcbind:\n Output: %s\n Error: %v", string(output), err)
82+
return fmt.Errorf("mount issued for NFS V3 but unable to run rpcbind:\n Output: %s\n Error: %v", string(output), err)
8383
}
8484

8585
// Rpcbind is running, try mounting again
8686
output, err = exec.Command(chrootCmd, args...).CombinedOutput()
8787

8888
if err != nil {
89-
return fmt.Errorf("Mount failed for NFS V3 even after running rpcBind %s, %v", string(output), err)
89+
return fmt.Errorf("mount failed for NFS V3 even after running rpcBind %s, %v", string(output), err)
9090
}
9191

9292
return nil

cluster/images/etcd/migrate/migrate_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@ func (e *CombinedEtcdClient) AttachLease(leaseDuration time.Duration) error {
195195
defer v3client.Close()
196196
objectsResp, err := v3client.KV.Get(ctx, ttlKeysPrefix, clientv3.WithPrefix())
197197
if err != nil {
198-
return fmt.Errorf("Error while getting objects to attach to the lease")
198+
return fmt.Errorf("error while getting objects to attach to the lease")
199199
}
200200

201201
lease, err := v3client.Lease.Grant(ctx, int64(leaseDuration/time.Second))
202202
if err != nil {
203-
return fmt.Errorf("Error while creating lease: %v", err)
203+
return fmt.Errorf("error while creating lease: %v", err)
204204
}
205205
klog.Infof("Lease with TTL: %v created", lease.TTL)
206206

cluster/images/etcd/migrate/migrate_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (r *EtcdMigrateServer) Start(version *EtcdVersion) error {
8787
if err != nil {
8888
return fmt.Errorf("error killing etcd: %v", err)
8989
}
90-
return fmt.Errorf("Timed out waiting for etcd on port %d", r.cfg.port)
90+
return fmt.Errorf("timed out waiting for etcd on port %d", r.cfg.port)
9191
}
9292
}
9393
}

cluster/images/etcd/migrate/versions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ type EtcdVersionPair struct {
111111
func ParseEtcdVersionPair(s string) (*EtcdVersionPair, error) {
112112
parts := strings.Split(s, "/")
113113
if len(parts) != 2 {
114-
return nil, fmt.Errorf("Malformed version file, expected <major>.<minor>.<patch>/<storage> but got %s", s)
114+
return nil, fmt.Errorf("malformed version file, expected <major>.<minor>.<patch>/<storage> but got %s", s)
115115
}
116116
version, err := ParseEtcdVersion(parts[0])
117117
if err != nil {

cmd/kube-proxy/app/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func TestConfigChange(t *testing.T) {
393393
setUp := func() (*os.File, string, error) {
394394
tempDir, err := ioutil.TempDir("", "kubeproxy-config-change")
395395
if err != nil {
396-
return nil, "", fmt.Errorf("Unable to create temporary directory: %v", err)
396+
return nil, "", fmt.Errorf("unable to create temporary directory: %v", err)
397397
}
398398
fullPath := filepath.Join(tempDir, "kube-proxy-config")
399399
file, err := os.Create(fullPath)

cmd/kubeadm/app/cmd/alpha/kubelet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ func newCmdKubeletConfigEnableDynamic() *cobra.Command {
138138
Example: kubeletConfigEnableDynamicExample,
139139
Run: func(cmd *cobra.Command, args []string) {
140140
if len(nodeName) == 0 {
141-
kubeadmutil.CheckErr(errors.New("The --node-name argument is required"))
141+
kubeadmutil.CheckErr(errors.New("the --node-name argument is required"))
142142
}
143143
if len(kubeletVersionStr) == 0 {
144-
kubeadmutil.CheckErr(errors.New("The --kubelet-version argument is required"))
144+
kubeadmutil.CheckErr(errors.New("the --kubelet-version argument is required"))
145145
}
146146

147147
kubeletVersion, err := version.ParseSemantic(kubeletVersionStr)

cmd/kubeadm/app/cmd/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
242242
`), kubeadmapiv1beta2.SchemeGroupVersion, kubeadmapiv1beta2.SchemeGroupVersion),
243243
Run: func(cmd *cobra.Command, args []string) {
244244
if len(oldCfgPath) == 0 {
245-
kubeadmutil.CheckErr(errors.New("The --old-config flag is mandatory"))
245+
kubeadmutil.CheckErr(errors.New("the --old-config flag is mandatory"))
246246
}
247247

248248
oldCfgBytes, err := ioutil.ReadFile(oldCfgPath)
@@ -319,7 +319,7 @@ func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Co
319319
`), metav1.NamespaceSystem, constants.KubeadmConfigConfigMap),
320320
Run: func(cmd *cobra.Command, args []string) {
321321
if len(cfgPath) == 0 {
322-
kubeadmutil.CheckErr(errors.New("The --config flag is mandatory"))
322+
kubeadmutil.CheckErr(errors.New("the --config flag is mandatory"))
323323
}
324324

325325
klog.V(1).Infoln("[config] retrieving ClientSet from file")

cmd/kubeadm/app/cmd/phases/reset/preflight.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func runPreflight(c workflow.RunData) error {
5858
return err
5959
}
6060
if strings.ToLower(s.Text()) != "y" {
61-
return errors.New("Aborted reset operation")
61+
return errors.New("aborted reset operation")
6262
}
6363
}
6464

cmd/kubeadm/app/constants/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ func EtcdSupportedVersion(versionString string) (*version.Version, error) {
428428
}
429429
return etcdVersion, nil
430430
}
431-
return nil, errors.Errorf("Unsupported or unknown Kubernetes version(%v)", kubernetesVersion)
431+
return nil, errors.Errorf("unsupported or unknown Kubernetes version(%v)", kubernetesVersion)
432432
}
433433

434434
// GetStaticPodDirectory returns the location on the disk where the Static Pod should be present

cmd/kubeadm/app/constants/constants_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func TestEtcdSupportedVersion(t *testing.T) {
157157
{
158158
kubernetesVersion: "1.99.0",
159159
expectedVersion: nil,
160-
expectedError: errors.New("Unsupported or unknown Kubernetes version(1.99.0)"),
160+
expectedError: errors.New("unsupported or unknown Kubernetes version(1.99.0)"),
161161
},
162162
{
163163
kubernetesVersion: MinimumControlPlaneVersion.WithPatch(1).String(),

0 commit comments

Comments
 (0)