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

Update CustomResource python implementation to pickup snake-case updates #1786

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

viveklak
Copy link
Contributor

@viveklak viveklak commented Nov 2, 2021

Proposed changes

Refresh the python implementation of python implementation of CustomResource to pick up fixes in snake-casing.
CustomResource.py is hand-crafted wrapper so doesn't lie on the codegen path. While I was able to schematize the core CustomResource type, the custom handling around constructing dynamic tokens at resource registration or retrieval is quite painful to substitute in an automated way. That would have to follow in #1778.

The change here uses an input type which signals the pulumi python SDK to handle the snake casing appropriately. I am not yet exposing the input type in the constructor with the interest of not breaking compatibility.

Related issues (optional)

Fixes #1740

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 2, 2021

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@viveklak
Copy link
Contributor Author

viveklak commented Nov 2, 2021

CC @justinvp for his python SDK expertise.

As stated in the description, I would love to find a way to bring this inline with the rest of SDK codegen. I will cut a separate issue to consider options here since it might have an overlap with other provider SDKs as well.

def __init__(__self__, *,
api_version: pulumi.Input[str],
kind: pulumi.Input[str],
compat: Optional[pulumi.Input[str]] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the compat arg for? I don't see a corresponding docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left over from attempt to codegen. Removed.

__props__['spec'] = spec
__props__['metadata'] = metadata

# resource_args, opts = _utilities.get_resource_args_opts(CustomResourceArgs, pulumi.ResourceOptions, *args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Fixed.

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@viveklak viveklak merged commit 79ff9b5 into master Nov 2, 2021
@pulumi-bot pulumi-bot deleted the vl/FixCustomResource branch November 2, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CustomResource's .spec.node_selector gets overwritten to .spec.nodeSelector
3 participants