mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
kublet/userns: Test new functionality with feature gate disabled
We just added some more functionality, let's make sure it works fine with the feature gate disabled. Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
parent
1fb1218f57
commit
658b45cd03
@ -49,6 +49,10 @@ func TestReleaseDisabled(t *testing.T) {
|
||||
|
||||
func TestGetOrCreateUserNamespaceMappingsDisabled(t *testing.T) {
|
||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.UserNamespacesSupport, false)()
|
||||
|
||||
trueVal := true
|
||||
falseVal := false
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
pod *v1.Pod
|
||||
@ -59,6 +63,31 @@ func TestGetOrCreateUserNamespaceMappingsDisabled(t *testing.T) {
|
||||
pod: nil,
|
||||
success: true,
|
||||
},
|
||||
{
|
||||
name: "hostUsers is nil",
|
||||
pod: &v1.Pod{
|
||||
Spec: v1.PodSpec{
|
||||
HostUsers: nil,
|
||||
},
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
{
|
||||
name: "hostUsers is true",
|
||||
pod: &v1.Pod{
|
||||
Spec: v1.PodSpec{
|
||||
HostUsers: &trueVal,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "hostUsers is false",
|
||||
pod: &v1.Pod{
|
||||
Spec: v1.PodSpec{
|
||||
HostUsers: &falseVal,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user