Skip to content

Commit 7fcd5cb

Browse files
committed
fix helm check deploy workload status
Signed-off-by: Patrick Zhao <zhaoyu@koderover.com>
1 parent 1d3f1f0 commit 7fcd5cb

File tree

1 file changed

+6
-1
lines changed
  • pkg/microservice/aslan/core/common/service/workflowcontroller/jobcontroller

1 file changed

+6
-1
lines changed

pkg/microservice/aslan/core/common/service/workflowcontroller/jobcontroller/job_helm_deploy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"time"
2424

2525
"github.com/pkg/errors"
26+
"github.com/samber/lo"
2627
"go.uber.org/zap"
2728
"golang.org/x/exp/slices"
2829
"gopkg.in/yaml.v3"
@@ -225,6 +226,10 @@ func (c *HelmDeployJobCtl) Run(ctx context.Context) {
225226
logError(c.job, err.Error(), c.logger)
226227
return
227228
}
229+
230+
if lo.Contains(config.FailedStatus(), c.job.Status) {
231+
return
232+
}
228233
}
229234
break
230235
case <-timeout:
@@ -297,7 +302,7 @@ func (c *HelmDeployJobCtl) checkWorkloadStatus(ctx context.Context, productInfo
297302
if err != nil {
298303
return status, fmt.Errorf("failed to check workload status, err: %v", err)
299304
}
300-
return config.StatusPassed, nil
305+
return status, nil
301306
}
302307

303308
func (c *HelmDeployJobCtl) timeout() int {

0 commit comments

Comments
 (0)