summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-03-26 15:47:48 -0400
committerMatthew Heon <mheon@redhat.com>2021-03-29 13:54:14 -0400
commit670e1ac67c3e0afbd583dd7fda5fa94f373c1a86 (patch)
tree225b9b89866543a6965c82b50d903224985ce453 /cmd
parentac4bdd265308f549c4db775c1674077a6c669b30 (diff)
downloadpodman-670e1ac67c3e0afbd583dd7fda5fa94f373c1a86.tar.gz
podman-670e1ac67c3e0afbd583dd7fda5fa94f373c1a86.tar.bz2
podman-670e1ac67c3e0afbd583dd7fda5fa94f373c1a86.zip
[NO TESTS NEEDED] Turn on podman-remote build --isolation
Currently podman only works with --isolation chroot. This PR fixes this by allowing the isolation mode to default to OCI and to also allow users to pass the isolation mode into the containers. The current tests for --isolation should cause this code to be tested. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/images/build.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index 7db927e55..da6d556b1 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -8,7 +8,6 @@ import (
"strings"
"time"
- "github.com/containers/buildah"
"github.com/containers/buildah/define"
buildahCLI "github.com/containers/buildah/pkg/cli"
"github.com/containers/buildah/pkg/parse"
@@ -159,11 +158,11 @@ func buildFlags(cmd *cobra.Command) {
flags.SetNormalizeFunc(buildahCLI.AliasFlags)
if registry.IsRemote() {
flag = flags.Lookup("isolation")
- buildOpts.Isolation = buildah.OCI
- if err := flag.Value.Set(buildah.OCI); err != nil {
- logrus.Errorf("unable to set --isolation to %v: %v", buildah.OCI, err)
+ buildOpts.Isolation = define.OCI
+ if err := flag.Value.Set(define.OCI); err != nil {
+ logrus.Errorf("unable to set --isolation to %v: %v", define.OCI, err)
}
- flag.DefValue = buildah.OCI
+ flag.DefValue = define.OCI
_ = flags.MarkHidden("disable-content-trust")
_ = flags.MarkHidden("cache-from")
_ = flags.MarkHidden("sign-by")
@@ -427,10 +426,10 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
format := ""
flags.Format = strings.ToLower(flags.Format)
switch {
- case strings.HasPrefix(flags.Format, buildah.OCI):
- format = buildah.OCIv1ImageManifest
- case strings.HasPrefix(flags.Format, buildah.DOCKER):
- format = buildah.Dockerv2ImageManifest
+ case strings.HasPrefix(flags.Format, define.OCI):
+ format = define.OCIv1ImageManifest
+ case strings.HasPrefix(flags.Format, define.DOCKER):
+ format = define.Dockerv2ImageManifest
default:
return nil, errors.Errorf("unrecognized image type %q", flags.Format)
}