Merge "Pass HostNetwork value to docker container"
This commit is contained in:
commit
7bc47c8a34
@ -151,11 +151,12 @@ func (c *clientV1Alpha1) runAirship() error {
|
||||
c.conf.Spec.Image,
|
||||
c.conf.Spec.Airship.Cmd)
|
||||
err = cont.RunCommand(RunCommandOptions{
|
||||
Privileged: c.conf.Spec.Airship.Privileged,
|
||||
Cmd: c.conf.Spec.Airship.Cmd,
|
||||
Mounts: convertDockerMount(c.conf.Spec.StorageMounts),
|
||||
EnvVars: envs,
|
||||
Input: decoratedInput,
|
||||
Privileged: c.conf.Spec.Airship.Privileged,
|
||||
Cmd: c.conf.Spec.Airship.Cmd,
|
||||
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…
x
Reference in New Issue
Block a user