-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow overriding release name #416
Changes from all commits
fb9d629
e125904
0df4918
ffe258f
b70c4fc
8d5c47e
f12de10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,8 @@ | |
Expand the name of the chart. | ||
*/}} | ||
{{- define "hono.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- $nameOverride := .dot.Values.nameOverride -}} | ||
{{- empty $nameOverride | ternary .dot.Chart.Name (tpl $nameOverride .dot ) | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
|
@@ -25,14 +26,16 @@ 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 "hono.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- $fullnameOverride := .dot.Values.fullnameOverride -}} | ||
{{- if $fullnameOverride -}} | ||
{{- (tpl $fullnameOverride .dot) | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- $nameOverride := .dot.Values.nameOverride -}} | ||
{{- $name := empty $nameOverride | ternary .dot.Chart.Name (tpl $nameOverride .dot) -}} | ||
Comment on lines
28
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain the motivation for the change towards requiring a dict with the Same applies also to the |
||
{{- if contains $name .dot.Release.Name -}} | ||
{{- .dot.Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- printf "%s-%s" .dot.Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
@@ -41,7 +44,7 @@ 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 "hono.chart" }} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- printf "%s-%s" .dot.Chart.Name .dot.Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
|
@@ -88,9 +91,9 @@ Add standard labels for resources as recommended by Helm best practices. | |
{{- define "hono.std.labels" -}} | ||
app.kubernetes.io/name: {{ include "hono.name" . | quote }} | ||
helm.sh/chart: {{ include "hono.chart" . | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
app.kubernetes.io/instance: {{ .Release.Name | quote }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
app.kubernetes.io/managed-by: {{ .dot.Release.Service | quote }} | ||
app.kubernetes.io/instance: {{ .dot.Release.Name | quote }} | ||
app.kubernetes.io/version: {{ .dot.Chart.AppVersion | quote }} | ||
{{- end }} | ||
|
||
|
||
|
@@ -102,11 +105,11 @@ The scope passed in is expected to be a dict with keys | |
- "component": the value to use for the "app.kubernetes.io/component" label | ||
*/}} | ||
{{- define "hono.metadata" -}} | ||
name: {{ printf "%s-%s" .dot.Release.Name .name | quote }} | ||
name: {{ printf "%s-%s" (include "hono.fullname" . ) .name | quote }} | ||
namespace: {{ .dot.Release.Namespace | quote }} | ||
labels: | ||
app.kubernetes.io/name: {{ include "hono.name" .dot | quote }} | ||
helm.sh/chart: {{ include "hono.chart" .dot | quote }} | ||
app.kubernetes.io/name: {{ include "hono.name" . | quote }} | ||
helm.sh/chart: {{ include "hono.chart" . | quote }} | ||
app.kubernetes.io/managed-by: {{ .dot.Release.Service | quote }} | ||
app.kubernetes.io/instance: {{ .dot.Release.Name | quote }} | ||
app.kubernetes.io/version: {{ .dot.Chart.AppVersion | quote }} | ||
|
@@ -122,7 +125,7 @@ The scope passed in is expected to be a dict with keys | |
- "component": the value of the "app.kubernetes.io/component" label to match | ||
*/}} | ||
{{- define "hono.matchLabels" -}} | ||
app.kubernetes.io/name: {{ include "hono.name" .dot | quote }} | ||
app.kubernetes.io/name: {{ include "hono.name" . | quote }} | ||
app.kubernetes.io/instance: {{ .dot.Release.Name | quote }} | ||
app.kubernetes.io/component: {{ .component | quote }} | ||
{{- end }} | ||
|
@@ -237,7 +240,7 @@ messaging: | |
{{- if .dot.Values.amqpMessagingNetworkExample.enabled }} | ||
name: {{ printf "Hono %s" .component | quote }} | ||
amqpHostname: "hono-internal" | ||
host: {{ printf "%s-dispatch-router" .dot.Release.Name | quote }} | ||
host: {{ printf "%s-dispatch-router" ( include "hono.fullname" . ) | quote }} | ||
port: 5673 | ||
keyPath: {{ .dot.Values.adapters.amqpMessagingNetworkSpec.keyPath | quote }} | ||
certPath: {{ .dot.Values.adapters.amqpMessagingNetworkSpec.certPath | quote }} | ||
|
@@ -263,7 +266,7 @@ The scope passed in is expected to be a dict with keys | |
kafka: | ||
{{- if .dot.Values.kafkaMessagingClusterExample.enabled }} | ||
commonClientConfig: | ||
{{- $bootstrapServers := printf "%[1]s-%[2]s-0.%[1]s-%[2]s-headless:%d" .dot.Release.Name .dot.Values.kafka.nameOverride ( .dot.Values.kafka.service.ports.client | int ) }} | ||
{{- $bootstrapServers := printf "%[1]s-%[2]s-0.%[1]s-%[2]s-headless:%d" ( include "hono.fullname" . ) .dot.Values.kafka.nameOverride ( .dot.Values.kafka.service.ports.client | int ) }} | ||
bootstrap.servers: {{ $bootstrapServers | quote }} | ||
{{- if eq .dot.Values.kafka.auth.clientProtocol "sasl_tls" }} | ||
security.protocol: "SASL_SSL" | ||
|
@@ -321,7 +324,7 @@ The scope passed in is expected to be a dict with keys | |
*/}} | ||
{{- define "hono.deviceRegistryExampleClientConfig" -}} | ||
name: {{ printf "Hono %s" .component | quote }} | ||
host: {{ printf "%s-service-device-registry" .dot.Release.Name | quote }} | ||
host: {{ printf "%s-service-device-registry" ( include "hono.fullname" .dot ) | quote }} | ||
port: 5671 | ||
credentialsPath: "/opt/hono/config/adapter.credentials" | ||
trustStorePath: {{ .dot.Values.deviceRegistryExample.clientTrustStorePath | default "/opt/hono/tls/ca.crt" | quote }} | ||
|
@@ -343,7 +346,7 @@ command: | |
{{- if .dot.Values.amqpMessagingNetworkExample.enabled }} | ||
name: {{ printf "Hono %s" $adapter | quote }} | ||
amqpHostname: "hono-internal" | ||
host: {{ printf "%s-dispatch-router" .dot.Release.Name | quote }} | ||
host: {{ printf "%s-dispatch-router" ( include "hono.fullname" .dot ) | quote }} | ||
port: 5673 | ||
keyPath: {{ .dot.Values.adapters.commandAndControlSpec.keyPath | quote }} | ||
certPath: {{ .dot.Values.adapters.commandAndControlSpec.certPath | quote }} | ||
|
@@ -384,7 +387,7 @@ commandRouter: | |
{{- .dot.Values.adapters.commandRouterSpec | toYaml | nindent 2 }} | ||
{{- else }} | ||
name: {{ printf "Hono %s" $adapter | quote }} | ||
host: {{ printf "%s-service-command-router" .dot.Release.Name | quote }} | ||
host: {{ printf "%s-service-command-router" ( include "hono.fullname" .dot ) | quote }} | ||
port: 5671 | ||
credentialsPath: "/opt/hono/config/adapter.credentials" | ||
trustStorePath: {{ .dot.Values.commandRouterService.clientTrustStorePath | default "/opt/hono/tls/ca.crt" | quote }} | ||
|
@@ -455,7 +458,7 @@ quarkus: | |
exporter: | ||
otlp: | ||
{{- if .dot.Values.jaegerBackendExample.enabled }} | ||
endpoint: {{ printf "http://%s-jaeger-collector:4317" .dot.Release.Name | quote }} | ||
endpoint: {{ printf "http://%s-jaeger-collector:4317" ( include "hono.fullname" .dot ) | quote }} | ||
{{- else }} | ||
endpoint: "http://127.0.0.1:4317" | ||
{{- end }} | ||
|
@@ -526,7 +529,7 @@ The scope passed in is expected to be a dict with keys | |
{{- $component := .componentConfig -}} | ||
{{- $probes := mergeOverwrite ( $global.probes | deepCopy ) ( $component.probes | default dict | deepCopy ) -}} | ||
{{- $deprecatedLivenessProbeInitialDelaySeconds := default .dot.Values.livenessProbeInitialDelaySeconds .componentConfig.livenessProbeInitialDelaySeconds -}} | ||
{{- $deprecatedReadinessProbeInitialDelaySeconds := default .dot.Values.readinessProbeInitialDelaySeconds .componentConfig.readinessProbeInitialDelaySeconds -}} | ||
{{- $deprecatedReadinessProbeInitialDelaySeconds := default .dot.Values.readinessProbeInitialDelaySeconds .componentConfig.readinessProbeInitialDelaySeconds -}} | ||
livenessProbe: | ||
httpGet: | ||
path: {{ $probes.livenessProbe.httpGet.path }} | ||
|
@@ -604,22 +607,22 @@ The scope passed in is expected to be a dict with keys | |
{{- if ( ne $keySecretName "none" ) }} | ||
- name: "tls-keys" | ||
secret: | ||
secretName: {{ ternary ( printf "%s-%s-example-keys" .dot.Release.Name .name ) $keySecretName ( eq $keySecretName "example" ) | quote }} | ||
secretName: {{ ternary ( printf "%s-%s-example-keys" ( include "hono.fullname" . ) .name ) $keySecretName ( eq $keySecretName "example" ) | quote }} | ||
{{- end }} | ||
{{- $trustStoreConfigMapName := ( default "none" .componentConfig.tlsTrustStoreConfigMap | toString ) }} | ||
{{- if ( ne $trustStoreConfigMapName "none" ) }} | ||
- name: "tls-trust-store" | ||
configMap: | ||
name: {{ ternary ( printf "%s-example-trust-store" .dot.Release.Name ) $trustStoreConfigMapName ( eq $trustStoreConfigMapName "example" ) | quote }} | ||
name: {{ ternary ( printf "%s-example-trust-store" ( include "hono.fullname" . )) $trustStoreConfigMapName ( eq $trustStoreConfigMapName "example" ) | quote }} | ||
{{- end }} | ||
- name: "default-logging-config" | ||
configMap: | ||
name: {{ printf "%s-default-logging-config" .dot.Release.Name | quote }} | ||
name: {{ printf "%s-default-logging-config" ( include "hono.fullname" . ) | quote }} | ||
optional: true | ||
{{- $volumeName := printf "%s-conf" .name }} | ||
- name: {{ $volumeName | quote }} | ||
secret: | ||
secretName: {{ printf "%s-%s" .dot.Release.Name $volumeName | quote }} | ||
secretName: {{ printf "%s-%s" ( include "hono.fullname" . ) $volumeName | quote }} | ||
{{- if and .dot.Values.otelCollectorAgentConfigMap ( not .dot.Values.jaegerBackendExample.enabled ) }} | ||
- name: "otel-collector-config" | ||
configMap: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a 2.2.1 version now. Can you rebase? As discussed in an earlier comment, this should better be 2.3.0 here.