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

pass resourcePrefix to the helm template resources #625

Merged
merged 3 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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