Skip to content

Commit

Permalink
Pass resourcePrefix to the helm template resources (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
beetahnator authored and lblackstone committed Jul 9, 2019
1 parent e4e2809 commit e11171e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion sdk/nodejs/helm/v2/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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
Expand All @@ -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 || [],
},
Expand Down

0 comments on commit e11171e

Please sign in to comment.