diff --git a/cmd/kube-controller-manager/app/core.go b/cmd/kube-controller-manager/app/core.go index 45f663b86bd..ee9d6375501 100644 --- a/cmd/kube-controller-manager/app/core.go +++ b/cmd/kube-controller-manager/app/core.go @@ -211,7 +211,7 @@ func startPersistentVolumeBinderController(ctx ControllerContext) (http.Handler, func startAttachDetachController(ctx ControllerContext) (http.Handler, bool, error) { if ctx.ComponentConfig.AttachDetachController.ReconcilerSyncLoopPeriod.Duration < time.Second { - return nil, true, fmt.Errorf("Duration time must be greater than one second as set via command line option reconcile-sync-loop-period.") + return nil, true, fmt.Errorf("Duration time must be greater than one second as set via command line option reconcile-sync-loop-period") } csiClientConfig := ctx.ClientBuilder.ConfigOrDie("attachdetach-controller") // csiClient works with CRDs that support json only diff --git a/cmd/kube-proxy/app/conntrack.go b/cmd/kube-proxy/app/conntrack.go index f3b7776e361..ad9e0e52b72 100644 --- a/cmd/kube-proxy/app/conntrack.go +++ b/cmd/kube-proxy/app/conntrack.go @@ -43,7 +43,7 @@ type Conntracker interface { type realConntracker struct{} -var readOnlySysFSError = errors.New("readOnlySysFS") +var errReadOnlySysFS = errors.New("readOnlySysFS") func (rct realConntracker) SetMax(max int) error { if err := rct.setIntSysCtl("nf_conntrack_max", max); err != nil { @@ -70,14 +70,14 @@ func (rct realConntracker) SetMax(max int) error { // issue (https://github.com/docker/docker/issues/24000). Setting // conntrack will fail when sysfs is readonly. When that happens, we // don't set conntrack hashsize and return a special error - // readOnlySysFSError here. The caller should deal with - // readOnlySysFSError differently. + // errReadOnlySysFS here. The caller should deal with + // errReadOnlySysFS differently. writable, err := isSysFSWritable() if err != nil { return err } if !writable { - return readOnlySysFSError + return errReadOnlySysFS } // TODO: generify this and sysctl to a new sysfs.WriteInt() klog.Infof("Setting conntrack hashsize to %d", max/4) @@ -126,7 +126,7 @@ func isSysFSWritable() (bool, error) { } klog.Errorf("sysfs is not writable: %+v (mount options are %v)", mountPoint, mountPoint.Opts) - return false, readOnlySysFSError + return false, errReadOnlySysFS } return false, errors.New("No sysfs mounted") diff --git a/cmd/kube-proxy/app/server.go b/cmd/kube-proxy/app/server.go index 60060e0eac7..9074b7f99e5 100644 --- a/cmd/kube-proxy/app/server.go +++ b/cmd/kube-proxy/app/server.go @@ -550,10 +550,10 @@ func (s *ProxyServer) Run() error { if max > 0 { err := s.Conntracker.SetMax(max) if err != nil { - if err != readOnlySysFSError { + if err != errReadOnlySysFS { return err } - // readOnlySysFSError is caused by a known docker issue (https://github.com/docker/docker/issues/24000), + // errReadOnlySysFS is caused by a known docker issue (https://github.com/docker/docker/issues/24000), // the only remediation we know is to restart the docker daemon. // Here we'll send an node event with specific reason and message, the // administrator should decide whether and how to handle this issue,