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

0.14.1 regression: cannot use server-side apply #2125

Closed
Gchbg opened this issue Jan 10, 2023 · 3 comments · Fixed by #2257
Closed

0.14.1 regression: cannot use server-side apply #2125

Gchbg opened this issue Jan 10, 2023 · 3 comments · Fixed by #2257

Comments

@Gchbg
Copy link

Gchbg commented Jan 10, 2023

Hi,

After upgrading from 0.13.1 to 0.14.1, I can no longer use server-side apply.

In 0.13.1 I used to be able to do this:
err = r.Status().Patch(ctx, obj, client.Apply, client.FieldOwner("whatever"), client.ForceOwnership)

In 0.14.1 this results in:

Cannot use 'client.FieldOwner("whatever")' (type client.FieldOwner) as the type SubResourcePatchOptionType does not implement 'SubResourcePatchOption' as some methods are missing:ApplyToSubResourcePatch(*SubResourcePatchOptions)
Cannot use 'client.ForceOwnership' (type forceOwnership) as the type SubResourcePatchOptionType does not implement 'SubResourcePatchOption' as some methods are missing:ApplyToSubResourcePatch(*SubResourcePatchOptions)

I assume this is due to the breaking change introduced in #2072. It seems that client.FieldOwner and client.ForceOwnership were not updated to use the new SubResourcePatchOption interface instead of the existing PatchOption interface.

If this was intended, I would appreciate any insight about what the line of code should look like in 0.14.1.

Thanks!

@alvaroaleman
Copy link
Member

Fixes in the latest 0.14.3 release.

@Gchbg
Copy link
Author

Gchbg commented Feb 6, 2023

Fixes in the latest 0.14.3 release.

Unfortunately the fix seems incomplete. ForceOwnership is still missing the ApplyToSubResourcePatch method.

@alvaroaleman
Copy link
Member

@Gchbg please feel free to submit a fix

@alvaroaleman alvaroaleman reopened this Feb 7, 2023
justinsb added a commit to justinsb/controller-runtime that referenced this issue Mar 31, 2023
Ensure that we can force when applying to subresources (in particular status)

Issue kubernetes-sigs#2125
justinsb added a commit to justinsb/controller-runtime that referenced this issue Mar 31, 2023
Ensure that we can force when applying to subresources (in particular status)

Issue kubernetes-sigs#2125
k8s-infra-cherrypick-robot pushed a commit to k8s-infra-cherrypick-robot/controller-runtime that referenced this issue Mar 31, 2023
Ensure that we can force when applying to subresources (in particular status)

Issue kubernetes-sigs#2125
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 a pull request may close this issue.

2 participants