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

chore: Install toolchain files to location provided in KUBEBUILDER_ASSETS if set #7238

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

javanthropus
Copy link
Contributor

Also use sudo only when necessary to create the location

Fixes #N/A

Description

This allows the installation of toolchain files to an arbitrary path by setting the KUBEBUILDER_ASSETS environment variable. This was done in order to avoid the use of sudo in order to create and use a system path. Backward compatibility with the original method is preserved.

How was this change tested?

I ran make toolchain both with and without setting the KUBEBUILDER_ASSETS environment variable. Without it set, the default location of /usr/local/kubebuilder/bin was used and I was prompted for my password by sudo. With it set to a path under my home directory, the indicated path was created without needing sudo, and all toolchain content was copied into place.

I then ran make test with KUBEBUILDER_ASSETS set to the path in my home directory and /usr/local/kubebuilder deleted to prove that everything still works.

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@javanthropus javanthropus requested a review from a team as a code owner October 16, 2024 23:13
Copy link

netlify bot commented Oct 16, 2024

Deploy Preview for karpenter-docs-prod ready!

Name Link
🔨 Latest commit 84514b7
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/67b897fd2b090d0008c2c831
😎 Deploy Preview https://deploy-preview-7238--karpenter-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Nov 1, 2024

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@javanthropus
Copy link
Contributor Author

Someone please take a few minutes to review and merge this very trivial MR.

@rschalo
Copy link
Contributor

rschalo commented Feb 20, 2025

/reopen

@rschalo rschalo reopened this Feb 20, 2025
@javanthropus javanthropus force-pushed the avoid-sudo-for-toolchain branch from 0380a68 to f861e2c Compare February 20, 2025 17:14
jonathan-innis
jonathan-innis previously approved these changes Feb 21, 2025
Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jonathan-innis jonathan-innis enabled auto-merge (squash) February 21, 2025 14:57
… set

Also use sudo only when necessary to create the location
auto-merge was automatically disabled February 21, 2025 15:12

Head branch was pushed to by a user without write access

@javanthropus javanthropus force-pushed the avoid-sudo-for-toolchain branch from f861e2c to 84514b7 Compare February 21, 2025 15:12
@javanthropus
Copy link
Contributor Author

Somehow my previous commit removed the execute bit from the hack/toolchain.sh script. I fixed that and added some quotes within the script for better reliability.

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jonathan-innis jonathan-innis enabled auto-merge (squash) March 6, 2025 01:47
@coveralls
Copy link

coveralls commented Mar 6, 2025

Pull Request Test Coverage Report for Build 13459660354

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 65.215%

Files with Coverage Reduction New Missed Lines %
pkg/fake/utils.go 2 94.81%
Totals Coverage Status
Change from base Build 13447487814: -0.02%
Covered Lines: 5977
Relevant Lines: 9165

💛 - Coveralls

@jonathan-innis jonathan-innis merged commit 0159dd5 into aws:main Mar 6, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants