Skip to content

Commit

Permalink
fix: add spinner
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin committed Nov 27, 2024
1 parent c7bed19 commit f34e5d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/kubectl-testkube/commands/testworkflows/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,13 @@ func watchTestWorkflowServiceLogs(id, serviceName string, serviceIndex int,
nErr error
)

spinner := ui.NewSpinner("Waiting for service logs")
for {
notifications, nErr = client.GetTestWorkflowExecutionServiceNotifications(id, serviceName, serviceIndex)
if nErr != nil {
execution, cErr := client.GetTestWorkflowExecution(id)
if cErr != nil {
spinner.Fail()
return nil, cErr
}

Expand All @@ -367,12 +369,14 @@ func watchTestWorkflowServiceLogs(id, serviceName string, serviceIndex int,
}

if nErr != nil {
spinner.Fail()
return nil, nErr
}

break
}

spinner.Success()
return printTestWorkflowLogs(signature, notifications), nil
}

Expand Down

0 comments on commit f34e5d1

Please sign in to comment.