Upgrade k8s package verison (#5358)
* upgrade k8s package version Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> * Script upgrade and code formatting. Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
29
vendor/k8s.io/apiserver/pkg/server/egressselector/config.go
generated
vendored
29
vendor/k8s.io/apiserver/pkg/server/egressselector/config.go
generated
vendored
@@ -34,8 +34,7 @@ import (
|
||||
var cfgScheme = runtime.NewScheme()
|
||||
|
||||
// validEgressSelectorNames contains the set of valid egress selctor names.
|
||||
// 'master' is deprecated in favor of 'controlplane' and will be removed in v1.22.
|
||||
var validEgressSelectorNames = sets.NewString("master", "controlplane", "cluster", "etcd")
|
||||
var validEgressSelectorNames = sets.NewString("controlplane", "cluster", "etcd")
|
||||
|
||||
func init() {
|
||||
install.Install(cfgScheme)
|
||||
@@ -103,27 +102,21 @@ func ValidateEgressSelectorConfiguration(config *apiserver.EgressSelectorConfigu
|
||||
}
|
||||
}
|
||||
|
||||
var foundControlPlane, foundMaster bool
|
||||
for _, service := range config.EgressSelections {
|
||||
seen := sets.String{}
|
||||
for i, service := range config.EgressSelections {
|
||||
canonicalName := strings.ToLower(service.Name)
|
||||
|
||||
if !validEgressSelectorNames.Has(canonicalName) {
|
||||
allErrs = append(allErrs, field.NotSupported(field.NewPath("egressSelection", "name"), canonicalName, validEgressSelectorNames.List()))
|
||||
fldPath := field.NewPath("service", "connection")
|
||||
// no duplicate check
|
||||
if seen.Has(canonicalName) {
|
||||
allErrs = append(allErrs, field.Duplicate(fldPath.Index(i), canonicalName))
|
||||
continue
|
||||
}
|
||||
seen.Insert(canonicalName)
|
||||
|
||||
if canonicalName == "master" {
|
||||
foundMaster = true
|
||||
if !validEgressSelectorNames.Has(canonicalName) {
|
||||
allErrs = append(allErrs, field.NotSupported(fldPath, canonicalName, validEgressSelectorNames.List()))
|
||||
continue
|
||||
}
|
||||
|
||||
if canonicalName == "controlplane" {
|
||||
foundControlPlane = true
|
||||
}
|
||||
}
|
||||
|
||||
// error if both master and controlplane egress selectors are set
|
||||
if foundMaster && foundControlPlane {
|
||||
allErrs = append(allErrs, field.Forbidden(field.NewPath("egressSelection", "name"), "both egressSelection names 'master' and 'controlplane' are specified, only one is allowed"))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
|
||||
Reference in New Issue
Block a user