Skip to content

Commit 17e6c31

Browse files
Merge pull request #1390 from benluddy/og-conditions-flake
Ignore differences in CSV .status.conditions in unit tests.
2 parents 3455a00 + 29868a4 commit 17e6c31

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/controller/operators/olm/operator_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4251,6 +4251,11 @@ func RequireObjectsInNamespace(t *testing.T, opClient operatorclient.ClientInter
42514251
fetched, err = opClient.GetRoleBinding(namespace, o.GetName())
42524252
case *v1alpha1.ClusterServiceVersion:
42534253
fetched, err = client.OperatorsV1alpha1().ClusterServiceVersions(namespace).Get(o.GetName(), metav1.GetOptions{})
4254+
// This protects against small timing issues in sync tests
4255+
// We generally don't care about the conditions (state history in this case, unlike many kube resources)
4256+
// and this will still check that the final state is correct
4257+
object.(*v1alpha1.ClusterServiceVersion).Status.Conditions = nil
4258+
fetched.(*v1alpha1.ClusterServiceVersion).Status.Conditions = nil
42544259
case *v1.OperatorGroup:
42554260
fetched, err = client.OperatorsV1().OperatorGroups(namespace).Get(o.GetName(), metav1.GetOptions{})
42564261
default:

0 commit comments

Comments
 (0)