Skip to content

Commit

Permalink
Add a ready attribute to await Helm Charts
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Oct 28, 2020
1 parent 743646b commit b9f30d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions provider/pkg/gen/nodejs-templates/helm/v3/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export class Chart extends yaml.CollectionComponentResource {
this.resources = allConfig.apply(cfg => {
return this.parseChart(cfg, releaseName, opts)
});

this.ready = this.resources.apply(m => pulumi.all(m).apply(m => Object.values(m).map(r => pulumi.output(r))));
}

parseChart(config: ChartOpts | LocalChartOpts, releaseName: string, opts?: pulumi.ComponentResourceOptions) {
Expand Down
1 change: 1 addition & 0 deletions provider/pkg/gen/nodejs-templates/yaml/yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getVersion } from "../utilities";

export abstract class CollectionComponentResource extends pulumi.ComponentResource {
resources!: pulumi.Output<{ [key: string]: pulumi.CustomResource }>;
ready!: pulumi.Output<pulumi.Output<pulumi.CustomResource>[]>;

protected constructor(
resourceType: string, name: string, config: any, opts?: pulumi.ComponentResourceOptions,
Expand Down
2 changes: 2 additions & 0 deletions sdk/nodejs/helm/v3/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export class Chart extends yaml.CollectionComponentResource {
this.resources = allConfig.apply(cfg => {
return this.parseChart(cfg, releaseName, opts)
});

this.ready = this.resources.apply(m => pulumi.all(m).apply(m => Object.values(m).map(r => pulumi.output(r))));
}

parseChart(config: ChartOpts | LocalChartOpts, releaseName: string, opts?: pulumi.ComponentResourceOptions) {
Expand Down
1 change: 1 addition & 0 deletions sdk/nodejs/yaml/yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getVersion } from "../utilities";

export abstract class CollectionComponentResource extends pulumi.ComponentResource {
resources!: pulumi.Output<{ [key: string]: pulumi.CustomResource }>;
ready!: pulumi.Output<pulumi.Output<pulumi.CustomResource>[]>;

protected constructor(
resourceType: string, name: string, config: any, opts?: pulumi.ComponentResourceOptions,
Expand Down

0 comments on commit b9f30d4

Please sign in to comment.