From babd56180dd70c7f0e3164f2fa127fa75cd8e658 Mon Sep 17 00:00:00 2001 From: Shane Utt Date: Tue, 10 Oct 2023 16:06:05 -0400 Subject: [PATCH] feat: enable gw ctrl to read events Signed-off-by: Shane Utt --- config/rbac/role.yaml | 8 ++++++++ controllers/gateway_controller.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index f2ab15fd..4edf202d 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -37,6 +37,14 @@ rules: - endpoints/status verbs: - get +- apiGroups: + - "" + resources: + - events + verbs: + - get + - list + - watch - apiGroups: - "" resources: diff --git a/controllers/gateway_controller.go b/controllers/gateway_controller.go index 68121e5e..59c26d8c 100644 --- a/controllers/gateway_controller.go +++ b/controllers/gateway_controller.go @@ -30,6 +30,8 @@ import ( //+kubebuilder:rbac:groups=core,resources=endpoints,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=core,resources=endpoints/status,verbs=get +//+kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch + const gatewayServiceLabel = "konghq.com/owned-by-gateway" // GatewayReconciler reconciles a Gateway object