-
Notifications
You must be signed in to change notification settings - Fork 116
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
helm.v4.Chart: make helm hooks optional (instead of force disabled) #3284
Comments
I think the issue is that hook resources have special lifecycle/ordering requirements. Basically would they work as expected? |
Yep, I have multiple charts that stopped working when moving from v3 to v4:
The issue I have with just removing the hooks is that I can't get the templated yaml out of pulumi. export const ignoreResourcesHelmTransformation = (...resources: string[]) => {
const stack = pulumi.getStack();
return (o: any, opts: pulumi.CustomResourceOptions) => {
const resourceName = `${o.apiVersion}:${o.kind}:${o.metadata?.namespace || ""}:${o.metadata?.name || ""}`;
if (resources.includes(resourceName)) {
console.log(`Skip: ${resourceName}`);
const dir = `../ignored-resources-${stack}`;
if (!fsSync.existsSync(dir)) {
fsSync.mkdirSync(dir);
}
fsSync.writeFileSync(
`${dir}/${resourceName.replaceAll("/", "-")}.yaml`,
yaml.dump(o)
);
for (const key of Object.keys(o)) {
delete o[key];
}
o.apiVersion = "v1";
o.kind = "List";
o.items = [];
}
};
}; |
(here's an outline of the technical challenge) The Helm documentation outlines the various hook behaviors that Pulumi would be expected to emulate: In v3, Pulumi simply treated the hooks as normal resources, which can lead to incorrect behavior. As we can see, hooks generally affect the order of operations, and also vary based on whether the chart is being installed, upgraded, or deleted. The Pulumi engine provides the |
Hello!
Issue details
helm.v3.Chart
ignored thehelm.sh/hook*
annotations but still deployed the resources.The
helm.v4.Chart
resource skips the hooks. This is mentioned in the blog but not in the docs BTW.I think users should have a way to make v4.Chart deploy hooked resources like v3 did, because it's useful and becasue it makes migrating from v3 to v4 less painful.
The text was updated successfully, but these errors were encountered: