mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
cleanup: omit redundant nil check around loop in apiserver
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
This commit is contained in:
parent
1ceddc790d
commit
b9ea207ff7
@ -669,7 +669,6 @@ func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.APIEnablement.RuntimeConfig != nil {
|
|
||||||
for key, value := range s.APIEnablement.RuntimeConfig {
|
for key, value := range s.APIEnablement.RuntimeConfig {
|
||||||
if key == "v1" || strings.HasPrefix(key, "v1/") ||
|
if key == "v1" || strings.HasPrefix(key, "v1/") ||
|
||||||
key == "api/v1" || strings.HasPrefix(key, "api/v1/") {
|
key == "api/v1" || strings.HasPrefix(key, "api/v1/") {
|
||||||
@ -680,7 +679,7 @@ func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error) {
|
|||||||
delete(s.APIEnablement.RuntimeConfig, key)
|
delete(s.APIEnablement.RuntimeConfig, key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
options.ServerRunOptions = s
|
options.ServerRunOptions = s
|
||||||
return options, nil
|
return options, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user