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

feat: helm dependency build on render #8486

Merged
merged 1 commit into from
Mar 29, 2023
Merged

feat: helm dependency build on render #8486

merged 1 commit into from
Mar 29, 2023

Conversation

dsiebel
Copy link
Contributor

@dsiebel dsiebel commented Mar 2, 2023

Fixes: #5445

Description

Fixes the issue described in #5445, where running skaffold render on a Helm Chart with dependencies results in an error, because the Chart dependencies are not being updated:

ERRO[0000] Error: An error occurred while checking for chart dependencies. You may need to run `helm dependency build` to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: app
exit status 1  subtask=0 task=Render
std out err: %!(EXTRA *errors.errorString=Error: An error occurred while checking for chart dependencies. You may need to run `helm dependency build` to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: app
exit status 1
)

helm dep build has been implemented on skaffold run|deploy which is where this implementation was copied from.

The dep build step can be skipped by setting skipBuildDependencies: true on the corresponding helm.release, analogous to the implementation on skaffold deploy.

Unit tests have been adjusted to the best of my knowledge, happy about any further suggestions there.

User facing changes (remove if N/A)

Before: Running skaffold render on a Helm chart with dependencies results in an error on the underlying helm template.

After: Running skaffold render updates the Helm Charts' dependencies and renders them successfully.

Alternatives considered

Initially I was thinking about using the --dependency-update flag on helm template, but this one was only implemented recently and I couldn't figure out how to easily evaluate the helm binary version in renderer.helm.
The current implementation should be the safer path, since it properly honors the Chart.lock file (or creates it if missing).

@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #8486 (084c4d8) into main (290280e) will decrease coverage by 5.29%.
The diff coverage is 55.02%.

@@            Coverage Diff             @@
##             main    #8486      +/-   ##
==========================================
- Coverage   70.48%   65.19%   -5.29%     
==========================================
  Files         515      602      +87     
  Lines       23150    29917    +6767     
==========================================
+ Hits        16317    19505    +3188     
- Misses       5776     8940    +3164     
- Partials     1057     1472     +415     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/config/list.go 65.21% <ø> (ø)
cmd/skaffold/app/cmd/config/set.go 88.72% <ø> (ø)
cmd/skaffold/app/cmd/config/util.go 54.28% <ø> (ø)
cmd/skaffold/app/cmd/credits.go 100.00% <ø> (ø)
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/generate_pipeline.go 60.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_modules.go 65.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_profiles.go 66.66% <ø> (ø)
... and 425 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aaron-prindle aaron-prindle added the kokoro:force-run forces a kokoro re-run on a PR label Mar 29, 2023
Copy link
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, thanks for the PR here @dsiebel! This PR looks good, the lint test error is unrelated to the changes here. Merging this now, it will be available in our next release - v2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kokoro:force-run forces a kokoro re-run on a PR size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skaffold render does not update helm dependencies
2 participants