From ad4e15511afe9ee70162ee13487eec98f9976539 Mon Sep 17 00:00:00 2001 From: Moby <05.hanch.it@gmail.com> Date: Fri, 23 Aug 2024 17:37:49 +0900 Subject: [PATCH] fix(chart): Allow setting portName on service (#414) * fix(chart): Allow setting portName on service --- charts/atlantis/Chart.yaml | 2 +- charts/atlantis/README.md | 1 + charts/atlantis/templates/service.yaml | 2 +- charts/atlantis/tests/service_test.yaml | 8 ++++++++ charts/atlantis/values.schema.json | 7 +++++++ charts/atlantis/values.yaml | 1 + 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/charts/atlantis/Chart.yaml b/charts/atlantis/Chart.yaml index 48a723a4..8137b483 100644 --- a/charts/atlantis/Chart.yaml +++ b/charts/atlantis/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v1 appVersion: v0.28.5 description: A Helm chart for Atlantis https://www.runatlantis.io name: atlantis -version: 5.4.4 +version: 5.4.5 keywords: - terraform home: https://www.runatlantis.io diff --git a/charts/atlantis/README.md b/charts/atlantis/README.md index 2c6fc5ce..3e191d7b 100644 --- a/charts/atlantis/README.md +++ b/charts/atlantis/README.md @@ -184,6 +184,7 @@ extraManifests: | service.loadBalancerSourceRanges | list | `[]` | | | service.nodePort | string | `nil` | | | service.port | int | `80` | | +| service.portName | string | `"atlantis"` | | | service.targetPort | int | `4141` | | | service.type | string | `"NodePort"` | | | serviceAccount.annotations | object | `{}` | Annotations for the Service Account. Check values.yaml for examples. | diff --git a/charts/atlantis/templates/service.yaml b/charts/atlantis/templates/service.yaml index d26ebdc5..75b43f0f 100644 --- a/charts/atlantis/templates/service.yaml +++ b/charts/atlantis/templates/service.yaml @@ -32,7 +32,7 @@ spec: nodePort: {{ .Values.service.nodePort }} {{- end }} protocol: TCP - name: atlantis + name: {{ .Values.service.portName }} selector: app: {{ template "atlantis.name" . }} release: {{ .Release.Name }} diff --git a/charts/atlantis/tests/service_test.yaml b/charts/atlantis/tests/service_test.yaml index 8e174472..d71aaf3f 100644 --- a/charts/atlantis/tests/service_test.yaml +++ b/charts/atlantis/tests/service_test.yaml @@ -35,6 +35,14 @@ tests: - equal: path: spec.externalTrafficPolicy value: Local + - it: portName + set: + service: + portName: http-atlantis + asserts: + - equal: + path: spec.ports[0].name + value: http-atlantis - it: loadBalancerSourceRanges set: service: diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index 2353aa76..ce3e7554 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -498,6 +498,13 @@ ], "default": 80 }, + "portName": { + "description": "Port name to expose on the service.", + "type": [ + "string" + ], + "default": "atlantis" + }, "nodePort": { "description": "Port to expose on the node when the service type is NodePort.", "type": [ diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index a799ace4..ab8c3cf3 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -286,6 +286,7 @@ service: type: NodePort annotations: {} port: 80 + portName: atlantis nodePort: null targetPort: 4141 loadBalancerIP: null