mirror of https://github.com/k3s-io/k3s.git
lint: bare-return
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>pull/13369/head
parent
850de3d04d
commit
55f8d9f731
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ func Validate() error {
|
|||
}
|
||||
|
||||
func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]bool) {
|
||||
return
|
||||
return kubeletRoot, runtimeRoot, controllers
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue