Skip to content

Commit 5b1d094

Browse files
committed
fixup! return a slice of errors to avoid nil errors counting in length check
Signed-off-by: Bryce Palmer <[email protected]>
1 parent 99d6050 commit 5b1d094

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/e2e-oidc/external_oidc_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ func (tc *testClient) validateOAuthState(t *testing.T, ctx context.Context, requ
727727
validationErrs = append(validationErrs, validateOAuthResources(ctx, dynamicClient, requireMissing)...)
728728
validationErrs = append(validationErrs, validateOAuthRoutes(ctx, tc.routeClient, tc.configClient, requireMissing)...)
729729
validationErrs = append(validationErrs, validateOAuthControllerConditions(tc.operatorClient, requireMissing)...)
730-
validationErrs = append(validationErrs, validateOperandVersions(ctx, tc.configClient, requireMissing))
730+
validationErrs = append(validationErrs, validateOperandVersions(ctx, tc.configClient, requireMissing)...)
731731
return len(validationErrs) == 0, nil
732732
})
733733

@@ -873,12 +873,12 @@ func validateOAuthControllerConditions(operatorClient v1helpers.OperatorClient,
873873
return nil
874874
}
875875

876-
func validateOperandVersions(ctx context.Context, cfgClient *configclient.Clientset, requireMissing bool) error {
876+
func validateOperandVersions(ctx context.Context, cfgClient *configclient.Clientset, requireMissing bool) []error {
877877
operands := sets.New("oauth-apiserver", "oauth-openshift")
878878

879879
authnClusterOperator, err := cfgClient.ConfigV1().ClusterOperators().Get(ctx, "authentication", metav1.GetOptions{})
880880
if err != nil {
881-
return fmt.Errorf("fetching authentication ClusterOperator: %w", err)
881+
return []error{fmt.Errorf("fetching authentication ClusterOperator: %w", err)}
882882
}
883883

884884
foundOperands := []string{}
@@ -889,12 +889,12 @@ func validateOperandVersions(ctx context.Context, cfgClient *configclient.Client
889889
}
890890

891891
if requireMissing && len(foundOperands) > 0 {
892-
return fmt.Errorf("authentication ClusterOperator status has operands %v in versions when they should be unset", foundOperands)
892+
return []error{fmt.Errorf("authentication ClusterOperator status has operands %v in versions when they should be unset", foundOperands)}
893893
}
894894

895895
foundSet := sets.New(foundOperands...)
896896
if !requireMissing && !foundSet.Equal(operands) {
897-
return fmt.Errorf("authentication ClusterOperator status expected to have operands %v in versions but got %v", operands.UnsortedList(), foundOperands)
897+
return []error{fmt.Errorf("authentication ClusterOperator status expected to have operands %v in versions but got %v", operands.UnsortedList(), foundOperands)}
898898
}
899899

900900
return nil

0 commit comments

Comments
 (0)