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

Fix namespace handling regression #403

Merged
merged 3 commits into from
Feb 6, 2019
Merged

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Feb 5, 2019

Due to recent refactoring, the provider was setting namespaces on resources
that could conflict with the dynamic client for that resource. All of the namespace
handling has now been deferred to the client package rather than the provider.

Fixes #400

@lblackstone lblackstone changed the title Only set a namespace for namespaceable Kinds [WIP] Only set a namespace for namespaceable Kinds Feb 5, 2019
@lblackstone lblackstone changed the title [WIP] Only set a namespace for namespaceable Kinds Only set a namespace for namespaceable Kinds Feb 5, 2019
…ources

that could conflict with the dynamic client for that resource. All of the namespace
handling has now been deferred to the client package rather than the provider.
@lblackstone lblackstone changed the title Only set a namespace for namespaceable Kinds Defer namespace handling to client package Feb 5, 2019
Copy link
Contributor

@hausdorff hausdorff left a comment

Choose a reason for hiding this comment

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

I forget why this was part of the refactoring at all. What was the logic here?

@lblackstone
Copy link
Member Author

@hausdorff I added that at some point deep in the middle of trying to get things working again. Now that the client package is cleaned up, the extra logic in the provider was redundant/not quite right.

Copy link
Contributor

@hausdorff hausdorff left a comment

Choose a reason for hiding this comment

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

Ok, so:

  • This code is subtle but does seem to replace objects when "default" -> "" namespace.
  • I actually forget (and can't figure out) why diff.go correctly does not register "" -> "default" namespace does not report replacement, as our tests clearly show it does.

Overall I'm kind of scared of the Diff code.

@lblackstone lblackstone changed the title Defer namespace handling to client package Fix namespace handling regression Feb 6, 2019
@lblackstone
Copy link
Member Author

@hausdorff I fixed the regression and expanded the new test to include both the cases you mentioned.

Copy link
Contributor

@hausdorff hausdorff left a comment

Choose a reason for hiding this comment

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

Ok, this looks fine to me. I think the tests should catch any more regressions... I think we should make sure that we're doing all we can here, we don't want to have another regression like this. :)

@lblackstone lblackstone merged commit 85f74c5 into master Feb 6, 2019
@pulumi-bot pulumi-bot deleted the lblackstone/namespace-bug branch February 6, 2019 22:15
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

2 participants