diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index 7268dfdc9d4..9a337da7635 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -343,7 +343,7 @@ func splitCertKeyPEM(bytes []byte) (certPem []byte, keyPem []byte) { } } - return + return certPem, keyPem } // getKubeletClientCert fills the kubelet client certificate with content returned diff --git a/pkg/cgroups/cgroups_linux.go b/pkg/cgroups/cgroups_linux.go index e2ff531ea1f..e8954041c2e 100644 --- a/pkg/cgroups/cgroups_linux.go +++ b/pkg/cgroups/cgroups_linux.go @@ -82,11 +82,11 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo if cgroupsModeV2 { m, err := cgroupsv2.NewManager("/sys/fs/cgroup", "/", &cgroupsv2.Resources{}) if err != nil { - return + return kubeletRoot, runtimeRoot, controllers } enabledControllers, err := m.Controllers() if err != nil { - return + return kubeletRoot, runtimeRoot, controllers } // Intentionally using an expressionless switch to match the logic below for _, controller := range enabledControllers { @@ -96,7 +96,7 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo f, err := os.Open("/proc/self/cgroup") if err != nil { - return + return kubeletRoot, runtimeRoot, controllers } defer f.Close() @@ -150,7 +150,7 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo // a host PID scenario but we don't support this. g, err := os.Open("/proc/1/cgroup") if err != nil { - return + return kubeletRoot, runtimeRoot, controllers } defer g.Close() scan = bufio.NewScanner(g) @@ -174,5 +174,5 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo } } } - return + return kubeletRoot, runtimeRoot, controllers } diff --git a/pkg/cgroups/cgroups_windows.go b/pkg/cgroups/cgroups_windows.go index ae24e3ab198..154dd7ef662 100644 --- a/pkg/cgroups/cgroups_windows.go +++ b/pkg/cgroups/cgroups_windows.go @@ -7,5 +7,5 @@ func Validate() error { } func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]bool) { - return + return kubeletRoot, runtimeRoot, controllers } diff --git a/pkg/configfilearg/parser.go b/pkg/configfilearg/parser.go index 23267cea068..a1a4b5d61ed 100644 --- a/pkg/configfilearg/parser.go +++ b/pkg/configfilearg/parser.go @@ -237,7 +237,7 @@ func dotDFiles(basefile string) (result []string, _ error) { } result = append(result, filepath.Join(basefile+".d", file.Name())) } - return + return result, nil } // readConfigFile returns a flattened arg list generated from the specified config @@ -312,7 +312,7 @@ func readConfigFile(file string) (result []string, _ error) { } } - return + return result, nil } func toSlice(v any) []any { diff --git a/pkg/daemons/control/tunnel.go b/pkg/daemons/control/tunnel.go index 1a4a959dc6d..8cd111ff4e5 100644 --- a/pkg/daemons/control/tunnel.go +++ b/pkg/daemons/control/tunnel.go @@ -297,5 +297,5 @@ func (crw *connReadWriteCloser) Write(b []byte) (n int, err error) { func (crw *connReadWriteCloser) Close() (err error) { crw.once.Do(func() { err = crw.conn.Close() }) - return + return err }