Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Wrap use of skopeo to avoid its unwanted side effects. (#570)
2 things are fixed here. 1. Running skopeo as root creates /run/containers with 700 permissions. That causes a problem when you run skopeo as root and then run stacker as non-root. The error would look like this: > error: initializing source ... getting username and password: 1 error occurred: > * reading JSON file "/run/containers/0/auth.json": > open /run/containers/0/auth.json: permission denied > couldn't import base layer base > stackerbuild.io/stacker/pkg/stacker.importContainersImage > /stacker-tree/pkg/stacker/base.go:141 > stackerbuild.io/stacker/pkg/stacker.GetBase > /stacker-tree/pkg/stacker/base.go:49 > stackerbuild.io/stacker/pkg/stacker.(*Builder).build > /stacker-tree/pkg/stacker/build.go:407 > stackerbuild.io/stacker/pkg/stacker.(*Builder).BuildMultiple > /stacker-tree/pkg/stacker/build.go:622 > main.doBuild 2. skopeo copy containers-registry populates ~/.local/share/containers/ This is an unwanted side effect of running the test. Further annoying is that it ends up getting directories with 555 perms on them. That means rm -Rf .local/share/containers/storage/vfs-layers will fail like: rm: cannot remove '.local/share/containers/storage/vfs/dir/HASH': Permission denied We don't want someone's HOME getting populated with artifacts from stacker test, and there are probably also race conditions here in that we run stacker tests in parallel. Signed-off-by: Scott Moser <[email protected]>
- Loading branch information