From aaf828f0d8e3c4ba4b3e831899a4fa61530e0e18 Mon Sep 17 00:00:00 2001 From: aaa5kameric <159419281+aaa5kameric@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:43:31 -0500 Subject: [PATCH] ROX-26625: Make Certmonitor Ignore Probe Instances (#2083) * ignoring probe instances * empty string label --- fleetshard/main.go | 4 ++++ fleetshard/pkg/central/reconciler/reconciler.go | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fleetshard/main.go b/fleetshard/main.go index 1c9a66399..343937929 100644 --- a/fleetshard/main.go +++ b/fleetshard/main.go @@ -76,6 +76,10 @@ func main() { Key: reconciler.TenantIDLabelKey, Operator: metav1.LabelSelectorOpExists, }, + { + Key: reconciler.ProbeLabelKey, + Operator: metav1.LabelSelectorOpDoesNotExist, + }, }, }, } diff --git a/fleetshard/pkg/central/reconciler/reconciler.go b/fleetshard/pkg/central/reconciler/reconciler.go index d9fc7df2c..b5a4274b8 100644 --- a/fleetshard/pkg/central/reconciler/reconciler.go +++ b/fleetshard/pkg/central/reconciler/reconciler.go @@ -74,7 +74,10 @@ const ( managedByLabelKey = "app.kubernetes.io/managed-by" orgIDLabelKey = "rhacs.redhat.com/org-id" TenantIDLabelKey = "rhacs.redhat.com/tenant" - centralExpiredAtKey = "rhacs.redhat.com/expired-at" + + ProbeLabelKey = "rhacs.redhat.com/probe" + + centralExpiredAtKey = "rhacs.redhat.com/expired-at" auditLogNotifierKey = "com.redhat.rhacs.auditLogNotifier" auditLogNotifierName = "Platform Audit Logs" @@ -1857,13 +1860,17 @@ func (r *CentralReconciler) ensureRouteDeleted(ctx context.Context, routeSupplie } func getTenantLabels(c private.ManagedCentral) map[string]string { - return map[string]string{ + labels := map[string]string{ managedByLabelKey: labelManagedByFleetshardValue, instanceLabelKey: c.Metadata.Name, orgIDLabelKey: c.Spec.Auth.OwnerOrgId, TenantIDLabelKey: c.Id, instanceTypeLabelKey: c.Spec.InstanceType, } + if c.Metadata.Internal { + labels[ProbeLabelKey] = "" + } + return labels } func getTenantAnnotations(c private.ManagedCentral) map[string]string {