Fix conditional RBAC to be added on NetBird key existence (#26)

Operator checks for existence of NetBird API key to create controllers
for Service, NBResource, NBPolicy ...etc, while the Helm chart checks
for Values.ingress.enabled, this causes crashes if NetBird API Key is
provided but ingress.enabled is set to `false`.

This fixes this discrepancy by checking NetBird API key in Helm instead
of ingress enabled value.

resolves #13
This commit is contained in:
M. Essam
2025-04-07 08:05:39 +02:00
committed by GitHub
parent b06e9b1de2
commit 3f4137a153
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -2,5 +2,5 @@ apiVersion: v2
name: kubernetes-operator
description: NetBird Kubernetes Operator
type: application
version: 0.1.6
version: 0.1.7
appVersion: "0.1.2"
+3 -3
View File
@@ -27,7 +27,7 @@ rules:
- get
- patch
- update
{{- if .Values.ingress.enabled }}
{{- if or .Values.netbirdAPI.key .Values.netbirdAPI.keyFromSecret }}
- apiGroups:
- netbird.io
resources:
@@ -108,7 +108,7 @@ rules:
- get
- list
- watch
{{- if or .Values.ingress.enabled .Values.clusterSecretsPermissions.allowAllSecrets }}
{{- if or (or .Values.netbirdAPI.key .Values.netbirdAPI.keyFromSecret) .Values.clusterSecretsPermissions.allowAllSecrets }}
- apiGroups:
- ""
resources:
@@ -117,7 +117,7 @@ rules:
- get
- list
- watch
{{- if .Values.ingress.enabled }}
{{- if or .Values.netbirdAPI.key .Values.netbirdAPI.keyFromSecret }}
- patch
- update
- create