mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Clean up cloud-controller-manager.
These are based on recommendation from [staticcheck](http://staticcheck.io/).
This commit is contained in:
parent
74618928c2
commit
664414cec0
@ -120,8 +120,8 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
|
|||||||
klog.Fatalf("cloud provider is nil")
|
klog.Fatalf("cloud provider is nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
if cloud.HasClusterID() == false {
|
if !cloud.HasClusterID() {
|
||||||
if c.ComponentConfig.KubeCloudShared.AllowUntaggedCloud == true {
|
if c.ComponentConfig.KubeCloudShared.AllowUntaggedCloud {
|
||||||
klog.Warning("detected a cluster without a ClusterID. A ClusterID will be required in the future. Please tag your cluster to avoid any future issues")
|
klog.Warning("detected a cluster without a ClusterID. A ClusterID will be required in the future. Please tag your cluster to avoid any future issues")
|
||||||
} else {
|
} else {
|
||||||
klog.Fatalf("no ClusterID found. A ClusterID is required for the cloud provider to function properly. This check can be bypassed by setting the allow-untagged-cloud option")
|
klog.Fatalf("no ClusterID found. A ClusterID is required for the cloud provider to function properly. This check can be bypassed by setting the allow-untagged-cloud option")
|
||||||
|
@ -103,9 +103,7 @@ func (o *GenericControllerManagerConfigurationOptions) Validate(allControllers [
|
|||||||
if controller == "*" {
|
if controller == "*" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(controller, "-") {
|
controller = strings.TrimPrefix(controller, "-")
|
||||||
controller = controller[1:]
|
|
||||||
}
|
|
||||||
if !allControllersSet.Has(controller) {
|
if !allControllersSet.Has(controller) {
|
||||||
errs = append(errs, fmt.Errorf("%q is not in the list of known controllers", controller))
|
errs = append(errs, fmt.Errorf("%q is not in the list of known controllers", controller))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user