From e11171e8b53d61dcaec6e6248273265a59b79931 Mon Sep 17 00:00:00 2001 From: Azamat <25627421+mazamats@users.noreply.github.com> Date: Tue, 9 Jul 2019 15:37:11 -0600 Subject: [PATCH] Pass resourcePrefix to the helm template resources (#625) --- CHANGELOG.md | 2 +- sdk/nodejs/helm/v2/helm.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b205aef1c5..d178cc53e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ desired and actual state during a Pulumi update. (https://github.com/pulumi/pulu ### Bug fixes -- None +- Fix Helm Chart resource by passing `resourcePrefix` to the yaml template resources (https://github.com/pulumi/pulumi-kubernetes/pull/625). ## 0.25.1 (July 2, 2019) diff --git a/sdk/nodejs/helm/v2/helm.ts b/sdk/nodejs/helm/v2/helm.ts index 8c2496a4f3..f0a7f7816b 100644 --- a/sdk/nodejs/helm/v2/helm.ts +++ b/sdk/nodejs/helm/v2/helm.ts @@ -174,7 +174,7 @@ export class Chart extends yaml.CollectionComponentResource { const yamlStream = execSync( `helm template ${chart} --name ${release} --values ${defaultValues} --values ${values} ${namespaceArg}` ).toString(); - return this.parseTemplate(yamlStream, cfg.transformations, configDeps); + return this.parseTemplate(yamlStream, cfg.transformations, cfg.resourcePrefix, configDeps); } catch (e) { // Shed stack trace, only emit the error. throw new pulumi.RunError(e.toString()); @@ -189,6 +189,7 @@ export class Chart extends yaml.CollectionComponentResource { parseTemplate( yamlStream: string, transformations: ((o: any, opts: pulumi.CustomResourceOptions) => void)[] | undefined, + resourcePrefix: string | undefined, dependsOn: pulumi.Resource[], ): pulumi.Output<{ [key: string]: pulumi.CustomResource }> { // NOTE: We must manually split the YAML stream because of js-yaml#456. Perusing the @@ -204,6 +205,7 @@ export class Chart extends yaml.CollectionComponentResource { .sort(helmSort); return yaml.parse( { + resourcePrefix: resourcePrefix, yaml: objs.map(o => jsyaml.safeDump(o)), transformations: transformations || [], },