mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
kubelet: use idmapped mounts for all volumes
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
79a34cf6a4
commit
9075404dc4
@ -54,6 +54,15 @@ func (m *kubeGenericRuntimeManager) applyPlatformSpecificContainerConfig(config
|
||||
return err
|
||||
}
|
||||
config.Linux = cl
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.UserNamespacesStatelessPodsSupport) {
|
||||
if cl.SecurityContext.NamespaceOptions.UsernsOptions != nil {
|
||||
for _, mount := range config.Mounts {
|
||||
mount.UidMappings = cl.SecurityContext.NamespaceOptions.UsernsOptions.Uids
|
||||
mount.GidMappings = cl.SecurityContext.NamespaceOptions.UsernsOptions.Gids
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user