From 8060a3bf8c549a1c9f2cc6d12e25a7fd2b55f335 Mon Sep 17 00:00:00 2001 From: Aaron Dalton Date: Fri, 12 Jan 2024 15:58:54 -0500 Subject: [PATCH] major(omada-controller): stop playing around with the port, let omada-controller handle it (#16719) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** The Omada chart by default silently changes the internal port to use if ingress is enabled. My understanding was the upstream container always exposed 443 internally which needed to be remapped to not conflict with the default Truenas web server. This seems to no-longer be the case so I propose this weird silent behavior be removed. This PR accomplishes this. ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ X ] 🪛 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?** Not yet - but I'm interested to know the best way to test this. **📃 Notes:** Currently it appears that setting the port works against the upstream container at least on the initial install. Subesequent changes would require changing the port in the UI before changing in Truecharts. **✔️ Checklist:** - [ X ] ⚖️ My code follows the style guidelines of this project - [ X ] 👀 I have performed a self-review of my own code - [ X ] #️⃣ 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: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Aaron Dalton Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/stable/omada-controller/Chart.yaml | 2 +- .../omada-controller/templates/common.yaml | 23 ++++--------------- charts/stable/omada-controller/values.yaml | 1 + 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/charts/stable/omada-controller/Chart.yaml b/charts/stable/omada-controller/Chart.yaml index 7925d997830..60369830be3 100644 --- a/charts/stable/omada-controller/Chart.yaml +++ b/charts/stable/omada-controller/Chart.yaml @@ -1,7 +1,7 @@ kubeVersion: ">=1.24.0-0" apiVersion: v2 name: omada-controller -version: 12.1.7 +version: 13.0.0 appVersion: "5.13" description: Omada is a SDN tool for TP-Link Omada hardware home: https://truecharts.org/charts/stable/omada-controller diff --git a/charts/stable/omada-controller/templates/common.yaml b/charts/stable/omada-controller/templates/common.yaml index edfe493639d..4818dd53663 100644 --- a/charts/stable/omada-controller/templates/common.yaml +++ b/charts/stable/omada-controller/templates/common.yaml @@ -1,24 +1,9 @@ {{/* Render the templates */}} -{{ include "tc.v1.common.loader.init" . }} {{/* -Omada automatically redirects to that port. -Instead of consuming the external 443 port, it's better to switch internal -But still give user the ability to change it. -When ingress is enabled, set this to 443, otherwise set it to whatever `port` is set to +The old behavior of always running on port 443 seams to have changed upstream. The +current upstream behavior is to not allow the port to be changed (without re-install) +after setup. */}} -{{- $port := .Values.service.main.ports.main.port -}} -{{- if .Values.ingress.main.enabled -}} - {{- $port = 443 -}} -{{- end -}} - -{{- $_ := set .Values.workload.main.podSpec.containers.main.env "MANAGE_HTTPS_PORT" $port -}} - -{{- $_ := set .Values.service.main.ports.main "targetPort" $port -}} - -{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.liveness "port" $port -}} -{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.readiness "port" $port -}} -{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.startup "port" $port -}} - -{{ include "tc.v1.common.loader.apply" . }} +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/stable/omada-controller/values.yaml b/charts/stable/omada-controller/values.yaml index 48a984bcc01..375ec1bf79c 100644 --- a/charts/stable/omada-controller/values.yaml +++ b/charts/stable/omada-controller/values.yaml @@ -67,6 +67,7 @@ workload: containers: main: env: + MANAGE_HTTPS_PORT: "{{ .Values.service.main.ports.main.port }}" PORTAL_HTTPS_PORT: "{{ .Values.service.comm.ports.comm.port }}" probes: startup: