diff --git a/chaoscenter/subscriber/pkg/events/chaosengine.go b/chaoscenter/subscriber/pkg/events/chaosengine.go index d985ed857ae..a829d5608b3 100644 --- a/chaoscenter/subscriber/pkg/events/chaosengine.go +++ b/chaoscenter/subscriber/pkg/events/chaosengine.go @@ -98,6 +98,16 @@ func (ev *subscriberEvents) chaosEventHandler(obj interface{}, eventType string, logrus.WithError(err).Fatal("could not get Chaos ClientSet") } + // Update engineStatus from initialized to running + if workflowObj.Status.EngineStatus == chaosTypes.EngineStatusInitialized { + workflowObj.Status.EngineStatus = chaosTypes.EngineStatusRunning + _, err := chaosClient.ChaosEngines(workflowObj.Namespace).UpdateStatus(context.TODO(), workflowObj, v1.UpdateOptions{}) + if err != nil { + logrus.WithError(err).Fatal("could not update ChaosEngine status to running") + } + logrus.Infof("Updated ChaosEngine status to running: %s/%s", workflowObj.Namespace, workflowObj.Name) + } + nodes := make(map[string]types.Node) logrus.Print("STANDALONE CHAOSENGINE EVENT ", workflowObj.UID, " ", eventType) var cd *types.ChaosData = nil diff --git a/chaoscenter/web/src/models/chaosEngine.ts b/chaoscenter/web/src/models/chaosEngine.ts index 3f8ed4c92d5..29174d58b8c 100644 --- a/chaoscenter/web/src/models/chaosEngine.ts +++ b/chaoscenter/web/src/models/chaosEngine.ts @@ -49,7 +49,7 @@ export type FaultStatus = | 'Skipped'; // EngineStatus provides interface for all supported strings in status.EngineStatus -export type EngineStatus = 'initialized' | 'completed' | 'stopped'; +export type EngineStatus = 'initialized' | 'running' | 'completed' | 'stopped'; // CleanUpPolicy defines the garbage collection method used by chaos-operator export type CleanUpPolicy = 'delete' | 'retain';