mirror of
https://github.com/containers/podman.git
synced 2025-09-25 15:55:32 +08:00
Vendor in latest buildah and imagebuilder
We want to add the latest support for COPY --chown UID:GID. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1289 Approved by: TomSweeneyRedHat
This commit is contained in:

committed by
Atomic Bot

parent
89a9750b6d
commit
57e1600315
7
vendor/github.com/openshift/imagebuilder/dispatchers.go
generated
vendored
7
vendor/github.com/openshift/imagebuilder/dispatchers.go
generated
vendored
@ -149,18 +149,21 @@ func dispatchCopy(b *Builder, args []string, attributes map[string]bool, flagArg
|
||||
}
|
||||
last := len(args) - 1
|
||||
dest := makeAbsolute(args[last], b.RunConfig.WorkingDir)
|
||||
var chown string
|
||||
var from string
|
||||
if len(flagArgs) > 0 {
|
||||
for _, arg := range flagArgs {
|
||||
switch {
|
||||
case strings.HasPrefix(arg, "--chown="):
|
||||
chown = strings.TrimPrefix(arg, "--chown=")
|
||||
case strings.HasPrefix(arg, "--from="):
|
||||
from = strings.TrimPrefix(arg, "--from=")
|
||||
default:
|
||||
return fmt.Errorf("COPY only supports the --from=<image|stage> flag")
|
||||
return fmt.Errorf("COPY only supports the --chown=<uid:gid> and the --from=<image|stage> flags")
|
||||
}
|
||||
}
|
||||
}
|
||||
b.PendingCopies = append(b.PendingCopies, Copy{From: from, Src: args[0:last], Dest: dest, Download: false})
|
||||
b.PendingCopies = append(b.PendingCopies, Copy{From: from, Src: args[0:last], Dest: dest, Download: false, Chown: chown})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user