Add timeout flag for phase run in cli
Syntax: airshipctl phase run <PHASE_NAME> --timeout <time_unit> Exmaple: airshipctl phase run initinfra-ephemeral --debug --wait-timeout 1000s Change-Id: Ic8c699f5302eb482f32aee0e7d7c593df2ed7d3b
This commit is contained in:
@@ -104,11 +104,17 @@ func (e *Executor) Run(ch chan events.Event, runOpts ifc.RunOptions) {
|
||||
if runOpts.DryRun {
|
||||
dryRunStrategy = common.DryRunClient
|
||||
}
|
||||
timeout := time.Second * time.Duration(e.apiObject.Config.WaitOptions.Timeout)
|
||||
if int64(runOpts.Timeout/time.Second) != 0 {
|
||||
timeout = runOpts.Timeout
|
||||
}
|
||||
|
||||
log.Debugf("WaitTimeout: %v", timeout)
|
||||
applyOptions := ApplyOptions{
|
||||
DryRunStrategy: dryRunStrategy,
|
||||
Prune: e.apiObject.Config.PruneOptions.Prune,
|
||||
BundleName: e.Options.BundleName,
|
||||
WaitTimeout: time.Second * time.Duration(e.apiObject.Config.WaitOptions.Timeout),
|
||||
WaitTimeout: timeout,
|
||||
}
|
||||
applier.ApplyBundle(filteredBundle, applyOptions)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user