Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAWNG-418: Fixes handling of ingresses in route-supported clusters #107

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion deploy/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ rules:
- routes/custom-host
verbs:
- create
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- '*'
- apiGroups:
- template.openshift.io
resources:
Expand All @@ -84,4 +90,3 @@ rules:
- update
- create
- delete

16 changes: 8 additions & 8 deletions pkg/controller/hawtio/hawtio_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ func add(mgr manager.Manager, r reconcile.Reconciler, routeSupport bool) error {
if err != nil {
return errs.Wrap(err, "Failed to create watch for Route resource")
}
}

err = c.Watch(&source.Kind{Type: &networkingv1.Ingress{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &hawtiov1.Hawtio{},
})
if err != nil {
return errs.Wrap(err, "Failed to create watch for Ingress resource")
} else {
err = c.Watch(&source.Kind{Type: &networkingv1.Ingress{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &hawtiov1.Hawtio{},
})
if err != nil {
return errs.Wrap(err, "Failed to create watch for Ingress resource")
}
}

err = c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForOwner{
Expand Down
Loading