Skip to content

Commit

Permalink
ROX-26625: Make Certmonitor Ignore Probe Instances (#2083)
Browse files Browse the repository at this point in the history
* ignoring probe instances

* empty string label
  • Loading branch information
aaa5kameric authored Nov 7, 2024
1 parent c12b5f3 commit aaf828f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions fleetshard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func main() {
Key: reconciler.TenantIDLabelKey,
Operator: metav1.LabelSelectorOpExists,
},
{
Key: reconciler.ProbeLabelKey,
Operator: metav1.LabelSelectorOpDoesNotExist,
},
},
},
}
Expand Down
11 changes: 9 additions & 2 deletions fleetshard/pkg/central/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit aaf828f

Please sign in to comment.