@@ -116,18 +116,23 @@ func TestOperatorGroup(t *testing.T) {
116
116
Name : "e2e-operator-group" ,
117
117
Namespace : testNamespace ,
118
118
},
119
- Spec : v1alpha2.OperatorGroupSpec {
120
- Selector : metav1.LabelSelector {
121
- MatchLabels : matchingLabel ,
122
- },
123
- },
124
119
}
125
120
_ , err = crc .OperatorsV1alpha2 ().OperatorGroups (testNamespace ).Create (& operatorGroup )
126
121
require .NoError (t , err )
127
122
expectedOperatorGroupStatus := v1alpha2.OperatorGroupStatus {
128
123
Namespaces : []* corev1.Namespace {createdOtherNamespace },
129
124
}
130
125
126
+ // instead of setting the label selector initially, do it here to force immediate reconcile
127
+ fetchedOpGroup , err := crc .OperatorsV1alpha2 ().OperatorGroups (testNamespace ).Get (operatorGroup .GetName (), metav1.GetOptions {})
128
+ fetchedOpGroup .Spec = v1alpha2.OperatorGroupSpec {
129
+ Selector : metav1.LabelSelector {
130
+ MatchLabels : matchingLabel ,
131
+ },
132
+ }
133
+ _ , err = crc .OperatorsV1alpha2 ().OperatorGroups (testNamespace ).Update (fetchedOpGroup )
134
+ require .NoError (t , err )
135
+
131
136
log .Debug ("Waiting on operator group to have correct status" )
132
137
err = wait .Poll (pollInterval , pollDuration , func () (bool , error ) {
133
138
fetched , fetchErr := crc .OperatorsV1alpha2 ().OperatorGroups (testNamespace ).Get (operatorGroup .Name , metav1.GetOptions {})
0 commit comments