summaryrefslogtreecommitdiff
path: root/vendor/github.com/openshift/imagebuilder/builder.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-03-29 07:31:23 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-04-08 09:02:52 -0400
commitdc17195bd9d1027b19c3e7f0975f17f4ebda408a (patch)
tree223a7caf22ee81fbd6a01d166c0821db4d413616 /vendor/github.com/openshift/imagebuilder/builder.go
parentf838333b7e6fae09f3ee9116b84c6e6482367298 (diff)
downloadpodman-dc17195bd9d1027b19c3e7f0975f17f4ebda408a.tar.gz
podman-dc17195bd9d1027b19c3e7f0975f17f4ebda408a.tar.bz2
podman-dc17195bd9d1027b19c3e7f0975f17f4ebda408a.zip
Vendor in new opencontainers/selinux
Also update vendor of containers/common,buildah,storage,image Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2069586 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/openshift/imagebuilder/builder.go')
-rw-r--r--vendor/github.com/openshift/imagebuilder/builder.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/vendor/github.com/openshift/imagebuilder/builder.go b/vendor/github.com/openshift/imagebuilder/builder.go
index b0e9d4f51..71dc41ea5 100644
--- a/vendor/github.com/openshift/imagebuilder/builder.go
+++ b/vendor/github.com/openshift/imagebuilder/builder.go
@@ -44,6 +44,7 @@ type Run struct {
type Executor interface {
Preserve(path string) error
EnsureContainerPath(path string) error
+ EnsureContainerPathAs(path, user string, mode *os.FileMode) error
Copy(excludes []string, copies ...Copy) error
Run(run Run, config docker.Config) error
UnrecognizedInstruction(step *Step) error
@@ -61,6 +62,15 @@ func (logExecutor) EnsureContainerPath(path string) error {
return nil
}
+func (logExecutor) EnsureContainerPathAs(path, user string, mode *os.FileMode) error {
+ if mode != nil {
+ log.Printf("ENSURE %s AS %q with MODE=%q", path, user, *mode)
+ } else {
+ log.Printf("ENSURE %s AS %q", path, user)
+ }
+ return nil
+}
+
func (logExecutor) Copy(excludes []string, copies ...Copy) error {
for _, c := range copies {
log.Printf("COPY %v -> %s (from:%s download:%t), chown: %s, chmod %s", c.Src, c.Dest, c.From, c.Download, c.Chown, c.Chmod)
@@ -88,6 +98,10 @@ func (noopExecutor) EnsureContainerPath(path string) error {
return nil
}
+func (noopExecutor) EnsureContainerPathAs(path, user string, mode *os.FileMode) error {
+ return nil
+}
+
func (noopExecutor) Copy(excludes []string, copies ...Copy) error {
return nil
}
@@ -378,7 +392,7 @@ func (b *Builder) Run(step *Step, exec Executor, noRunsRemaining bool) error {
}
if len(b.RunConfig.WorkingDir) > 0 {
- if err := exec.EnsureContainerPath(b.RunConfig.WorkingDir); err != nil {
+ if err := exec.EnsureContainerPathAs(b.RunConfig.WorkingDir, b.RunConfig.User, nil); err != nil {
return err
}
}