-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[WIP] ⚠️ Server Side Apply Support #366
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
[WIP] ⚠️ Server Side Apply Support #366
Conversation
This refactors options off to their own file in order to make each file comprehensibly long (pkg/client/interfaces.go was getting rather large with all the different types of options).
Strategic merge patch is what most things in kubernetes use, and probably closer to what users expect if they can't use server-side apply.
This adds a patch type for server-side apply (Kubernetes 1.14+), which allows you to write code like ```go client.Patch(ctx, &corev1.Pod{/* fields I care about */}, client.Apply, client.IgnoreConflicts()) ``` and have it just work.
This is needed for server-side apply.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Also TODO: switch to specificallyversionedoptions calls |
One step in #347 |
also TODO (eventually): jsonpatch patch type |
(this also needs tests before merge) |
@@ -72,3 +77,21 @@ func (s *mergeFromPatch) Data(obj runtime.Object) ([]byte, error) { | |||
func MergeFrom(obj runtime.Object) Patch { | |||
return &mergeFromPatch{obj} | |||
} | |||
|
|||
// applyPatch uses server-side apply to patch the object. | |||
type applyPatch struct{} |
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.
You don't use the var _ SomeInterface = someImpl{}
pattern? I'm assuming this implements something that I don't know
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.
See the Patch
interface (interfaces.go)
LGTM from my perspective. |
fd37445
to
59da519
Compare
Shame on me for forgetting the fieldmanager field ... |
@DirectXMan12: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
for posterity: part of this went in to #435, the rest needs a bit more work. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
we've got minimal support currently, but it's a bit clunky. We'll add a nice wrapper eventually, but closing for now |
[book] section on dependencies, update upgrading
This introduces a server-side apply patch type. Don't use yet, since it requires Kubernetes 1.14. Breaking since the structure of PatchOptions needs to change.