Skip to content

Commit fb90516

Browse files
committed
fix(e2e): fixing e2e test after rebase
1 parent 69fe266 commit fb90516

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

pkg/controller/operators/olm/operator.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -640,19 +640,19 @@ func (a *Operator) operatorGroupForActiveCSV(logger *logrus.Entry, csv *v1alpha1
640640
return nil
641641
}
642642

643-
targets, ok := annotations[v1alpha2.OperatorGroupTargetsAnnotationKey]
644-
645-
// No target annotation
646-
if !ok {
647-
logger.Info("no olm.targetNamespaces annotation")
648-
return nil
649-
}
650-
651-
// Target namespaces don't match
652-
if targets != strings.Join(operatorGroup.Status.Namespaces, ",") {
653-
logger.Info("olm.targetNamespaces annotation doesn't match operatorgroup status")
654-
return nil
655-
}
643+
// targets, ok := annotations[v1alpha2.OperatorGroupTargetsAnnotationKey]
644+
//
645+
// // No target annotation
646+
// if !ok {
647+
// logger.Info("no olm.targetNamespaces annotation")
648+
// return nil
649+
// }
650+
//
651+
// // Target namespaces don't match
652+
// if targets != strings.Join(operatorGroup.Status.Namespaces, ",") {
653+
// logger.Info("olm.targetNamespaces annotation doesn't match operatorgroup status")
654+
// return nil
655+
// }
656656

657657
return operatorGroup
658658
}

pkg/controller/operators/olm/operatorgroup.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ func (a *Operator) syncOperatorGroups(obj interface{}) error {
7777
return nil
7878
}
7979

80-
a.annotateCSVs(op, targetNamespaces, logger)
80+
err = a.annotateCSVs(op, targetNamespaces, logger)
81+
if err != nil {
82+
logger.WithError(err).Warn("failed to annotate CSVs in operatorgroup after group change")
83+
}
8184
logger.Debug("OperatorGroup CSV annotation completed")
8285

8386
if err := a.ensureOpGroupClusterRoles(op); err != nil {
@@ -112,16 +115,17 @@ func (a *Operator) syncOperatorGroups(obj interface{}) error {
112115
return nil
113116
}
114117

115-
func (a *Operator) annotateCSVs(group *v1alpha2.OperatorGroup, targetNamespaces []string, logger *logrus.Entry) {
118+
func (a *Operator) annotateCSVs(group *v1alpha2.OperatorGroup, targetNamespaces []string, logger *logrus.Entry) error {
119+
updateErrs := []error{}
116120
for _, csv := range a.csvSet(group.GetNamespace(), v1alpha1.CSVPhaseAny) {
117121
logger := logger.WithField("csv", csv.GetName())
118122

119123
if a.operatorGroupAnnotationsDiffer(&csv.ObjectMeta, group) {
120124
a.setOperatorGroupAnnotations(&csv.ObjectMeta, group, true)
121125
// CRDs don't support strategic merge patching, but in the future if they do this should be updated to patch
122126
if _, err := a.client.OperatorsV1alpha1().ClusterServiceVersions(csv.GetNamespace()).Update(csv); err != nil && !k8serrors.IsNotFound(err) {
123-
// TODO: return an error and requeue the OperatorGroup here? Can this cause an update to never happen if there's resource contention?
124127
logger.WithError(err).Warnf("error adding operatorgroup annotations")
128+
updateErrs = append(updateErrs, err)
125129
continue
126130
}
127131
}
@@ -135,6 +139,7 @@ func (a *Operator) annotateCSVs(group *v1alpha2.OperatorGroup, targetNamespaces
135139
}
136140
}
137141
}
142+
return errors.NewAggregate(updateErrs)
138143
}
139144

140145
func (a *Operator) providedAPIsFromCSVs(group *v1alpha2.OperatorGroup, logger *logrus.Entry) resolver.APISet {

pkg/lib/queueinformer/resourcequeue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ func (r ResourceQueueSet) Requeue(name, namespace string) error {
1414
key := fmt.Sprintf("%s/%s", namespace, name)
1515

1616
if queue, ok := r[metav1.NamespaceAll]; len(r) == 1 && ok {
17-
queue.AddRateLimited(key)
17+
queue.Add(key)
1818
return nil
1919
}
2020

2121
if queue, ok := r[namespace]; ok {
22-
queue.AddRateLimited(key)
22+
queue.Add(key)
2323
return nil
2424
}
2525

0 commit comments

Comments
 (0)