fix(gitops-update): install kustomize without sudo, mirroring the yq pattern#612
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughThe GitOps workflow now installs kustomize in ChangesGitOps workflow tooling
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Contributor
🔍 PR Validation Summary✅ PR Mergeable — no blocking failures
|
Contributor
🔍 Lint Analysis
|
Contributor
🛡️ CodeQL Analysis ResultsLanguages analyzed: Found 2 issue(s): 2 Medium
🔍 View full scan logs | 🛡️ Security tab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Actions Shared Workflows
Description
The
Install kustomizestep ingitops-update.ymlusedsudo install -m 755 /tmp/kustomize /usr/local/bin/kustomize, which assumessudois available on the runner. Theupdate_gitopsjob runs on${{ vars.GITOPS_RUNNERS || 'blacksmith-4vcpu-ubuntu-2404' }}, and the organization's self-hosted pool has nosudo— the step fails withsudo: command not found.This caused a real production failure: in
LerianStudio/ungoliant-controller, thev2.1.0-beta.10release (run 30110283556) built and pushed the image successfully, butupdate_gitopsfailed at this step, cascading into a cancelled ArgoCD Sync — the image was never reconciled into the cluster.The fix mirrors the pattern already used by the two other binary installers in the same file (
Install yq, lines 224-240, and theargocdCLI install, line ~913): install into a user-writable directory and export it via$GITHUB_PATH, so no elevated privileges and no write to/usr/local/binare needed.The existing comment explaining the
kustomize/vX.Y.Ztag URL-encoding (a separate historical bug) is preserved untouched.Repo-wide
sudoaudit — the remainingsudousages were reviewed and intentionally left as-is:gitops-update.yml:258sudo install ... /usr/local/bin/kustomizego-pr-analysis.yml(6 occurrences)sudo apt-get installofinputs.system_packagesGENERAL_RUNNERSpool, and arbitrary apt packages have no~/.local/binequivalentsrc/lint/{shellcheck,composite-schema,deployment-matrix}sudo apt-get install(shellcheck, python3-yaml)self-*workflows in this repo, on blacksmith runnersgitops-update.ymlnow contains zerosudoinvocations.Type of Change
feat: New workflow or new input/output/step in an existing workflowfix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)perf: Performance improvement (e.g. caching, parallelism, reduced steps)refactor: Internal restructuring with no behavior changedocs: Documentation only (README, docs/, inline comments)ci: Changes to self-CI (workflows under.github/workflows/that run on this repo)chore: Dependency bumps, config updates, maintenancetest: Adding or updating testsBREAKING CHANGE: Callers must update their configuration after this PRBreaking Changes
None. No input, output, or secret changed. Only the installation path of the
kustomizebinary changed — it is exported via$GITHUB_PATH, so all subsequent steps resolve it identically. The new path also works on GitHub-hosted and blacksmith runners, so no caller sees a behavior difference.Testing
@this-branchor the beta tagNotes on what was and was not verified:
if: inputs.gitops_layout == 'kustomize', unchanged —helmfilecallers are unaffected.sudo-less self-hosted pool, which cannot be reached from a branch-pinned test without a released tag. End-to-end confirmation requires merge + a new tag, then bumpingungoliant-controller's pin in.github/workflows/release.ymlfrom@v1.47.4to the new tag and re-triggering thev2.1.0-beta.10release to confirmupdate_gitopsand the ArgoCD Sync both complete.Caller repo / workflow run: ungoliant-controller run 30110283556 — this is the failing run that surfaced the bug, not a validation of the fix.
Related Issues
None.