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

Add transforms to YAML support for Python SDK #500

Merged
merged 4 commits into from
Apr 2, 2019

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Mar 25, 2019

Fixes #325

@lblackstone lblackstone force-pushed the lblackstone/python-yaml-transforms branch 5 times, most recently from d73e209 to fc9f820 Compare March 27, 2019 22:56
@lblackstone lblackstone marked this pull request as ready for review March 27, 2019 22:58
@lblackstone lblackstone changed the title WIP: python yaml transforms Add transforms to YAML support for Python SDK Mar 27, 2019
Copy link
Contributor

@swgillespie swgillespie left a comment

Choose a reason for hiding this comment

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

LGTM with nits

pkg/gen/python-templates/yaml.py.mustache Outdated Show resolved Hide resolved
pkg/gen/python-templates/yaml.py.mustache Outdated Show resolved Hide resolved
pkg/gen/python-templates/yaml.py.mustache Show resolved Hide resolved
pkg/gen/python-templates/yaml.py.mustache Outdated Show resolved Hide resolved
pkg/gen/python-templates/yaml.py.mustache Outdated Show resolved Hide resolved
# Allow users to change API objects before any validation.
if transformations is not None:
for t in transformations:
obj = t(obj)
Copy link
Contributor

Choose a reason for hiding this comment

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

Reading this code now, I realize that we're running the transformations before we unpack the lists of resources, both here and in the nodejs SDK. I think we want to do the opposite? Perhaps not in this PR but in the future.

name="guestbook",
file_id="https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples/yaml-guestbook/yaml"
"/guestbook.yaml",
transformations=[add_namespace],
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we are not verifying that this namespace is actually added in the test harness? Can we do that?

@lblackstone lblackstone force-pushed the lblackstone/python-yaml-transforms branch from 937202f to e295ae8 Compare April 2, 2019 03:52
@lblackstone lblackstone merged commit 84b00b1 into master Apr 2, 2019
@pulumi-bot pulumi-bot deleted the lblackstone/python-yaml-transforms branch April 2, 2019 04:18
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.

None yet

3 participants