Skip to content

Commit

Permalink
Add terminal-state log and metrics to successful cluster deletion ope…
Browse files Browse the repository at this point in the history
…rations.
  • Loading branch information
ventifus committed Jan 17, 2025
1 parent b6a5f9c commit 8b8aecf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/backend/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ func (ocb *openShiftClusterBackend) handle(ctx context.Context, log *logrus.Entr
// and stop monitoring the cluster.
// TODO: Provide better communication between RP and Monitor
time.Sleep(time.Until(t.Add(time.Second * time.Duration(monitorDeleteWaitTimeSec))))
return ocb.dbOpenShiftClusters.Delete(ctx, doc)
err := ocb.dbOpenShiftClusters.Delete(ctx, doc)
ocb.asyncOperationResultLog(log, doc.OpenShiftCluster.Properties.ProvisioningState, err)
ocb.emitMetrics(log, doc, api.ProvisioningStateDeleting, api.ProvisioningStateFailed, err)
ocb.emitProvisioningMetrics(doc, api.ProvisioningStateFailed)
return err
}

return fmt.Errorf("unexpected provisioningState %q", doc.OpenShiftCluster.Properties.ProvisioningState)
Expand Down

0 comments on commit 8b8aecf

Please sign in to comment.