Skip to content

Commit

Permalink
fix: bug job deployment failed and cancelled not returning error (#485)
Browse files Browse the repository at this point in the history
Co-authored-by: Anwar Hidayat <anwarhidayat14@gmail.com>

Co-authored-by: Anwar Hidayat <anwarhidayat14@gmail.com>
  • Loading branch information
2 people authored and sravankorumilli committed Aug 1, 2022
1 parent 1dc5610 commit 65af2ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ func PollJobDeployment(ctx context.Context, l log.Logger, jobSpecService pb.JobS
l.Info(fmt.Sprintf("Deployment request for deployID %s is in queue...", deployID))
case models.JobDeploymentStatusCancelled.String():
l.Error(fmt.Sprintf("Deployment request for deployID %s is cancelled.", deployID))
return nil
return errors.New("job deployment cancelled")
case models.JobDeploymentStatusSucceed.String():
l.Info(logger.ColoredSuccess("Success deploying %d jobs for deployID %s", resp.SuccessCount, deployID))
return nil
Expand All @@ -588,7 +588,7 @@ func PollJobDeployment(ctx context.Context, l log.Logger, jobSpecService pb.JobS
}
}
l.Error(logger.ColoredError("Deployed %d/%d jobs.", resp.SuccessCount, resp.SuccessCount+resp.FailureCount))
return nil
return errors.New("job deployment failed")
}

time.Sleep(pollInterval)
Expand Down

0 comments on commit 65af2ca

Please sign in to comment.