From 6fe5f37b00329ebccb99068b81f33f0f5eedf84c Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Tue, 30 May 2023 22:46:18 +0200 Subject: [PATCH] feat(metallb): add compatibility with new operator design (#9298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Kjeld Schouten --- charts/enterprise/metallb-config/Chart.yaml | 4 ++-- charts/enterprise/metallb-config/ci/pool-values.yaml | 6 ------ .../metallb-config/templates/_bgpadvertisement.tpl | 2 +- charts/enterprise/metallb-config/templates/_community.tpl | 2 +- .../enterprise/metallb-config/templates/_ipaddresspool.tpl | 2 +- .../metallb-config/templates/_l2advertisement.tpl | 2 +- charts/enterprise/metallb-config/templates/_peers.tpl | 2 +- charts/enterprise/metallb-config/templates/common.yaml | 6 ++++++ 8 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 charts/enterprise/metallb-config/ci/pool-values.yaml diff --git a/charts/enterprise/metallb-config/Chart.yaml b/charts/enterprise/metallb-config/Chart.yaml index 37a453adc3e..7cbef056294 100644 --- a/charts/enterprise/metallb-config/Chart.yaml +++ b/charts/enterprise/metallb-config/Chart.yaml @@ -10,7 +10,7 @@ keywords: dependencies: - name: common repository: https://library-charts.truecharts.org - version: 12.10.4 + version: 12.10.9 kubeVersion: ">=1.16.0-0" maintainers: - email: info@truecharts.org @@ -22,7 +22,7 @@ sources: - https://github.com/metallb/metallb - https://metallb.universe.tf type: application -version: 1.0.1 +version: 1.1.0 annotations: truecharts.org/catagories: | - core diff --git a/charts/enterprise/metallb-config/ci/pool-values.yaml b/charts/enterprise/metallb-config/ci/pool-values.yaml deleted file mode 100644 index e69714e3142..00000000000 --- a/charts/enterprise/metallb-config/ci/pool-values.yaml +++ /dev/null @@ -1,6 +0,0 @@ -ipAddressPools: - - name: example - autoAssign: true - avoidBuggyIPs: true - addresses: - - 192.168.1.1-192.168.1.100 diff --git a/charts/enterprise/metallb-config/templates/_bgpadvertisement.tpl b/charts/enterprise/metallb-config/templates/_bgpadvertisement.tpl index 1ce8b9a7550..27790c0e17d 100644 --- a/charts/enterprise/metallb-config/templates/_bgpadvertisement.tpl +++ b/charts/enterprise/metallb-config/templates/_bgpadvertisement.tpl @@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1 kind: BGPAdvertisement metadata: name: {{ .name }} - namespace: metallb-system + namespace: {{ $.Values.operatorNamespace }} spec: ipAddressPools: {{- range .addressPools }} diff --git a/charts/enterprise/metallb-config/templates/_community.tpl b/charts/enterprise/metallb-config/templates/_community.tpl index 24aed9168b4..3cd66f96e98 100644 --- a/charts/enterprise/metallb-config/templates/_community.tpl +++ b/charts/enterprise/metallb-config/templates/_community.tpl @@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1 kind: Community metadata: name: communities - namespace: metallb-system + namespace: {{ $.Values.operatorNamespace }} spec: communities: {{- range .Values.Communities }} diff --git a/charts/enterprise/metallb-config/templates/_ipaddresspool.tpl b/charts/enterprise/metallb-config/templates/_ipaddresspool.tpl index e4b04e4d796..f4c020920f0 100644 --- a/charts/enterprise/metallb-config/templates/_ipaddresspool.tpl +++ b/charts/enterprise/metallb-config/templates/_ipaddresspool.tpl @@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1 kind: IPAddressPool metadata: name: {{ .name }} - namespace: metallb-system + namespace: {{ $.Values.operatorNamespace }} spec: addresses: {{- range .addresses }} diff --git a/charts/enterprise/metallb-config/templates/_l2advertisement.tpl b/charts/enterprise/metallb-config/templates/_l2advertisement.tpl index 651b0b0d79a..beef850b9a6 100644 --- a/charts/enterprise/metallb-config/templates/_l2advertisement.tpl +++ b/charts/enterprise/metallb-config/templates/_l2advertisement.tpl @@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1 kind: L2Advertisement metadata: name: {{ .name }} - namespace: metallb-system + namespace: {{ $.Values.operatorNamespace }} spec: ipAddressPools: {{- range .addressPools }} diff --git a/charts/enterprise/metallb-config/templates/_peers.tpl b/charts/enterprise/metallb-config/templates/_peers.tpl index 44c8feeffc1..848e72462ae 100644 --- a/charts/enterprise/metallb-config/templates/_peers.tpl +++ b/charts/enterprise/metallb-config/templates/_peers.tpl @@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta2 kind: BGPPeer metadata: name: {{ .name }} - namespace: metallb-system + namespace: {{ $.Values.operatorNamespace }} spec: {{- with .password }} password: {{ . }} diff --git a/charts/enterprise/metallb-config/templates/common.yaml b/charts/enterprise/metallb-config/templates/common.yaml index 1f706680e0e..05373874e9e 100644 --- a/charts/enterprise/metallb-config/templates/common.yaml +++ b/charts/enterprise/metallb-config/templates/common.yaml @@ -1,6 +1,12 @@ {{/* Make sure all variables are set properly */}} {{- include "tc.v1.common.loader.init" . }} +{{- $operatorNamespace := "metallb-system" -}} +{{- if .Values.operator.metallb -}} +{{ $operatorNamespace = ( $.Values.operator.metallb.namespace | default "metallb-system") }} +{{- end -}} +{{- $_ := set $.Values "operatorNamespace" $operatorNamespace -}} + {{/* Render the templates */}} {{ include "tc.v1.common.loader.apply" . }}