Bug Fix where CLI exits if run is not confirmable.

pull/32708/head
mrinalirao 3 years ago
parent 6ab3faf5f6
commit 190858b9e4

@ -97,8 +97,15 @@ func (b *Cloud) runTaskStage(ctx *IntegrationContext, output IntegrationOutputWr
case tfe.TaskStagePending:
// Waiting for it to start
return true, nil
case tfe.TaskStageRunning:
_, e := processSummarizers(ctx, output, stage, summarizers, errs)
if e != nil {
errs = e
}
// not a terminal status so we continue to poll
return true, nil
// Note: Terminal statuses need to print out one last time just in case
case tfe.TaskStageRunning, tfe.TaskStagePassed:
case tfe.TaskStagePassed:
ok, e := processSummarizers(ctx, output, stage, summarizers, errs)
if e != nil {
errs = e
@ -176,6 +183,8 @@ func (b *Cloud) processStageOverrides(context *IntegrationContext, output Integr
if err != errRunOverridden {
if _, err = b.client.TaskStages.Override(context.StopContext, taskStageID, tfe.TaskStageOverrideOptions{}); err != nil {
return false, generalError(fmt.Sprintf("Failed to override policy check.\n%s", runUrl), err)
} else {
return true, nil
}
} else {
output.Output(fmt.Sprintf("The run needs to be manually overridden or discarded.\n%s\n", runUrl))

Loading…
Cancel
Save