Updates Kube-proxy validators to allow Windows 'kernelspace' mode.

This commit is contained in:
George Kudrayvtsev 2017-11-28 18:04:51 -08:00
parent 51033c4dec
commit 54662ca7fa
2 changed files with 6 additions and 4 deletions

View File

@ -160,9 +160,10 @@ type KubeProxyConfiguration struct {
type ProxyMode string type ProxyMode string
const ( const (
ProxyModeUserspace ProxyMode = "userspace" ProxyModeUserspace ProxyMode = "userspace"
ProxyModeIPTables ProxyMode = "iptables" ProxyModeIPTables ProxyMode = "iptables"
ProxyModeIPVS ProxyMode = "ipvs" ProxyModeIPVS ProxyMode = "ipvs"
ProxyModeKernelspace ProxyMode = "kernelspace"
) )
// IPVSSchedulerMethod is the algorithm for allocating TCP connections and // IPVSSchedulerMethod is the algorithm for allocating TCP connections and

View File

@ -146,9 +146,10 @@ func validateProxyMode(mode kubeproxyconfig.ProxyMode, fldPath *field.Path) fiel
case kubeproxyconfig.ProxyModeUserspace: case kubeproxyconfig.ProxyModeUserspace:
case kubeproxyconfig.ProxyModeIPTables: case kubeproxyconfig.ProxyModeIPTables:
case kubeproxyconfig.ProxyModeIPVS: case kubeproxyconfig.ProxyModeIPVS:
case kubeproxyconfig.ProxyModeKernelspace:
case "": case "":
default: default:
modes := []string{string(kubeproxyconfig.ProxyModeUserspace), string(kubeproxyconfig.ProxyModeIPTables), string(kubeproxyconfig.ProxyModeIPVS)} modes := []string{string(kubeproxyconfig.ProxyModeUserspace), string(kubeproxyconfig.ProxyModeIPTables), string(kubeproxyconfig.ProxyModeIPVS), string(kubeproxyconfig.ProxyModeKernelspace)}
errMsg := fmt.Sprintf("must be %s or blank (blank means the best-available proxy (currently iptables)", strings.Join(modes, ",")) errMsg := fmt.Sprintf("must be %s or blank (blank means the best-available proxy (currently iptables)", strings.Join(modes, ","))
allErrs = append(allErrs, field.Invalid(fldPath.Child("ProxyMode"), string(mode), errMsg)) allErrs = append(allErrs, field.Invalid(fldPath.Child("ProxyMode"), string(mode), errMsg))
} }