-
Notifications
You must be signed in to change notification settings - Fork 70
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
If a backend is specified, an error in the preCheck
during deletion will result in the backend becoming null
#372
Comments
…on-specified backend was used (kubevela#372) Signed-off-by: 吴就业 <[email protected]>
Is there a plan to fix this bug? |
The reason of "the object has been modified" may be k8sClient got outdated Configuration in controller's cache. That is to say, someone update the object but somehow the controller didn't watch the event to update the cache. I think we can refine the errors in preCheck. When chekcking preCheck errors, use a function say if err := r.preCheck(ctx, &configuration, meta); err != nil {
if !isDeleting {
return ctrl.Result{}, err
}
// deleting
if IsErrBlockDeletion(err) {
return ctrl.Result{}, err
}
} |
After IsErrBlockDeletion, what should we do next? Should we retry by putting it back in the queue? |
If return err is not nil, object will be reequeued automatically. |
Due to the fact that the errors returned by
preCheck
during deletion are ignored, the processing logic for deletion is executed directly.The initialization of the backend occurs in the
preCheck
method. If an error occurs inpreCheck
before calling theRenderConfiguration
method to initialize the backend, the backend will not be initialized, resulting in the deletion processing logic using the default backend.During the CheckProvider step, calling the
meta.getCredentials
method triggers the tfcfg.SetRegion method. If theconfiguration.Spec.Region
is not specified, thetfcfg.SetRegion
method will update the configuration. At this point, an error may occur with the message "the object has been modified."I don't understand the code either, and it's unclear why
configuration.Spec.Region
is being updated here, as there are no other references to it elsewhere.The text was updated successfully, but these errors were encountered: