Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,17 @@ func main() {
flags.BoolVar(&useNewgidmap, "use-newgidmap", os.Geteuid() != 0, "use newgidmap to set up GID mappings")
wrapped := command.Run
command.Run = func(c *cobra.Command, args []string) {
storeOptions, err := storage.DefaultStoreOptions(false, 0)
kcmdutil.CheckErr(err)
os.MkdirAll(storeOptions.GraphRoot, 0775)
os.MkdirAll(storeOptions.RunRoot, 0775)
maybeReexecUsingUserNamespace(uidmap, useNewuidmap, gidmap, useNewgidmap)
wrapped(c, args)
switch basename {
case "openshift-sti-build", "openshift-docker-build", "openshift-extract-image-content":
storeOptions, err := storage.DefaultStoreOptions(false, 0)
kcmdutil.CheckErr(err)
os.MkdirAll(storeOptions.GraphRoot, 0775)
os.MkdirAll(storeOptions.RunRoot, 0775)
maybeReexecUsingUserNamespace(uidmap, useNewuidmap, gidmap, useNewgidmap)
wrapped(c, args)
default:
wrapped(c, args)
}
}

if err := command.Execute(); err != nil {
Expand All @@ -100,9 +105,9 @@ func CommandFor(basename string) *cobra.Command {
cmd = NewCommandS2IBuilder(basename)
case "openshift-docker-build", "openshift-docker-build-in-a-user-namespace":
cmd = NewCommandDockerBuilder(basename)
case "openshift-git-clone", "openshift-git-clone-in-a-user-namespace":
case "openshift-git-clone":
cmd = NewCommandGitClone(basename)
case "openshift-manage-dockerfile", "openshift-manage-dockerfile-in-a-user-namespace":
case "openshift-manage-dockerfile":
cmd = NewCommandManageDockerfile(basename)
case "openshift-extract-image-content", "openshift-extract-image-content-in-a-user-namespace":
cmd = NewCommandExtractImageContent(basename)
Expand Down
2 changes: 2 additions & 0 deletions pkg/build/builder/transient_mounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package builder

import (
"fmt"
"sort"
"strings"
)

Expand Down Expand Up @@ -75,6 +76,7 @@ func (t TransientMounts) asSlice() []string {
for _, m := range t {
mounts = append(mounts, m.String())
}
sort.Strings(mounts)
return mounts
}

Expand Down