Skip to content

Commit 531d38e

Browse files
committed
features: rename UserNamespacesStatelessPodsSupport
now it is called UserNamespacesSupport since all kind of volumes are supported. Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent 556d713 commit 531d38e

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

Diff for: pkg/api/pod/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ func dropDisabledFields(
477477
}
478478

479479
// If the feature is disabled and not in use, drop the hostUsers field.
480-
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesStatelessPodsSupport) && !hostUsersInUse(oldPodSpec) {
480+
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) && !hostUsersInUse(oldPodSpec) {
481481
// Drop the field in podSpec only if SecurityContext is not nil.
482482
// If it is nil, there is no need to set hostUsers=nil (it will be nil too).
483483
if podSpec.SecurityContext != nil {

Diff for: pkg/api/pod/util_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ func TestDropHostUsers(t *testing.T) {
17001700
}
17011701

17021702
t.Run(fmt.Sprintf("feature enabled=%v, old pod %v, new pod %v", enabled, oldPodInfo.description, newPodInfo.description), func(t *testing.T) {
1703-
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.UserNamespacesStatelessPodsSupport, enabled)()
1703+
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.UserNamespacesSupport, enabled)()
17041704

17051705
DropDisabledPodFields(newPod, oldPod)
17061706

Diff for: pkg/features/kube_features.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ const (
793793
// alpha: v1.25
794794
//
795795
// Enables user namespace support for stateless pods.
796-
UserNamespacesStatelessPodsSupport featuregate.Feature = "UserNamespacesStatelessPodsSupport"
796+
UserNamespacesSupport featuregate.Feature = "UserNamespacesSupport"
797797

798798
// owner: @cofyc
799799
// alpha: v1.21
@@ -1058,7 +1058,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
10581058

10591059
VolumeCapacityPriority: {Default: false, PreRelease: featuregate.Alpha},
10601060

1061-
UserNamespacesStatelessPodsSupport: {Default: false, PreRelease: featuregate.Alpha},
1061+
UserNamespacesSupport: {Default: false, PreRelease: featuregate.Alpha},
10621062

10631063
WinDSR: {Default: false, PreRelease: featuregate.Alpha},
10641064

Diff for: pkg/kubelet/kuberuntime/kuberuntime_container_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (m *kubeGenericRuntimeManager) applyPlatformSpecificContainerConfig(config
5555
}
5656
config.Linux = cl
5757

58-
if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.UserNamespacesStatelessPodsSupport) {
58+
if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.UserNamespacesSupport) {
5959
if cl.SecurityContext.NamespaceOptions.UsernsOptions != nil {
6060
for _, mount := range config.Mounts {
6161
mount.UidMappings = cl.SecurityContext.NamespaceOptions.UsernsOptions.Uids

Diff for: pkg/kubelet/userns/userns_manager.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func MakeUserNsManager(kl userNsPodsManager) (*UsernsManager, error) {
142142
}
143143

144144
// do not bother reading the list of pods if user namespaces are not enabled.
145-
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesStatelessPodsSupport) {
145+
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
146146
return &m, nil
147147
}
148148

@@ -258,7 +258,7 @@ func (m *UsernsManager) record(pod types.UID, from, length uint32) (err error) {
258258

259259
// Release releases the user namespace allocated to the specified pod.
260260
func (m *UsernsManager) Release(podUID types.UID) {
261-
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesStatelessPodsSupport) {
261+
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
262262
return
263263
}
264264

@@ -367,7 +367,7 @@ func (m *UsernsManager) createUserNs(pod *v1.Pod) (userNs userNamespace, err err
367367

368368
// GetOrCreateUserNamespaceMappings returns the configuration for the sandbox user namespace
369369
func (m *UsernsManager) GetOrCreateUserNamespaceMappings(pod *v1.Pod) (*runtimeapi.UserNamespace, error) {
370-
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesStatelessPodsSupport) {
370+
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
371371
return nil, nil
372372
}
373373

@@ -427,7 +427,7 @@ func (m *UsernsManager) GetOrCreateUserNamespaceMappings(pod *v1.Pod) (*runtimea
427427
// allocations with the pods actually running. It frees any user namespace
428428
// allocation for orphaned pods.
429429
func (m *UsernsManager) CleanupOrphanedPodUsernsAllocations(pods []*v1.Pod, runningPods []*kubecontainer.Pod) error {
430-
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesStatelessPodsSupport) {
430+
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesSupport) {
431431
return nil
432432
}
433433

Diff for: pkg/kubelet/userns/userns_manager_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (m *testUserNsPodsManager) ListPodsFromDisk() ([]types.UID, error) {
4040
}
4141

4242
func TestUserNsManagerAllocate(t *testing.T) {
43-
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.UserNamespacesStatelessPodsSupport, true)()
43+
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.UserNamespacesSupport, true)()
4444

4545
testUserNsPodsManager := &testUserNsPodsManager{}
4646
m, err := MakeUserNsManager(testUserNsPodsManager)
@@ -90,7 +90,7 @@ func TestUserNsManagerAllocate(t *testing.T) {
9090
}
9191

9292
func TestUserNsManagerParseUserNsFile(t *testing.T) {
93-
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.UserNamespacesStatelessPodsSupport, true)()
93+
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.UserNamespacesSupport, true)()
9494

9595
cases := []struct {
9696
name string

Diff for: test/e2e/common/node/security_context.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var _ = SIGDescribe("Security Context", func() {
7272
}
7373
}
7474

75-
ginkgo.It("must create the user namespace if set to false [LinuxOnly] [Feature:UserNamespacesStatelessPodsSupport]", func(ctx context.Context) {
75+
ginkgo.It("must create the user namespace if set to false [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
7676
// with hostUsers=false the pod must use a new user namespace
7777
podClient := e2epod.PodClientNS(f, f.Namespace.Name)
7878

@@ -110,7 +110,7 @@ var _ = SIGDescribe("Security Context", func() {
110110
}
111111
})
112112

113-
ginkgo.It("must not create the user namespace if set to true [LinuxOnly] [Feature:UserNamespacesStatelessPodsSupport]", func(ctx context.Context) {
113+
ginkgo.It("must not create the user namespace if set to true [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
114114
// with hostUsers=true the pod must use the host user namespace
115115
pod := makePod(true)
116116
// When running in the host's user namespace, the /proc/self/uid_map file content looks like:
@@ -121,7 +121,7 @@ var _ = SIGDescribe("Security Context", func() {
121121
})
122122
})
123123

124-
ginkgo.It("should mount all volumes with proper permissions with hostUsers=false [LinuxOnly] [Feature:UserNamespacesStatelessPodsSupport]", func(ctx context.Context) {
124+
ginkgo.It("should mount all volumes with proper permissions with hostUsers=false [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
125125
// Create all volume types supported: configmap, secret, downwardAPI, projected.
126126

127127
// Create configmap.
@@ -245,7 +245,7 @@ var _ = SIGDescribe("Security Context", func() {
245245
})
246246
})
247247

248-
ginkgo.It("should set FSGroup to user inside the container with hostUsers=false [LinuxOnly] [Feature:UserNamespacesStatelessPodsSupport]", func(ctx context.Context) {
248+
ginkgo.It("should set FSGroup to user inside the container with hostUsers=false [LinuxOnly] [Feature:UserNamespacesSupport]", func(ctx context.Context) {
249249
// Create configmap.
250250
name := "userns-volumes-test-" + string(uuid.NewUUID())
251251
configMap := newConfigMap(f, name)

0 commit comments

Comments
 (0)