Skip to content

Commit

Permalink
Merge pull request #564 from qu1queee/qu1queee/fix_flaky_test
Browse files Browse the repository at this point in the history
Fix flaky unit-test spec for Build
  • Loading branch information
openshift-merge-robot authored Feb 2, 2021
2 parents c0bfa60 + a00ab1c commit 3ec5401
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/validate/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package validate
import (
"context"
"fmt"
"sort"
"strings"

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

// sorts a list of secret names in increasing order
sort.Strings(missingSecrets)

if len(missingSecrets) > 1 {
s.Build.Status.Reason = build.MultipleSecretRefNotFound
s.Build.Status.Message = fmt.Sprintf("missing secrets are %s", strings.Join(missingSecrets, ","))
Expand Down

0 comments on commit 3ec5401

Please sign in to comment.