Skip to content

Commit

Permalink
Pull in pulumi/pulumi changes
Browse files Browse the repository at this point in the history
- CustomResource can now pass Input[str] for id
- Update get test's pulumi/pulumi dep to use the change
  • Loading branch information
lblackstone committed Aug 20, 2019
1 parent 4270ce6 commit da8cc18
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
7 changes: 2 additions & 5 deletions pkg/gen/python-templates/CustomResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@ def get(resource_name: str,
:param Optional[ResourceOptions] opts: A bag of options that control this resource's behavior.
"""

def _unwrap(id):
_opts = ResourceOptions(id=id) if opts is None else opts.merge(ResourceOptions(id=id))
return CustomResource(resource_name=resource_name, api_version=api_version, kind=kind, opts=_opts)

return pulumi.Output.from_input(id).apply(_unwrap)
opts = ResourceOptions(id=id) if opts is None else opts.merge(ResourceOptions(id=id))
return CustomResource(resource_name=resource_name, api_version=api_version, kind=kind, opts=opts)

def translate_output_property(self, prop: str) -> str:
return tables._CASING_FORWARD_TABLE.get(prop) or prop
Expand Down
7 changes: 2 additions & 5 deletions sdk/python/pulumi_kubernetes/apiextensions/CustomResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@ def get(resource_name: str,
:param Optional[ResourceOptions] opts: A bag of options that control this resource's behavior.
"""

def _unwrap(id):
_opts = ResourceOptions(id=id) if opts is None else opts.merge(ResourceOptions(id=id))
return CustomResource(resource_name=resource_name, api_version=api_version, kind=kind, opts=_opts)

return pulumi.Output.from_input(id).apply(_unwrap)
opts = ResourceOptions(id=id) if opts is None else opts.merge(ResourceOptions(id=id))
return CustomResource(resource_name=resource_name, api_version=api_version, kind=kind, opts=opts)

def translate_output_property(self, prop: str) -> str:
return tables._CASING_FORWARD_TABLE.get(prop) or prop
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/python/get/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pulumi>=0.17.1,<2.0.0
pulumi==1.0.1a1566328728
3 changes: 2 additions & 1 deletion tests/examples/python/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ func TestGet(t *testing.T) {
t.FailNow()
}
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "get"),
ExpectRefreshChanges: true, // CRD changes on refresh
Dir: filepath.Join(cwd, "get"),
})
integration.ProgramTest(t, &options)
}
Expand Down

0 comments on commit da8cc18

Please sign in to comment.