Skip to content
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

Update Fault Node Status to RUNNING on Experiment Start #4733

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions chaoscenter/subscriber/pkg/events/chaosengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/web/src/models/chaosEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading