Skip to content

Commit

Permalink
fix(chart): Allow setting portName on service (#414)
Browse files Browse the repository at this point in the history
* fix(chart): Allow setting portName on service
  • Loading branch information
HanCheo authored Aug 23, 2024
1 parent 38742fa commit ad4e155
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/atlantis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions charts/atlantis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
2 changes: 1 addition & 1 deletion charts/atlantis/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
8 changes: 8 additions & 0 deletions charts/atlantis/tests/service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions charts/atlantis/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
1 change: 1 addition & 0 deletions charts/atlantis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ service:
type: NodePort
annotations: {}
port: 80
portName: atlantis
nodePort: null
targetPort: 4141
loadBalancerIP: null
Expand Down

0 comments on commit ad4e155

Please sign in to comment.