Repository navigation
feat(infrahub): allow extra arguments on the upgrade job command - #82
Merged
Merged
Conversation
The upgrade hook job hardcodes command: ["infrahub", "upgrade"], so none of the upgrade CLI options can be set through the chart. In particular, step 6/6 of the upgrade pipeline (branch rebase) only writes when --rebase-branches is passed, and migrations of type MigrationRequiringRebase leave every open branch unusable until rebased. Helm users currently have to exec into a pod and rerun the command manually after the hook job completes. Add upgrade.extraArgs (empty by default) rendered as the container args, e.g. ["--rebase-branches"]. Default rendering is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
The upgrade hook job hardcodes
command: ["infrahub", "upgrade"], so none of the upgrade CLI options can be set through the chart. In particular, step 6/6 of the upgrade pipeline (branch rebase) only writes when--rebase-branchesis passed, and migrations of typeMigrationRequiringRebaseleave every open branch unusable until rebased — Helm users currently have to exec into a pod and rerun the command manually after the hook job completes.Key Changes
Operators can now pass arguments to the
infrahub upgradecommand run by the upgrade job (whenupgrade.enabledis true) via a newupgrade.extraArgsvalue, e.g.:Default rendering is unchanged:
extraArgsdefaults to[]and noargskey is emitted when it is empty.Chart README regenerated (helm-docs) and changelog fragment added.
Related Context
--rebase-branchesTest Plan
helm lint charts/infrahubpasses.helm template test charts/infrahub --set upgrade.enabled=true --set 'upgrade.extraArgs={--rebase-branches}' --show-only templates/infrahub-upgrade-job.yamlrendersargs: [--rebase-branches]on the container.extraArgsproduces the exact output as before this change.🤖 Generated with Claude Code