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

ensure we can remove _output #117510

Merged
merged 1 commit into from Apr 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/common.sh
Expand Up @@ -367,6 +367,8 @@ function kube::build::clean() {

if [[ -d "${LOCAL_OUTPUT_ROOT}" ]]; then
kube::log::status "Removing _output directory"
# this ensures we can clean _output/local/go/cache which is not rw by default
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because we go install in module mode with GOPATH under _output, creating these non-writeable module cache files. We could make make clean aware of the go module path but ... that's a bit messy.

I think it generically makes sense to ensure the directory is recursively writeable before trying to remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting!!

chmod -R +w "${LOCAL_OUTPUT_ROOT}"
rm -rf "${LOCAL_OUTPUT_ROOT}"
fi
}
Expand Down