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

Server side apply #2435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gjyotin305
Copy link

What this PR does / why we need it:
This PR adds the feature of server side apply, replacing the previously client side apply. Server-side applies allow us to avoid updating errors due to conflicts, and then it would reduce confusions for users.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2271

Checklist:

  • Docs included if any changes are user facing

Signed-off-by: Jyotin Goel <[email protected]>
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign gaocegege for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gjyotin305
Copy link
Author

@tenzen-y Can you please review ?

Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution @gjyotin305 and sorry for the late reply!

)

type updateStatusFunc func(instance *experimentsv1beta1.Experiment) error

func (r *ReconcileExperiment) updateStatus(instance *experimentsv1beta1.Experiment) error {
err := r.Status().Update(context.TODO(), instance)
err := r.Status().Update(context.TODO(), instance, &client.SubResourceUpdateOptions{UpdateOptions: client.UpdateOptions{FieldManager: "experiment-controller"}})
Copy link
Member

Choose a reason for hiding this comment

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

@kubeflow/wg-training-leads @gjyotin305 Can we also use the server side apply for other resources that we update in our controllers.
For instance:
Suggestion CR: https://github.com/kubeflow/katib/blob/master/pkg/controller.v1beta1/suggestion/suggestion_controller_status.go#L36
Trial CR: https://github.com/kubeflow/katib/blob/master/pkg/controller.v1beta1/trial/trial_controller_status.go#L45

@tenzen-y Do we need to update k8s version for server-side apply for Katib ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the kubernetes object's status with server-side apply
2 participants