kubeapiserver/options: fix cloud provider validation

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
This commit is contained in:
Dr. Stefan Schimanski 2023-10-17 17:48:39 +02:00
parent ba7feccfa3
commit 72e67e0ef0
No known key found for this signature in database
GPG Key ID: 4C68E0F19F95EC33

View File

@ -48,10 +48,9 @@ func (opts *CloudProviderOptions) Validate() []error {
"please set DisableCloudProviders feature to true", opts.CloudProvider))
}
if !utilfeature.DefaultFeatureGate.Enabled(features.DisableKubeletCloudCredentialProviders) {
errs = append(errs, fmt.Errorf("when using --cloud-provider set to '%s', "+ //nolint:staticcheck,ineffassign // false positive
errs = append(errs, fmt.Errorf("when using --cloud-provider set to '%s', "+
"please set DisableKubeletCloudCredentialProviders feature to true", opts.CloudProvider))
}
return nil
case cloudprovider.IsDeprecatedInternal(opts.CloudProvider):
if utilfeature.DefaultFeatureGate.Enabled(features.DisableCloudProviders) {
errs = append(errs, fmt.Errorf("when using --cloud-provider set to '%s', "+