Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix mkdir /home/vscode/go/pkg: permission denied #14162

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

MasonM
Copy link
Member

@MasonM MasonM commented Feb 9, 2025

Motivation

When rebuilding the dev container, I'm getting the following:

Running the postCreateCommand from devcontainer.json...

[12542 ms] Start: Run in container: /bin/sh -c .devcontainer/pre-build.sh
<SNIP>
+ make kit
GIT_COMMIT=a776b4583972625541a358b3c9a2e1fdc0925763 GIT_BRANCH=main GIT_TAG=untagged GIT_TREE_STATE=dirty RELEASE_TAG=false DEV_BRANCH=false VERSION=latest
KUBECTX=k3d-k3s-default K3D=true DOCKER_PUSH=false TARGET_PLATFORM=linux/amd64
RUN_MODE=local PROFILE=minimal AUTH_MODE=hybrid SECURE=false  STATIC_FILES=true ALWAYS_OFFLOAD_NODE_STATUS=false UPPERIO_DB_DEBUG=0 LOG_LEVEL=debug NAMESPACED=true
go install github.com/kitproj/[email protected]
go: go: could not create module cache: mkdir /home/vscode/go/pkg: permission denied
make: *** [Makefile:535: kit] Error 1
[21801 ms] postCreateCommand from devcontainer.json failed with exit code 2. Skipping any further user-provided commands.

This causes the rest of pre-build.sh to be skipped, which means the container will be missing kit

Modifications

I think this was introduced with #14105, and the fix is to move make kit to be after the chown lines.

Verification

Rebuilt dev container locally

Documentation

N/A

When rebuilding the dev container, I'm getting the following:
```
Running the postCreateCommand from devcontainer.json...

[12542 ms] Start: Run in container: /bin/sh -c .devcontainer/pre-build.sh
<SNIP>
+ make kit
GIT_COMMIT=a776b4583972625541a358b3c9a2e1fdc0925763 GIT_BRANCH=main GIT_TAG=untagged GIT_TREE_STATE=dirty RELEASE_TAG=false DEV_BRANCH=false VERSION=latest
KUBECTX=k3d-k3s-default K3D=true DOCKER_PUSH=false TARGET_PLATFORM=linux/amd64
RUN_MODE=local PROFILE=minimal AUTH_MODE=hybrid SECURE=false  STATIC_FILES=true ALWAYS_OFFLOAD_NODE_STATUS=false UPPERIO_DB_DEBUG=0 LOG_LEVEL=debug NAMESPACED=true
go install github.com/kitproj/[email protected]
go: go: could not create module cache: mkdir /home/vscode/go/pkg: permission denied
make: *** [Makefile:535: kit] Error 1
[21801 ms] postCreateCommand from devcontainer.json failed with exit code 2. Skipping any further user-provided commands.
```

I think this was introduced with
argoproj#14105, and the fix is to
move `make kit` to be after the `chown` lines.

Signed-off-by: Mason Malone <[email protected]>
@MasonM MasonM marked this pull request as ready for review February 9, 2025 02:54
@MasonM MasonM requested a review from alexec February 9, 2025 02:54
@alexec alexec merged commit 96789ae into argoproj:main Feb 10, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants