Skip to content

Commit

Permalink
CI: fix rootless permission error
Browse files Browse the repository at this point in the history
CI runs are failing in special_testing_rootless:

    mkdir /var/tmp/go/pkg: permission denied

Probable cause: containers#6822, which universally set GOPATH.

Solution: in rootless setup, chown -R GOPATH as well
as GOSRC (the latter was already being chowned).

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed Jul 23, 2020
1 parent 1aac197 commit 8111524
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@ is_release() {
}

setup_rootless() {
req_env_var ROOTLESS_USER GOSRC SECRET_ENV_RE ROOTLESS_ENV_RE
req_env_var ROOTLESS_USER GOPATH GOSRC SECRET_ENV_RE ROOTLESS_ENV_RE

# Only do this once
if passwd --status $ROOTLESS_USER
then
echo "Updating $ROOTLESS_USER user permissions on possibly changed libpod code"
chown -R $ROOTLESS_USER:$ROOTLESS_USER "$GOSRC"
chown -R $ROOTLESS_USER:$ROOTLESS_USER "$GOPATH" "$GOSRC"
return 0
fi

Expand All @@ -316,7 +316,7 @@ setup_rootless() {
echo "creating $ROOTLESS_UID:$ROOTLESS_GID $ROOTLESS_USER user"
groupadd -g $ROOTLESS_GID $ROOTLESS_USER
useradd -g $ROOTLESS_GID -u $ROOTLESS_UID --no-user-group --create-home $ROOTLESS_USER
chown -R $ROOTLESS_USER:$ROOTLESS_USER "$GOSRC"
chown -R $ROOTLESS_USER:$ROOTLESS_USER "$GOPATH" "$GOSRC"

echo "creating ssh keypair for $USER"
[[ -r "$HOME/.ssh/id_rsa" ]] || \
Expand Down

0 comments on commit 8111524

Please sign in to comment.