Skip to content

fix(install): return the error from NewTesting - #895

Open
Branson404 wants to merge 1 commit into
helm:mainfrom
Branson404:fix-install-newtesting-error
Open

Branson404 wants to merge 1 commit into
helm:mainfrom
Branson404:fix-install-newtesting-error

Conversation

@Branson404

Copy link
Copy Markdown

What this PR does / why we need it:

ct install printed the error returned by chart.NewTesting and then carried on. If setting up Helm fails (for example helm is not on PATH) and no charts are selected, the command can finish with exit status 0, so a CI job looks green. ct lint, ct lint-and-install and ct list-changed already return this error; this makes ct install do the same.

I added TestInstallReturnsHelmLookupError. It runs ct install --all --chart-dirs= with an empty PATH. Without the change it fails with ct install returned <nil>, want a Helm executable lookup error; with it, the error is returned.

Which issue this PR fixes: none opened.

Special notes for your reviewer:

Ran in a golang container (Go 1.27): go vet ./..., gofmt -l . (no output) and go test ./..., all packages pass. Not run: golangci-lint, the e2e script (needs a cluster), the other CI jobs. The commit is signed off (DCO), as recent merged PRs in this repo are.

ct install printed the error from chart.NewTesting and carried on, so a
failure to set up Helm (for example helm not on PATH) could end in exit
status 0 when no charts were selected. ct lint and the other commands
already return this error. Return it here too, with a regression test.

Signed-off-by: Branson404 <78994175+branson404@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant