Skip to content

Commit 3ec5401

Browse files
Merge pull request #564 from qu1queee/qu1queee/fix_flaky_test
Fix flaky unit-test spec for Build
2 parents c0bfa60 + a00ab1c commit 3ec5401

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/validate/secrets.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package validate
33
import (
44
"context"
55
"fmt"
6+
"sort"
67
"strings"
78

89
build "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
@@ -37,6 +38,9 @@ func (s SecretRef) ValidatePath(ctx context.Context) error {
3738
}
3839
}
3940

41+
// sorts a list of secret names in increasing order
42+
sort.Strings(missingSecrets)
43+
4044
if len(missingSecrets) > 1 {
4145
s.Build.Status.Reason = build.MultipleSecretRefNotFound
4246
s.Build.Status.Message = fmt.Sprintf("missing secrets are %s", strings.Join(missingSecrets, ","))

0 commit comments

Comments
 (0)