mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	kubelet: set user namespace options
Set the user namespace options to use for the pod. Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
		@@ -100,9 +100,15 @@ func PidNamespaceForPod(pod *v1.Pod) runtimeapi.NamespaceMode {
 | 
			
		||||
// namespacesForPod returns the runtimeapi.NamespaceOption for a given pod.
 | 
			
		||||
// An empty or nil pod can be used to get the namespace defaults for v1.Pod.
 | 
			
		||||
func NamespacesForPod(pod *v1.Pod, runtimeHelper kubecontainer.RuntimeHelper) (*runtimeapi.NamespaceOption, error) {
 | 
			
		||||
	userNs, err := runtimeHelper.GetOrCreateUserNamespaceMappings(pod)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return &runtimeapi.NamespaceOption{
 | 
			
		||||
		Ipc:           IpcNamespaceForPod(pod),
 | 
			
		||||
		Network:       NetworkNamespaceForPod(pod),
 | 
			
		||||
		Pid:           PidNamespaceForPod(pod),
 | 
			
		||||
		UsernsOptions: userNs,
 | 
			
		||||
	}, nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user