Skip to content

Commit

Permalink
Simplify object names in tcp-server-chart
Browse files Browse the repository at this point in the history
Shorten the names for the deployed objects by only including the release
name:

deploy/<release>
ingress/<release>
svc/<release>-control
svc/<release>-data

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
  • Loading branch information
welteki authored and alexellis committed Nov 18, 2022
1 parent 699e5c3 commit c577abc
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
9 changes: 0 additions & 9 deletions chart/inlets-tcp-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
*/}}
{{- define "inlets-pro.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "inlets-pro.fullname" . }}-control-plane
name: {{ include "inlets-pro.fullname" . }}-control
labels:
{{- include "inlets-pro.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion chart/inlets-tcp-server/templates/data-plane-service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "inlets-pro.fullname" . }}-data-plane
name: {{ include "inlets-pro.fullname" . }}-data
labels:
{{- include "inlets-pro.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion chart/inlets-tcp-server/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ spec:
pathType: Prefix
backend:
service:
name: {{ include "inlets-pro.fullname" . }}-control-plane
name: {{ include "inlets-pro.fullname" . }}-control
port:
number: {{ .Values.controlPlane.port }}
1 change: 0 additions & 1 deletion chart/inlets-tcp-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ securityContext: {}
# runAsUser: 1000

nameOverride: ""
fullnameOverride: ""

0 comments on commit c577abc

Please sign in to comment.