Skip to content

Commit

Permalink
Revert "fix: remove invalid owner ref on cluster role (#460)"
Browse files Browse the repository at this point in the history
This reverts commit fc12c57.
  • Loading branch information
simonpasquier committed Apr 18, 2024
1 parent adf7630 commit 1851f9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/controllers/monitoring/monitoring-stack/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func newAlertManagerClusterRole(ms *stack.MonitoringStack, rbacResourceName stri
Kind: "ClusterRole",
},
ObjectMeta: metav1.ObjectMeta{
Name: rbacResourceName,
Name: rbacResourceName,
Namespace: ms.Namespace,
},
Rules: []rbacv1.PolicyRule{{
APIGroups: []string{"security.openshift.io"},
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Updater struct {
}

func (r Updater) Reconcile(ctx context.Context, c client.Client, scheme *runtime.Scheme) error {

if r.resourceOwner.GetNamespace() == r.resource.GetNamespace() {
if err := controllerutil.SetControllerReference(r.resourceOwner, r.resource, scheme); err != nil {
return fmt.Errorf("%s/%s (%s): updater failed to set owner reference: %w",
Expand All @@ -38,7 +39,6 @@ func (r Updater) Reconcile(ctx context.Context, c client.Client, scheme *runtime
r.resource.GetNamespace(), r.resource.GetName(),
r.resource.GetObjectKind().GroupVersionKind().String(), err)
}

return nil
}

Expand Down

0 comments on commit 1851f9b

Please sign in to comment.