Skip to content

Commit 2cb6c22

Browse files
authored
Merge pull request #3483 from jamsman94/cp/3482
cherrypick #3482
2 parents 00442c5 + e69eb4f commit 2cb6c22

File tree

1 file changed

+4
-2
lines changed
  • pkg/microservice/aslan/core/workflow/service/workflow/job

1 file changed

+4
-2
lines changed

pkg/microservice/aslan/core/workflow/service/workflow/job/job_build.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ func (j *BuildJob) ClearSelectionField() error {
135135
if err := commonmodels.IToi(j.job.Spec, j.spec); err != nil {
136136
return err
137137
}
138-
139138
chosenObject := make([]*commonmodels.ServiceAndBuild, 0)
140139

141-
j.spec.ServiceAndBuilds = chosenObject
140+
// some weird logic says we shouldn't clear user's selection if there are only one service in the selection pool.
141+
if len(j.spec.ServiceAndBuilds) != 1 {
142+
j.spec.ServiceAndBuilds = chosenObject
143+
}
142144
j.job.Spec = j.spec
143145
return nil
144146
}

0 commit comments

Comments
 (0)