Pass HostNetwork value to docker container
This fixes a bug when in host value is specified in api object, but it is ignored by docker Closes: #512 Related-To: #512 Change-Id: I57e66a19124d1d0a295396491dbd22e2e2193d31
This commit is contained in:
parent
34282759af
commit
c17246b006
@ -156,6 +156,7 @@ func (c *clientV1Alpha1) runAirship() error {
|
||||
Mounts: convertDockerMount(c.conf.Spec.StorageMounts),
|
||||
EnvVars: envs,
|
||||
Input: decoratedInput,
|
||||
HostNetwork: c.conf.Spec.HostNetwork,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -51,7 +51,7 @@ type Container interface {
|
||||
// RunCommandOptions options for RunCommand
|
||||
type RunCommandOptions struct {
|
||||
Privileged bool
|
||||
HostNewtork bool
|
||||
HostNetwork bool
|
||||
|
||||
Cmd []string
|
||||
EnvVars []string
|
||||
|
@ -202,7 +202,7 @@ func (c *DockerContainer) getConfig(opts RunCommandOptions) (container.Config, c
|
||||
Mounts: mounts,
|
||||
Privileged: opts.Privileged,
|
||||
}
|
||||
if opts.HostNewtork {
|
||||
if opts.HostNetwork {
|
||||
hCfg.NetworkMode = "host"
|
||||
}
|
||||
return cCfg, hCfg, nil
|
||||
|
Loading…
Reference in New Issue
Block a user