From 84b7c693a93aa2d1082a931d719f0165ccbc53f1 Mon Sep 17 00:00:00 2001 From: komodor-bot Date: Sun, 1 Dec 2024 21:44:46 +0000 Subject: [PATCH] feat(OSS helm-dashboard): fix context decoding issue in Installed component (#563) remove redundant code correct encode decode Co-authored-by: Aleksandr Cupacenko --- charts/helm-dashboard/Chart.yaml | 4 ++-- charts/helm-dashboard/templates/_helpers.tpl | 22 ++++---------------- charts/helm-dashboard/values.yaml | 2 ++ 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/charts/helm-dashboard/Chart.yaml b/charts/helm-dashboard/Chart.yaml index 83d79b76..b2b4e257 100644 --- a/charts/helm-dashboard/Chart.yaml +++ b/charts/helm-dashboard/Chart.yaml @@ -5,5 +5,5 @@ name: helm-dashboard description: A GUI Dashboard for Helm by Komodor icon: "https://raw.githubusercontent.com/komodorio/helm-dashboard/refs/heads/main/images/logo.svg" -version: 2.0.2 -appVersion: "2.0.2" +version: 2.0.3 +appVersion: "2.0.3" diff --git a/charts/helm-dashboard/templates/_helpers.tpl b/charts/helm-dashboard/templates/_helpers.tpl index 2d479978..5e2ced80 100644 --- a/charts/helm-dashboard/templates/_helpers.tpl +++ b/charts/helm-dashboard/templates/_helpers.tpl @@ -11,16 +11,9 @@ 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 "helm-dashboard.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 }} +{{- $fullname := default (ternary .Release.Name (printf "%s-%s" .Release.Name $name) (contains $name .Release.Name)) .Values.fullnameOverride }} +{{- $fullname | trunc 63 | trimSuffix "-" }} {{- end }} {{/* @@ -54,11 +47,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} Create the name of the service account to use */}} {{- define "helm-dashboard.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "helm-dashboard.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} +{{- default (.Values.serviceAccount.create | ternary (include "helm-dashboard.fullname" .) "default") .Values.serviceAccount.name }} {{- end }} {{/* @@ -74,10 +63,7 @@ Return the proper image name */}} {{- define "helm-dashboard.image" -}} {{- $image := .Values.image -}} -{{- $tag := .Chart.AppVersion -}} -{{- if $image.tag -}} -{{- $tag = $image.tag -}} -{{- end -}} +{{- $tag := default .Chart.AppVersion $image.tag -}} {{- $_ := set $image "tag" $tag -}} {{ include "common.images.image" (dict "imageRoot" $_ "global" .Values.global) }} {{- end -}} diff --git a/charts/helm-dashboard/values.yaml b/charts/helm-dashboard/values.yaml index 5a94ffd7..516b80bc 100644 --- a/charts/helm-dashboard/values.yaml +++ b/charts/helm-dashboard/values.yaml @@ -17,6 +17,8 @@ image: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" + # Specifies the exact image digest to pull. + digest: "" imagePullSecrets: [] nameOverride: ""