Skip to content

Commit 4061a43

Browse files
authored
update packageName annotation in tracking configmap to be more unique (#1181)
* update packageName annotation in tracking configmap to be more unique Signed-off-by: Ben Luzarraga <[email protected]> * additional annotation location Signed-off-by: Ben Luzarraga <[email protected]> * backwards compatibility check to update existing configmaps Signed-off-by: Ben Luzarraga <[email protected]> --------- Signed-off-by: Ben Luzarraga <[email protected]>
1 parent e381293 commit 4061a43

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

controllers/operandrequestnoolm/reconcile_operator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (r *Reconciler) reconcileOpReqCM(ctx context.Context, requestInstance *oper
211211
cm.Annotations[registryKey.Namespace+"."+registryKey.Name+"/config"] = "true"
212212
cm.Annotations[requestInstance.Namespace+"."+requestInstance.Name+"."+operand.Name+"/request"] = opt.Channel
213213
cm.Annotations[requestInstance.Namespace+"."+requestInstance.Name+"."+operand.Name+"/operatorNamespace"] = namespace
214-
cm.Annotations["packageName"] = opt.PackageName
214+
cm.Annotations["operator.ibm.com.common-service/packageName"] = opt.PackageName
215215
if opt.ConfigName != "" {
216216
cm.Annotations[requestInstance.Namespace+"."+requestInstance.Name+"."+operand.Name+"/config"] = opt.ConfigName
217217
} else {
@@ -549,7 +549,7 @@ func (r *Reconciler) generateClusterObjects(o *operatorv1alpha1.Operator, regist
549549
registryKey.Namespace + "." + registryKey.Name + "/config": "true",
550550
requestKey.Namespace + "." + requestKey.Name + "." + o.Name + "/request": o.Channel,
551551
requestKey.Namespace + "." + requestKey.Name + "." + o.Name + "/operatorNamespace": namespace,
552-
"packageName": o.PackageName,
552+
"operator.ibm.com.common-service/packageName": o.PackageName,
553553
}
554554
if o.ConfigName != "" {
555555
annotations[requestKey.Namespace+"."+requestKey.Name+"."+o.Name+"/config"] = o.ConfigName

controllers/operator/manager.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,12 @@ func (m *ODLMOperator) GetOpReqCM(ctx context.Context, operatorName, operatorNs,
485485

486486
for _, cm := range cmList.Items {
487487
if cm.Annotations != nil {
488-
if pkg, exists := cm.Annotations["packageName"]; exists && pkg == operatorName {
488+
if pkg, exists := cm.Annotations["operator.ibm.com.common-service/packageName"]; exists && pkg == operatorName {
489489
cmCandidates = append(cmCandidates, cm)
490+
} else if _, ok := cm.Labels[constant.OpreqLabel]; ok {
491+
if pkg, old_anno_exists := cm.Annotations["packageName"]; old_anno_exists && pkg == operatorName {
492+
cmCandidates = append(cmCandidates, cm)
493+
}
490494
}
491495
}
492496
}

0 commit comments

Comments
 (0)