Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Aug 20, 2019
1 parent 28e2a59 commit 126c447
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions pkg/gen/python-templates/CustomResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ def __init__(
__props__['spec'] = spec
__props__['metadata'] = metadata

if opts is None:
opts = pulumi.ResourceOptions()
if opts.version is None:
opts.version = version.get_version()
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(version=version.get_version()))

super(CustomResource, self).__init__(
f"kubernetes:{api_version}:{kind}",
Expand All @@ -77,6 +74,7 @@ def get(resource_name: str,
Takes the form <namespace>/<name> or <name>.
: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)
Expand Down
6 changes: 2 additions & 4 deletions sdk/python/pulumi_kubernetes/apiextensions/CustomResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ def __init__(
__props__['spec'] = spec
__props__['metadata'] = metadata

if opts is None:
opts = pulumi.ResourceOptions()
if opts.version is None:
opts.version = version.get_version()
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(version=version.get_version()))

super(CustomResource, self).__init__(
f"kubernetes:{api_version}:{kind}",
Expand All @@ -77,6 +74,7 @@ def get(resource_name: str,
Takes the form <namespace>/<name> or <name>.
: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)
Expand Down

0 comments on commit 126c447

Please sign in to comment.