From e1b47c15076680d318aa6fd0cb650ad89b471022 Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 27 Jun 2018 08:55:20 -0500 Subject: Vendor in latest buildah Signed-off-by: baude Closes: #1007 Approved by: baude --- .../projectatomic/buildah/pkg/cli/common.go | 4 ++++ .../projectatomic/buildah/pkg/parse/parse.go | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'vendor/github.com/projectatomic/buildah/pkg') diff --git a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go index 4a5deafca..b46e1b491 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go +++ b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go @@ -119,6 +119,10 @@ var ( Name: "iidfile", Usage: "`file` to write the image ID to", }, + cli.StringFlag{ + Name: "isolation", + Usage: "`type` of process isolation to use", + }, cli.StringSliceFlag{ Name: "label", Usage: "Set metadata for an image (default [])", diff --git a/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go b/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go index c6bd4665e..26831c7a2 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go +++ b/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go @@ -294,6 +294,7 @@ func SystemContextFromOptions(c *cli.Context) (*types.SystemContext, error) { if c.GlobalIsSet("registries-conf-dir") { ctx.RegistriesDirPath = c.GlobalString("registries-conf-dir") } + ctx.DockerRegistryUserAgent = fmt.Sprintf("Buildah/%s", buildah.Version) return ctx, nil } @@ -529,3 +530,23 @@ func NamespaceOptions(c *cli.Context) (namespaceOptions buildah.NamespaceOptions } return options, policy, nil } + +func defaultIsolation() buildah.Isolation { + isolation := os.Getenv("BUILDAH_ISOLATION") + if strings.HasPrefix(strings.ToLower(isolation), "oci") { + return buildah.IsolationOCI + } + return buildah.IsolationDefault +} + +// IsolationOption parses the --isolation flag. +func IsolationOption(c *cli.Context) (buildah.Isolation, error) { + if c.String("isolation") != "" { + if strings.HasPrefix(strings.ToLower(c.String("isolation")), "oci") { + return buildah.IsolationOCI, nil + } else { + return buildah.IsolationDefault, errors.Errorf("unrecognized isolation type %q", c.String("isolation")) + } + } + return defaultIsolation(), nil +} -- cgit v1.2.3-54-g00ecf