Repository navigation
Include ytt overlays in kctrl package install dry-run output - #1877
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
`kctrl package install --dry-run` returned before the `--ytt-overlay-file` flag was processed, so the printed resources silently omitted the overlays Secret and the PackageInstall annotation referencing it. Piping the output into kapp or ytt therefore produced an installation without the requested overlays. When overlay files are supplied (and `--ytt-overlays` is not disabled), build the same overlays Secret that a regular install creates and print it along with the other resources, and add the `ext.packaging.carvel.dev/ytt-paths-from-secret-name.kctrl-ytt-overlays` annotation to the PackageInstall. As with the values Secret, overlay contents are rendered under stringData so the output stays readable. Extend the package install dry-run e2e test to cover overlays supplied via `--ytt-overlay-file`. Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
This branch has not been deployed
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.
What this PR does / why we need it:
kctrl package install --dry-runreturns before--ytt-overlay-fileis processed, so the printed resources silently omit the overlays Secret and the PackageInstall annotation that references it. Piping the output intokapp/ytttherefore produces an installation without the requested overlays.With this change, when overlay files are supplied (and
--ytt-overlaysis not set tofalse), the dry-run:<name>-<namespace>-overlaysSecret that a regular install creates (built via the existingYttOverlays.OverlaysSecret()), withnamespaceset like the other printed resourcesext.packaging.carvel.dev/ytt-paths-from-secret-name.kctrl-ytt-overlaysannotation to the PackageInstallLike the values Secret in the dry-run output, overlay contents are rendered under
stringDataso the output stays readable.Which issue(s) this PR fixes:
Fixes #1389
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
TestPackageInstallDryRun(cli e2e) with a section that passes an overlay via--ytt-overlay-file -. The section fails without the fix and passes with it. The dry-run e2e tests do not talk to a cluster, so I ran them locally withKCTRL_E2E_NAMESPACE=kctrl-test.--ytt-overlays=false(no overlays printed), a missing file (returns an error), and that--dry-run --tty=false | ytt -f -parses the output.Review Checklist:
a link to that PR
change
Additional documentation e.g., Proposal, usage docs, etc.: