mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
kubelet: Don't reserve mapping for userns phase II
Latest changes to KEP-127 removed that phase, so let's stop reserving those IDs for that. While we are there, we replace 0 for 0*65536 as before we had a bug that we were not multiplying the index, to avoid bugs in the future. Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
parent
8af3cce7fe
commit
16d76f6813
@ -141,11 +141,6 @@ func MakeUserNsManager(kl userNsPodsManager) (*usernsManager, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Second block will be used for phase II. Don't assign that range for now.
|
||||
if _, err := m.used.Allocate(1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// do not bother reading the list of pods if user namespaces are not enabled.
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.UserNamespacesStatelessPodsSupport) {
|
||||
return &m, nil
|
||||
|
@ -46,8 +46,7 @@ func TestUserNsManagerAllocate(t *testing.T) {
|
||||
m, err := MakeUserNsManager(testUserNsPodsManager)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, true, m.isSet(0), "m.isSet(0) should be true")
|
||||
assert.Equal(t, true, m.isSet(1), "m.isSet(1) should be true")
|
||||
assert.Equal(t, true, m.isSet(0*65536), "m.isSet(0) should be true")
|
||||
|
||||
allocated, length, err := m.allocateOne("one")
|
||||
assert.NoError(t, err)
|
||||
|
Loading…
Reference in New Issue
Block a user