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

fix(helm): use build path for charts for helm modules converted to ac… #5190

Merged
merged 4 commits into from Oct 5, 2023

Conversation

twelvemo
Copy link
Collaborator

@twelvemo twelvemo commented Oct 5, 2023

…tions

What this PR does / why we need it:
Fixes a compatibility issue when using Helm modules. In Garden 0.12.x Helm modules always had an implicit build and charts and their dependenies were resolved in the build directory under .garden/build/<module-name>. However Helm deploy actions and their dependencies are resolved in the action directory. When converting from modules to actions, we were creating a dummyBuild which is a build of type exec for some scenarios e.g. when a base chart was explicitly set in the Helm module. When this was not the case the converted Helm deploy action would use the action directory for all Helm operations. This leads to a compatibility issue e.g. when referencing local dependency charts with relative paths. This PR creates a dummyBuild for every converted Helm module, so that every converted Helm module still uses the build directory.
It also fixes a bug, where the module.path was referencing the path of the node module and not the garden module, which is moduleConfig.path in the context of this function. This resulted in only a part of the Helm chart to be copied to the build directory.
Adds tests to check if the correct base directory is used for both converted modules and native actions.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@shumailxyz
Copy link
Contributor

@twelvemo The tests are failing. Can you please check those?

@twelvemo
Copy link
Collaborator Author

twelvemo commented Oct 5, 2023

@twelvemo The tests are failing. Can you please check those?

Just did. The failing integ test about includes in helm charts was actually wrong. It was changed here to match the behavior resulting from the bug of comparing the node module path for helm charts and setting the includes according to it. Fixed the test.

Copy link
Contributor

@shumailxyz shumailxyz left a comment

Choose a reason for hiding this comment

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

Thank you @twelvemo. Great work ✨

@@ -210,7 +210,7 @@ export async function configureHelmModule({
]
}

const yamlPath = join(module.path, chartPath, helmChartYamlFilename)
const yamlPath = join(moduleConfig.path, chartPath, helmChartYamlFilename)
Copy link
Contributor

Choose a reason for hiding this comment

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

Oopss :D

@twelvemo twelvemo added this pull request to the merge queue Oct 5, 2023
Merged via the queue into main with commit eb5e859 Oct 5, 2023
43 checks passed
@twelvemo twelvemo deleted the always-create-dummybuild-helm branch October 5, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants