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

Handle different namespaces for server-side diff #1631

Merged
merged 5 commits into from
Jun 23, 2021

Conversation

lblackstone
Copy link
Member

Proposed changes

The server-side diff logic previously tried to use the
same k8s client for calculating the patch. In the case
where the namespace of a resource changed, this
diff would fail because the client was for the old
namespace.

Related issues (optional)

Fix #683

The server-side diff logic previously tried to use the
same k8s client for calculating the patch. In the case
where the namespace of a resource changed, this
diff would fail because the client was for the old
namespace.
@github-actions
Copy link

Does the PR have any schema changes?

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

@lblackstone lblackstone marked this pull request as ready for review June 22, 2021 20:58
@github-actions
Copy link

Does the PR have any schema changes?

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

tests/sdk/nodejs/dry-run/step2/index.ts Show resolved Hide resolved
client, err := k.clientSet.ResourceClient(newInputs.GroupVersionKind(), newInputs.GetNamespace())
if err != nil {
return nil, nil, err
}
newObject, err = client.Create(context.TODO(), newInputs, metav1.CreateOptions{
Copy link
Member

Choose a reason for hiding this comment

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

I'm just trying to wrap my head around this... What happens with the object in the old namespace? Don't we need to delete it?

Copy link
Member Author

Choose a reason for hiding this comment

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

This method just computes the patch. The resource replacement logic happens separately from this.

@github-actions
Copy link

Does the PR have any schema changes?

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

1 similar comment
@github-actions
Copy link

Does the PR have any schema changes?

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

@lblackstone lblackstone merged commit 0fa6631 into master Jun 23, 2021
@pulumi-bot pulumi-bot deleted the lblackstone/ssa-diff-bug branch June 23, 2021 20:01
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.

JSON patch not working properly for changed namespaces
3 participants