Skip to content

Commit

Permalink
Make buildah run --isolation follow BUILDAH_ISOLATION environment
Browse files Browse the repository at this point in the history
Currently buildah run ignores the variable.

Signed-off-by: Daniel J Walsh <[email protected]>

Closes: #1587
Approved by: vrothberg
  • Loading branch information
rhatdan authored and rh-atomic-bot committed May 14, 2019
1 parent 7ae362b commit 398b08f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cmd/buildah/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func init() {
flags.StringSliceVar(&opts.capAdd, "cap-add", []string{}, "add the specified capability (default []")
flags.StringSliceVar(&opts.capDrop, "cap-drop", []string{}, "drop the specified capability (default [])")
flags.StringVar(&opts.hostname, "hostname", "", "set the hostname inside of the container")
flags.StringVar(&opts.isolation, "isolation", "", "which process isolation `type` to use")
flags.StringVar(&opts.isolation, "isolation", buildahcli.DefaultIsolation(), "`type` of process isolation to use. Use BUILDAH_ISOLATION environment variable to override.")
flags.StringVar(&opts.runtime, "runtime", util.Runtime(), "`path` to an alternate OCI runtime")
flags.StringSliceVar(&opts.runtimeFlag, "runtime-flag", []string{}, "add global flags for the container runtime")
flags.BoolVar(&opts.noPivot, "no-pivot", false, "do not use pivot root to jail process inside rootfs")
Expand Down Expand Up @@ -103,12 +103,9 @@ func runCmd(c *cobra.Command, args []string, iopts runInputOptions) error {
return errors.Wrapf(err, "error reading build container %q", name)
}

isolation := builder.Isolation
if c.Flag("isolation").Changed {
isolation, err = parse.IsolationOption(c)
if err != nil {
return err
}
isolation, err := parse.IsolationOption(c)
if err != nil {
return err
}

runtimeFlags := []string{}
Expand Down

0 comments on commit 398b08f

Please sign in to comment.