From f639508e60b2cf37a2d95666c9f62408977cd2bc Mon Sep 17 00:00:00 2001 From: aaa5kameric Date: Wed, 30 Oct 2024 12:49:17 +0100 Subject: [PATCH 1/2] ignoring probe instances --- 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..9e76fb0ce 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] = "true" + } + return labels } func getTenantAnnotations(c private.ManagedCentral) map[string]string { From e4ae9f3f377e4f3867ca2dd315c65afe0cc3230e Mon Sep 17 00:00:00 2001 From: aaa5kameric Date: Fri, 1 Nov 2024 13:05:36 +0100 Subject: [PATCH 2/2] empty string label --- fleetshard/pkg/central/reconciler/reconciler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fleetshard/pkg/central/reconciler/reconciler.go b/fleetshard/pkg/central/reconciler/reconciler.go index 9e76fb0ce..b5a4274b8 100644 --- a/fleetshard/pkg/central/reconciler/reconciler.go +++ b/fleetshard/pkg/central/reconciler/reconciler.go @@ -1868,7 +1868,7 @@ func getTenantLabels(c private.ManagedCentral) map[string]string { instanceTypeLabelKey: c.Spec.InstanceType, } if c.Metadata.Internal { - labels[ProbeLabelKey] = "true" + labels[ProbeLabelKey] = "" } return labels }