Detect a "deleted" status for the experiment
@@ -30,6 +30,7 @@ const (
idle = "Idle"
running = "Running"
completed = "Completed"
+ deleted = "Deleted" // TODO Should we just preserve the existing status to avoid the extra update?
)
// UpdateStatus will ensure the experiment's status matches what is in the supplied trial list; returns true only if
@@ -48,7 +49,9 @@ func UpdateStatus(exp *redskyv1alpha1.Experiment, trialList *redskyv1alpha1.Tria
// The order if this if/else block is very specific
if exp.Replicas() == 0 {
- if exp.Annotations[redskyv1alpha1.AnnotationExperimentURL] != "" && exp.Annotations[redskyv1alpha1.AnnotationNextTrialURL] == "" {
+ if !exp.GetDeletionTimestamp().IsZero() {
+ summary = deleted
+ } else if exp.Annotations[redskyv1alpha1.AnnotationExperimentURL] != "" && exp.Annotations[redskyv1alpha1.AnnotationNextTrialURL] == "" {
// Either we got paused using manual suggestions (which doesn't make sense because you don't need to pause)
// ...or we hit the end of the experiment and the server told us to stop
summary = completed
