From 236fe5cbc24c6be74f52aedc568d6ab1f6799fe6 Mon Sep 17 00:00:00 2001 From: Rob Reus Date: Wed, 22 Nov 2023 23:24:55 +0100 Subject: [PATCH] fix(common): Bugfixes on codeserver ingress (#615) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** The codeserver ingress uses a non existent include to get the fullname. It also does not set a name for the ingress, causing the resulting ingress resource have no name which kubernetes does not accept. It also uses the wrong namespace for middleware when no other regular ingresses are configured due to the operator verification only checking `.Values.ingress`. **โš™๏ธ 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?** Applying the fixes locally and running the updated code. The codeserver ingress got deployed without problems and worked perfectly. **๐Ÿ“ƒ Notes:** **โœ”๏ธ Checklist:** - [X] โš–๏ธ My code follows the style guidelines of this project - [X] ๐Ÿ‘€ 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._ --------- Co-authored-by: Kjeld Schouten --- library/common/templates/addons/code-server/_codeserver.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/common/templates/addons/code-server/_codeserver.tpl b/library/common/templates/addons/code-server/_codeserver.tpl index 599e8624..9bec0c69 100644 --- a/library/common/templates/addons/code-server/_codeserver.tpl +++ b/library/common/templates/addons/code-server/_codeserver.tpl @@ -40,11 +40,12 @@ It will include / inject the required templates based on the given values. {{- $_ := set $ingressValues "nameOverride" "codeserver" -}} {{/* Determine the target service name & port */}} - {{- $svcName := printf "%v-codeserver" (include "tc.v1.common.names.fullname" .) -}} + {{- $svcName := printf "%v-codeserver" (include "tc.v1.common.lib.chart.names.fullname" .) -}} {{- $svcPort := .Values.addons.codeserver.service.ports.codeserver.port -}} {{- range $_, $host := $ingressValues.hosts -}} {{- $_ := set (index $host.paths 0) "service" (dict "name" $svcName "port" $svcPort) -}} {{- end -}} + {{- $_ := set $ingressValues "name" $svcName -}} {{- $_ := set $ "ObjectValues" (dict "ingress" $ingressValues) -}} {{- include "tc.v1.common.class.ingress" $ -}} {{- $_ := unset $ "ObjectValues" -}}