mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 23:57:49 +00:00
Merge pull request #43890 from xlgao-zju/more-robust
Automatic merge from submit-queue Make func modifySandboxNamespaceOptions() more robust Make func `modifySandboxNamespaceOptions()` more robust, just like what we do in func [`modifyContainerNamespaceOptions`](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/dockershim/security_context.go#L117). /cc @feiskyer Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
This commit is contained in:
commit
8dde5f2cb0
@ -109,8 +109,12 @@ func modifyHostConfig(sc *runtimeapi.LinuxContainerSecurityContext, hostConfig *
|
||||
|
||||
// modifySandboxNamespaceOptions apply namespace options for sandbox
|
||||
func modifySandboxNamespaceOptions(nsOpts *runtimeapi.NamespaceOption, hostConfig *dockercontainer.HostConfig, network *knetwork.PluginManager) {
|
||||
hostNetwork := false
|
||||
if nsOpts != nil {
|
||||
hostNetwork = nsOpts.HostNetwork
|
||||
}
|
||||
modifyCommonNamespaceOptions(nsOpts, hostConfig)
|
||||
modifyHostNetworkOptionForSandbox(nsOpts.HostNetwork, network, hostConfig)
|
||||
modifyHostNetworkOptionForSandbox(hostNetwork, network, hostConfig)
|
||||
}
|
||||
|
||||
// modifyContainerNamespaceOptions apply namespace options for container
|
||||
|
Loading…
Reference in New Issue
Block a user