Skip to content

Commit

Permalink
add watch logic for endpoint sa when deleted (#1407)
Browse files Browse the repository at this point in the history
* add watch logic for sa when deleted

Signed-off-by: Coleen Iona Quadros <[email protected]>

* refactor

Signed-off-by: Coleen Iona Quadros <[email protected]>

---------

Signed-off-by: Coleen Iona Quadros <[email protected]>
  • Loading branch information
coleenquadros authored Apr 16, 2024
1 parent 4607dc0 commit 7ed3670
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,11 @@ func (r *PlacementRuleReconciler) SetupWithManager(mgr ctrl.Manager) error {
&source.Kind{Type: &corev1.Secret{}},
&handler.EnqueueRequestForObject{},
builder.WithPredicates(getPred(config.AlertmanagerAccessorSecretName, config.GetDefaultNamespace(), false, false, true)),
).
Watches(
&source.Kind{Type: &corev1.ServiceAccount{}},
&handler.EnqueueRequestForObject{},
builder.WithPredicates(getPred(config.HubEndpointSaName, config.GetDefaultNamespace(), false, false, true)),
)
// create and return a new controller
return ctrBuilder.Complete(r)
Expand Down
1 change: 1 addition & 0 deletions operators/multiclusterobservability/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ const (
HubMetricsCollectorName = "metrics-collector-deployment"
HubUwlMetricsCollectorName = "uwl-metrics-collector-deployment"
HubUwlMetricsCollectorNs = "openshift-user-workload-monitoring"
HubEndpointSaName = "endpoint-observability-operator-sa"
)

// ObjectStorgeConf is used to Unmarshal from bytes to do validation.
Expand Down

0 comments on commit 7ed3670

Please sign in to comment.