summaryrefslogtreecommitdiff
path: root/vendor/github.com/openshift/imagebuilder/dispatchers.go
diff options
context:
space:
mode:
authorTomSweeneyRedHat <tsweeney@redhat.com>2019-02-21 15:38:58 -0500
committerTomSweeneyRedHat <tsweeney@redhat.com>2019-02-22 16:40:05 -0500
commitff0b4652efe4c502459d88fa6743168c6113244f (patch)
tree073484971fe2b943ab4ddde80d88420f2ac8603a /vendor/github.com/openshift/imagebuilder/dispatchers.go
parent4d9f4cf71c79639da451a12a9e1d1d824bd15a9f (diff)
downloadpodman-ff0b4652efe4c502459d88fa6743168c6113244f.tar.gz
podman-ff0b4652efe4c502459d88fa6743168c6113244f.tar.bz2
podman-ff0b4652efe4c502459d88fa6743168c6113244f.zip
Vendor Buildah v1.7
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com> Vendors in Buildah 1.7 into Podman. Also the latest imagebuilder and changes for `build --target` Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Diffstat (limited to 'vendor/github.com/openshift/imagebuilder/dispatchers.go')
-rw-r--r--vendor/github.com/openshift/imagebuilder/dispatchers.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/vendor/github.com/openshift/imagebuilder/dispatchers.go b/vendor/github.com/openshift/imagebuilder/dispatchers.go
index f6510c2fd..ff365848a 100644
--- a/vendor/github.com/openshift/imagebuilder/dispatchers.go
+++ b/vendor/github.com/openshift/imagebuilder/dispatchers.go
@@ -128,9 +128,20 @@ func add(b *Builder, args []string, attributes map[string]bool, flagArgs []strin
if len(args) < 2 {
return errAtLeastOneArgument("ADD")
}
+ var chown string
last := len(args) - 1
dest := makeAbsolute(args[last], b.RunConfig.WorkingDir)
- b.PendingCopies = append(b.PendingCopies, Copy{Src: args[0:last], Dest: dest, Download: true})
+ if len(flagArgs) > 0 {
+ for _, arg := range flagArgs {
+ switch {
+ case strings.HasPrefix(arg, "--chown="):
+ chown = strings.TrimPrefix(arg, "--chown=")
+ default:
+ return fmt.Errorf("ADD only supports the --chown=<uid:gid> flag")
+ }
+ }
+ }
+ b.PendingCopies = append(b.PendingCopies, Copy{Src: args[0:last], Dest: dest, Download: true, Chown: chown})
return nil
}