mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
make func modifySandboxNamespaceOptions() more robust
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
This commit is contained in:
parent
58d2d9ade1
commit
e5b3e0879d
@ -109,8 +109,12 @@ func modifyHostConfig(sc *runtimeapi.LinuxContainerSecurityContext, hostConfig *
|
|||||||
|
|
||||||
// modifySandboxNamespaceOptions apply namespace options for sandbox
|
// modifySandboxNamespaceOptions apply namespace options for sandbox
|
||||||
func modifySandboxNamespaceOptions(nsOpts *runtimeapi.NamespaceOption, hostConfig *dockercontainer.HostConfig, network *knetwork.PluginManager) {
|
func modifySandboxNamespaceOptions(nsOpts *runtimeapi.NamespaceOption, hostConfig *dockercontainer.HostConfig, network *knetwork.PluginManager) {
|
||||||
|
hostNetwork := false
|
||||||
|
if nsOpts != nil {
|
||||||
|
hostNetwork = nsOpts.HostNetwork
|
||||||
|
}
|
||||||
modifyCommonNamespaceOptions(nsOpts, hostConfig)
|
modifyCommonNamespaceOptions(nsOpts, hostConfig)
|
||||||
modifyHostNetworkOptionForSandbox(nsOpts.HostNetwork, network, hostConfig)
|
modifyHostNetworkOptionForSandbox(hostNetwork, network, hostConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
// modifyContainerNamespaceOptions apply namespace options for container
|
// modifyContainerNamespaceOptions apply namespace options for container
|
||||||
|
Loading…
Reference in New Issue
Block a user