kubelet: add GetUserNamespaceMappings to RuntimeHelper
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
63462285d5
commit
9b2fc639a0
@ -56,6 +56,9 @@ type RuntimeHelper interface {
|
|||||||
// supplemental groups for the Pod. These extra supplemental groups come
|
// supplemental groups for the Pod. These extra supplemental groups come
|
||||||
// from annotations on persistent volumes that the pod depends on.
|
// from annotations on persistent volumes that the pod depends on.
|
||||||
GetExtraSupplementalGroupsForPod(pod *v1.Pod) []int64
|
GetExtraSupplementalGroupsForPod(pod *v1.Pod) []int64
|
||||||
|
|
||||||
|
// GetOrCreateUserNamespaceMappings returns the configuration for the sandbox user namespace
|
||||||
|
GetOrCreateUserNamespaceMappings(pod *v1.Pod) (*runtimeapi.UserNamespace, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShouldContainerBeRestarted checks whether a container needs to be restarted.
|
// ShouldContainerBeRestarted checks whether a container needs to be restarted.
|
||||||
|
@ -65,3 +65,7 @@ func (f *FakeRuntimeHelper) GetPodDir(podUID kubetypes.UID) string {
|
|||||||
func (f *FakeRuntimeHelper) GetExtraSupplementalGroupsForPod(pod *v1.Pod) []int64 {
|
func (f *FakeRuntimeHelper) GetExtraSupplementalGroupsForPod(pod *v1.Pod) []int64 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *FakeRuntimeHelper) GetOrCreateUserNamespaceMappings(pod *v1.Pod) (*runtimeapi.UserNamespace, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
@ -420,6 +420,11 @@ func truncatePodHostnameIfNeeded(podName, hostname string) (string, error) {
|
|||||||
return truncated, nil
|
return truncated, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetOrCreateUserNamespaceMappings returns the configuration for the sandbox user namespace
|
||||||
|
func (kl *Kubelet) GetOrCreateUserNamespaceMappings(pod *v1.Pod) (*runtimeapi.UserNamespace, error) {
|
||||||
|
return kl.usernsManager.GetOrCreateUserNamespaceMappings(pod)
|
||||||
|
}
|
||||||
|
|
||||||
// GeneratePodHostNameAndDomain creates a hostname and domain name for a pod,
|
// GeneratePodHostNameAndDomain creates a hostname and domain name for a pod,
|
||||||
// given that pod's spec and annotations or returns an error.
|
// given that pod's spec and annotations or returns an error.
|
||||||
func (kl *Kubelet) GeneratePodHostNameAndDomain(pod *v1.Pod) (string, string, error) {
|
func (kl *Kubelet) GeneratePodHostNameAndDomain(pod *v1.Pod) (string, string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user