You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
operator log:
ERROR syncer.StatusSyncer failed to update cluster status {"mysqlcluster": "sample", "namespace": "default", "error": "Operation cannot be fulfilled on \"sample\": the object has been modified; please apply your changes to the latest version and try again"}
Describe the solution you'd like
Update () needs to compare ResourceVersion.
If the operator only updates the Status, it doesn’t need to pay attention to ResourceVersion
We can use Patch() to instead of Update().
defer func() {
if !reflect.DeepEqual(status, instance.Status) {
sErr := r.Status().Update(ctx, instance.Unwrap())
if sErr != nil {
log.Error(sErr, "failed to update cluster status")
}
}
}()
Is your feature request related to a problem? Please describe.
operator log:
Describe the solution you'd like
Update () needs to compare
ResourceVersion
.If the operator only updates the Status, it doesn’t need to pay attention to
ResourceVersion
We can use Patch() to instead of Update().
link: https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/client/interfaces.go#L97
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: