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

[helm] Don't pass opts to child resources #1539

Merged
merged 2 commits into from
Apr 27, 2021
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## HEAD (Unreleased)
_(none)_

- In Python helmv2 and helmv3, and Node.js helmv3, no longer pass `Chart` resource options to child resources explicitly.
(https://github.com/pulumi/pulumi-kubernetes/pull/1539)

## 3.0.0 (April 19, 2021)

Expand Down
6 changes: 3 additions & 3 deletions provider/pkg/gen/nodejs-templates/helm/v3/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ export class Chart extends yaml.CollectionComponentResource {
});

this.resources = allConfig.apply(cfg => {
return this.parseChart(cfg, releaseName, opts)
return this.parseChart(cfg, releaseName)
});

this.ready = this.resources.apply(m => Object.values(m));
}

parseChart(config: ChartOpts | LocalChartOpts, releaseName: string, opts?: pulumi.ComponentResourceOptions) {
parseChart(config: ChartOpts | LocalChartOpts, releaseName: string) {
const blob = {
...config,
releaseName,
Expand Down Expand Up @@ -226,7 +226,7 @@ export class Chart extends yaml.CollectionComponentResource {
objs: p.result,
transformations: config.transformations || [],
},
{ ...opts, parent: this }
{ parent: this }
));
}
}
Expand Down
7 changes: 1 addition & 6 deletions provider/pkg/gen/python-templates/helm/v2/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,7 @@ def omit_resource(obj, opts):
__props__,
opts)

if opts is not None:
opts.parent = self
else:
opts = pulumi.ResourceOptions(parent=self)

all_config = pulumi.Output.from_input((release_name, config, opts))
all_config = pulumi.Output.from_input((release_name, config, pulumi.ResourceOptions(parent=self)))

# Note: Unlike NodeJS, Python requires that we "pull" on our futures in order to get them scheduled for
# execution. In order to do this, we leverage the engine's RegisterResourceOutputs to wait for the
Expand Down
3 changes: 1 addition & 2 deletions provider/pkg/gen/python-templates/helm/v3/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ def omit_resource(obj, opts):

config.release_name = release_name

opts.parent = self
all_config = pulumi.Output.from_input((config, opts))
all_config = pulumi.Output.from_input((config, pulumi.ResourceOptions(parent=self)))

# Note: Unlike NodeJS, Python requires that we "pull" on our futures in order to get them scheduled for
# execution. In order to do this, we leverage the engine's RegisterResourceOutputs to wait for the
Expand Down
6 changes: 3 additions & 3 deletions sdk/nodejs/helm/v3/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ export class Chart extends yaml.CollectionComponentResource {
});

this.resources = allConfig.apply(cfg => {
return this.parseChart(cfg, releaseName, opts)
return this.parseChart(cfg, releaseName)
});

this.ready = this.resources.apply(m => Object.values(m));
}

parseChart(config: ChartOpts | LocalChartOpts, releaseName: string, opts?: pulumi.ComponentResourceOptions) {
parseChart(config: ChartOpts | LocalChartOpts, releaseName: string) {
const blob = {
...config,
releaseName,
Expand Down Expand Up @@ -226,7 +226,7 @@ export class Chart extends yaml.CollectionComponentResource {
objs: p.result,
transformations: config.transformations || [],
},
{ ...opts, parent: this }
{ parent: this }
));
}
}
Expand Down
7 changes: 1 addition & 6 deletions sdk/python/pulumi_kubernetes/helm/v2/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,7 @@ def omit_resource(obj, opts):
__props__,
opts)

if opts is not None:
opts.parent = self
else:
opts = pulumi.ResourceOptions(parent=self)

all_config = pulumi.Output.from_input((release_name, config, opts))
all_config = pulumi.Output.from_input((release_name, config, pulumi.ResourceOptions(parent=self)))

# Note: Unlike NodeJS, Python requires that we "pull" on our futures in order to get them scheduled for
# execution. In order to do this, we leverage the engine's RegisterResourceOutputs to wait for the
Expand Down
3 changes: 1 addition & 2 deletions sdk/python/pulumi_kubernetes/helm/v3/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ def omit_resource(obj, opts):

config.release_name = release_name

opts.parent = self
all_config = pulumi.Output.from_input((config, opts))
all_config = pulumi.Output.from_input((config, pulumi.ResourceOptions(parent=self)))

# Note: Unlike NodeJS, Python requires that we "pull" on our futures in order to get them scheduled for
# execution. In order to do this, we leverage the engine's RegisterResourceOutputs to wait for the
Expand Down