From b4ff2f68f8bcc4d06b8d8d5b7d5aee0355b6ce4f Mon Sep 17 00:00:00 2001 From: Tom Zaspel Date: Thu, 19 Feb 2026 11:06:50 +0100 Subject: [PATCH] chore: replace chart value from the _helpers.tpl and set it to bentopdf --- chart/templates/NOTES.txt | 10 +++++----- chart/templates/_helpers.tpl | 19 +++++++++---------- chart/templates/deployment.yaml | 8 ++++---- chart/templates/gateway.yaml | 4 ++-- chart/templates/httproute.yaml | 8 ++++---- chart/templates/ingress.yaml | 6 +++--- chart/templates/service.yaml | 6 +++--- chart/templates/tests/test-connection.yaml | 6 +++--- 8 files changed, 33 insertions(+), 34 deletions(-) diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt index c99d3b0..caf2882 100644 --- a/chart/templates/NOTES.txt +++ b/chart/templates/NOTES.txt @@ -2,7 +2,7 @@ {{- if .Values.httpRoute.enabled }} {{- $defaultGatewayName := .Values.gateway.name -}} {{- if not $defaultGatewayName -}} -{{- $defaultGatewayName = printf "%s-gateway" (include "chart.fullname" .) -}} +{{- $defaultGatewayName = printf "%s-gateway" (include "bentopdf.fullname" .) -}} {{- end -}} {{- $defaultGatewayNs := .Release.Namespace -}} {{- if .Values.gateway.enabled -}} @@ -31,16 +31,16 @@ {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "chart.fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "bentopdf.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "chart.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "bentopdf.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "bentopdf.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "bentopdf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 52b41f3..8e9fada 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* -Expand the name of the chart. +Expand the name of the bentopdf */}} -{{- define "chart.name" -}} +{{- define "bentopdf.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "chart.fullname" -}} +{{- define "bentopdf.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "chart.chart" -}} +{{- define "bentopdf.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "chart.labels" -}} -helm.sh/chart: {{ include "chart.chart" . }} -{{ include "chart.selectorLabels" . }} +{{- define "bentopdf.labels" -}} +helm.sh/chart: {{ include "bentopdf.chart" . }} +{{ include "bentopdf.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,8 +45,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "chart.name" . }} +{{- define "bentopdf.selectorLabels" -}} +app.kubernetes.io/name: {{ include "bentopdf.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} - diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 5cde309..1d10c17 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -1,14 +1,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - {{- include "chart.selectorLabels" . | nindent 6 }} + {{- include "bentopdf.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -16,7 +16,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "chart.labels" . | nindent 8 }} + {{- include "bentopdf.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/chart/templates/gateway.yaml b/chart/templates/gateway.yaml index 9914d0c..3d2d378 100644 --- a/chart/templates/gateway.yaml +++ b/chart/templates/gateway.yaml @@ -1,7 +1,7 @@ {{- if .Values.gateway.enabled -}} {{- $gatewayName := .Values.gateway.name -}} {{- if not $gatewayName -}} -{{- $gatewayName = printf "%s-gateway" (include "chart.fullname" .) -}} +{{- $gatewayName = printf "%s-gateway" (include "bentopdf.fullname" .) -}} {{- end -}} {{- $gatewayNs := default .Release.Namespace .Values.gateway.namespace -}} apiVersion: gateway.networking.k8s.io/v1 @@ -10,7 +10,7 @@ metadata: name: {{ $gatewayName }} namespace: {{ $gatewayNs }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.gateway.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/chart/templates/httproute.yaml b/chart/templates/httproute.yaml index 0c945dc..1a68e74 100644 --- a/chart/templates/httproute.yaml +++ b/chart/templates/httproute.yaml @@ -2,9 +2,9 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -25,7 +25,7 @@ spec: {{- end }} {{- else }} # Default parentRef when parentRefs is empty or not set - - name: {{ .Values.gateway.name | default (printf "%s-gateway" (include "chart.fullName" .)) | quote }} + - name: {{ .Values.gateway.name | default (printf "%s-gateway" (include "bentopdf.fullName" .)) | quote }} namespace: {{ default .Release.Namespace .Values.gateway.namespace | quote }} sectionName: "http" {{- end }} @@ -44,7 +44,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} backendRefs: - - name: {{ include "chart.fullname" }} + - name: {{ include "bentopdf.fullname" }} port: {{ $.Values.service.port }} weight: 1 {{- end }} diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index 89ec883..0483758 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -2,9 +2,9 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -35,7 +35,7 @@ spec: {{- end }} backend: service: - name: {{ include "chart.fullname" $ }} + name: {{ include "bentopdf.fullname" $ }} port: number: {{ $.Values.service.port }} {{- end }} diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index dfc5b3a..b146567 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "chart.fullname" . }} + name: {{ include "bentopdf.fullname" . }} labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -12,4 +12,4 @@ spec: protocol: TCP name: http selector: - {{- include "chart.selectorLabels" . | nindent 4 }} + {{- include "bentopdf.selectorLabels" . | nindent 4 }} diff --git a/chart/templates/tests/test-connection.yaml b/chart/templates/tests/test-connection.yaml index 2a38998..583ff07 100644 --- a/chart/templates/tests/test-connection.yaml +++ b/chart/templates/tests/test-connection.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "chart.fullname" . }}-test-connection" + name: "{{ include "bentopdf.fullname" . }}-test-connection" labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "bentopdf.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['-qO-', 'http://{{ include "chart.fullname" . }}:{{ .Values.service.port }}/'] + args: ['-qO-', 'http://{{ include "bentopdf.fullname" . }}:{{ .Values.service.port }}/'] restartPolicy: Never