Do not remove finalizer if deleting from the remote API fails
@@ -219,7 +219,7 @@ func (r *ExperimentReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)
// Also delete the experiment on the server if necessary
if experimentURL := experiment.GetAnnotations()[redskyv1alpha1.AnnotationExperimentURL]; experimentURL != "" {
if err := r.RedSkyAPI.DeleteExperiment(ctx, experimentURL); err != nil {
- log.Error(err, "Failed to delete experiment", "experimentURL", experimentURL)
+ return ctrl.Result{}, err
}
delete(experiment.GetAnnotations(), redskyv1alpha1.AnnotationExperimentURL)
delete(experiment.GetAnnotations(), redskyv1alpha1.AnnotationNextTrialURL)
