Skip to content

Commit

Permalink
Merge pull request #1390 from benluddy/og-conditions-flake
Browse files Browse the repository at this point in the history
Ignore differences in CSV .status.conditions in unit tests.
  • Loading branch information
openshift-merge-robot committed Mar 19, 2020
2 parents 3455a00 + 29868a4 commit 17e6c31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/operators/olm/operator_test.go
Expand Up @@ -4251,6 +4251,11 @@ func RequireObjectsInNamespace(t *testing.T, opClient operatorclient.ClientInter
fetched, err = opClient.GetRoleBinding(namespace, o.GetName())
case *v1alpha1.ClusterServiceVersion:
fetched, err = client.OperatorsV1alpha1().ClusterServiceVersions(namespace).Get(o.GetName(), metav1.GetOptions{})
// This protects against small timing issues in sync tests
// We generally don't care about the conditions (state history in this case, unlike many kube resources)
// and this will still check that the final state is correct
object.(*v1alpha1.ClusterServiceVersion).Status.Conditions = nil
fetched.(*v1alpha1.ClusterServiceVersion).Status.Conditions = nil
case *v1.OperatorGroup:
fetched, err = client.OperatorsV1().OperatorGroups(namespace).Get(o.GetName(), metav1.GetOptions{})
default:
Expand Down

0 comments on commit 17e6c31

Please sign in to comment.