mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 10:48:15 +00:00
Set only compressible resources on system slice
Signed-off-by: Harshal Patil <harpatil@redhat.com>
This commit is contained in:
@@ -383,7 +383,30 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
||||
conf.SystemReservedCgroup = ""
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: systemReservedCgroup (--system-reserved-cgroup) must be specified when \"system-reserved\" contained in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
errMsg: "invalid configuration: systemReservedCgroup (--system-reserved-cgroup) must be specified when \"system-reserved\" or \"system-reserved-compressible\" included in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
}, {
|
||||
name: "specify SystemReservedCompressibleEnforcementKey without specifying SystemReservedCgroup",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
conf.EnforceNodeAllocatable = []string{kubetypes.SystemReservedCompressibleEnforcementKey}
|
||||
conf.SystemReservedCgroup = ""
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: systemReservedCgroup (--system-reserved-cgroup) must be specified when \"system-reserved\" or \"system-reserved-compressible\" included in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
}, {
|
||||
name: "specify SystemReservedCompressibleEnforcementKey with SystemReservedEnforcementKey",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
conf.EnforceNodeAllocatable = []string{kubetypes.SystemReservedCompressibleEnforcementKey, kubetypes.SystemReservedEnforcementKey}
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: both \"system-reserved\" and \"system-reserved-compressible\" cannot be specified together in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
}, {
|
||||
name: "specify KubeReservedCompressibleEnforcementKey without specifying KubeReservedCgroup",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
conf.EnforceNodeAllocatable = []string{kubetypes.KubeReservedCompressibleEnforcementKey}
|
||||
conf.KubeReservedCgroup = ""
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: kubeReservedCgroup (--kube-reserved-cgroup) must be specified when \"kube-reserved\" or \"kube-reserved-compressible\" included in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
}, {
|
||||
name: "specify KubeReservedEnforcementKey without specifying KubeReservedCgroup",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
@@ -391,7 +414,14 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
||||
conf.KubeReservedCgroup = ""
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: kubeReservedCgroup (--kube-reserved-cgroup) must be specified when \"kube-reserved\" contained in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
errMsg: "invalid configuration: kubeReservedCgroup (--kube-reserved-cgroup) must be specified when \"kube-reserved\" or \"kube-reserved-compressible\" included in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
}, {
|
||||
name: "specify KubeReservedCompressibleEnforcementKey with KubeReservedEnforcementKey",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
conf.EnforceNodeAllocatable = []string{kubetypes.KubeReservedCompressibleEnforcementKey, kubetypes.KubeReservedEnforcementKey}
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: both \"kube-reserved\" and \"kube-reserved-compressible\" cannot be specified together in enforceNodeAllocatable (--enforce-node-allocatable)",
|
||||
}, {
|
||||
name: "specify NodeAllocatableNoneKey with additional enforcements",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
@@ -412,7 +442,7 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
||||
conf.EnforceNodeAllocatable = []string{"invalid-enforce-node-allocatable"}
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: option \"invalid-enforce-node-allocatable\" specified for enforceNodeAllocatable (--enforce-node-allocatable). Valid options are \"pods\", \"system-reserved\", \"kube-reserved\", or \"none\"",
|
||||
errMsg: "invalid configuration: option \"invalid-enforce-node-allocatable\" specified for enforceNodeAllocatable (--enforce-node-allocatable). Valid options are \"pods\", \"system-reserved\", \"system-reserved-compressible\", \"kube-reserved\", \"kube-reserved-compressible\" or \"none\"",
|
||||
}, {
|
||||
name: "invalid HairpinMode",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
|
||||
Reference in New Issue
Block a user