-
Notifications
You must be signed in to change notification settings - Fork 115
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
Conversation
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.
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
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{ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Does the PR have any schema changes?Looking good! No breaking changes found. |
1 similar comment
Does the PR have any schema changes?Looking good! No breaking changes found. |
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