feat(metallb): add compatibility with new operator design (#9298)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ 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?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ 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 <kjeld@schouten-lebbing.nl>
This commit is contained in:
Kjeld Schouten 2023-05-30 22:46:18 +02:00 committed by GitHub
parent f0e134a0ad
commit 6fe5f37b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 13 deletions

View File

@ -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

View File

@ -1,6 +0,0 @@
ipAddressPools:
- name: example
autoAssign: true
avoidBuggyIPs: true
addresses:
- 192.168.1.1-192.168.1.100

View File

@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
name: {{ .name }}
namespace: metallb-system
namespace: {{ $.Values.operatorNamespace }}
spec:
ipAddressPools:
{{- range .addressPools }}

View File

@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1
kind: Community
metadata:
name: communities
namespace: metallb-system
namespace: {{ $.Values.operatorNamespace }}
spec:
communities:
{{- range .Values.Communities }}

View File

@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: {{ .name }}
namespace: metallb-system
namespace: {{ $.Values.operatorNamespace }}
spec:
addresses:
{{- range .addresses }}

View File

@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: {{ .name }}
namespace: metallb-system
namespace: {{ $.Values.operatorNamespace }}
spec:
ipAddressPools:
{{- range .addressPools }}

View File

@ -5,7 +5,7 @@ apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
name: {{ .name }}
namespace: metallb-system
namespace: {{ $.Values.operatorNamespace }}
spec:
{{- with .password }}
password: {{ . }}

View File

@ -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" . }}