From 0bdaa9eae900c7e08a6ad20546b1c9729d248803 Mon Sep 17 00:00:00 2001 From: Israel Blancas Date: Tue, 10 Jan 2023 11:21:31 +0100 Subject: [PATCH] [bug_fix] Missing resource from OpenShift Routes prevents them to be deployed in OpenShift clusters (#1337) * Add missing resource for OpenShift routes Signed-off-by: Israel Blancas * Add missing file Signed-off-by: Israel Blancas * Add missing changelog file Signed-off-by: Israel Blancas Signed-off-by: Israel Blancas --- .chloggen/1337-fix-routes-openshift.yaml | 16 ++++++++++++++++ ...telemetry-operator.clusterserviceversion.yaml | 1 + config/rbac/role.yaml | 1 + controllers/opentelemetrycollector_controller.go | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 .chloggen/1337-fix-routes-openshift.yaml diff --git a/.chloggen/1337-fix-routes-openshift.yaml b/.chloggen/1337-fix-routes-openshift.yaml new file mode 100755 index 0000000000..10c81316cf --- /dev/null +++ b/.chloggen/1337-fix-routes-openshift.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action) +component: operator + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "There was a missing resource in the OpenShift routes ClusterBinding" + +# One or more tracking issues related to the change +issues: [1337] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml b/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml index 7b03dd022c..8ba67b540b 100644 --- a/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml +++ b/bundle/manifests/opentelemetry-operator.clusterserviceversion.yaml @@ -261,6 +261,7 @@ spec: - route.openshift.io resources: - routes + - routes/custom-host verbs: - create - delete diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 37e368696b..1d8a6c605c 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -172,6 +172,7 @@ rules: - route.openshift.io resources: - routes + - routes/custom-host verbs: - create - delete diff --git a/controllers/opentelemetrycollector_controller.go b/controllers/opentelemetrycollector_controller.go index 4f62c93905..ca171d2d13 100644 --- a/controllers/opentelemetrycollector_controller.go +++ b/controllers/opentelemetrycollector_controller.go @@ -181,7 +181,7 @@ func NewReconciler(p Params) *OpenTelemetryCollectorReconciler { // +kubebuilder:rbac:groups=opentelemetry.io,resources=opentelemetrycollectors/status,verbs=get;update;patch // +kubebuilder:rbac:groups=opentelemetry.io,resources=opentelemetrycollectors/finalizers,verbs=get;update;patch // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=route.openshift.io,resources=routes;routes/custom-host,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;create;update // +kubebuilder:rbac:groups="",resources=events,verbs=create;patch