aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/pkg/parse/parse.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/pkg/parse/parse.go21
1 files changed, 21 insertions, 0 deletions
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
+}