@@ -30,6 +30,16 @@ import (
3030 "github.com/rs/zerolog"
3131)
3232
33+ func GetAllActions () []api.ActionType {
34+ z := make ([]api.ActionType , 0 , len (definedActions ))
35+
36+ for k := range definedActions {
37+ z = append (z , k )
38+ }
39+
40+ return z
41+ }
42+
3343// ActionCore executes a single Plan item.
3444type ActionCore interface {
3545 // Start performs the start of the action.
@@ -45,8 +55,6 @@ type ActionCore interface {
4555type Action interface {
4656 ActionCore
4757
48- // Timeout returns the amount of time after which this action will timeout.
49- Timeout (deploymentSpec api.DeploymentSpec ) time.Duration
5058 // MemberID Return the MemberID used / created in this action
5159 MemberID () string
5260}
@@ -144,9 +152,10 @@ type actionFactory func(log zerolog.Logger, action api.Action, actionCtx ActionC
144152var (
145153 definedActions = map [api.ActionType ]actionFactory {}
146154 definedActionsLock sync.Mutex
155+ actionTimeouts = api.ActionTimeouts {}
147156)
148157
149- func registerAction (t api.ActionType , f actionFactory ) {
158+ func registerAction (t api.ActionType , f actionFactory , timeout time. Duration ) {
150159 definedActionsLock .Lock ()
151160 defer definedActionsLock .Unlock ()
152161
@@ -156,6 +165,7 @@ func registerAction(t api.ActionType, f actionFactory) {
156165 }
157166
158167 definedActions [t ] = f
168+ actionTimeouts [t ] = api .NewTimeout (timeout )
159169}
160170
161171func getActionFactory (t api.ActionType ) (actionFactory , bool ) {
0 commit comments