bsutil: list valid keys as slice instead of a map

pull/8147/head
Ilya Danilkin 2020-05-15 17:40:01 +03:00 committed by Ilya Danilkin
parent 79eaa8778a
commit d1ab5312d5
No known key found for this signature in database
GPG Key ID: B585407898C67FF7
1 changed files with 6 additions and 6 deletions

View File

@ -134,18 +134,18 @@ func defaultOptionsForComponentAndVersion(component string, version semver.Versi
// newComponentOptions creates a new componentOptions
func newComponentOptions(opts config.ExtraOptionSlice, version semver.Version, featureGates string, cp config.Node) ([]componentOptions, error) {
var kubeadmExtraArgs []componentOptions
for _, extraOpt := range opts {
if _, ok := componentToKubeadmConfigKey[extraOpt.Component]; !ok {
return nil, fmt.Errorf("unknown component %q. valid components are: %v", extraOpt.Component, componentToKubeadmConfigKey)
}
}
keys := []string{}
for k := range componentToKubeadmConfigKey {
keys = append(keys, k)
}
sort.Strings(keys)
for _, extraOpt := range opts {
if _, ok := componentToKubeadmConfigKey[extraOpt.Component]; !ok {
return nil, fmt.Errorf("unknown component %q. valid components are: %v", extraOpt.Component, keys)
}
}
for _, component := range keys {
kubeadmComponentKey := componentToKubeadmConfigKey[component]
if kubeadmComponentKey == "" {