From c2607d7699b4aa5f5d54671be40dbe967e586cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 9 Feb 2026 11:35:08 +0100 Subject: [PATCH] fix(helm): improve appVersion usage (#326) --- helm/hindsight/templates/api-deployment.yaml | 2 +- helm/hindsight/templates/controlplane-deployment.yaml | 2 +- helm/hindsight/templates/worker-statefulset.yaml | 2 +- helm/hindsight/values.yaml | 7 ++++--- hindsight-api/hindsight_api/migrations.py | 1 + hindsight-api/hindsight_api/utils.py | 3 ++- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/helm/hindsight/templates/api-deployment.yaml b/helm/hindsight/templates/api-deployment.yaml index ccfb30f7..dc088d6d 100644 --- a/helm/hindsight/templates/api-deployment.yaml +++ b/helm/hindsight/templates/api-deployment.yaml @@ -33,7 +33,7 @@ spec: - name: api securityContext: {{- toYaml .Values.securityContext | nindent 10 }} - image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.version }}" + image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Values.version | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.api.image.pullPolicy }} ports: - name: http diff --git a/helm/hindsight/templates/controlplane-deployment.yaml b/helm/hindsight/templates/controlplane-deployment.yaml index 9ddc4f2b..3f6b958b 100644 --- a/helm/hindsight/templates/controlplane-deployment.yaml +++ b/helm/hindsight/templates/controlplane-deployment.yaml @@ -33,7 +33,7 @@ spec: - name: control-plane securityContext: {{- toYaml .Values.securityContext | nindent 10 }} - image: "{{ .Values.controlPlane.image.repository }}:{{ .Values.controlPlane.image.tag | default .Values.version }}" + image: "{{ .Values.controlPlane.image.repository }}:{{ .Values.controlPlane.image.tag | default .Values.version | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.controlPlane.image.pullPolicy }} ports: - name: http diff --git a/helm/hindsight/templates/worker-statefulset.yaml b/helm/hindsight/templates/worker-statefulset.yaml index 2894e0b4..bf4a175a 100644 --- a/helm/hindsight/templates/worker-statefulset.yaml +++ b/helm/hindsight/templates/worker-statefulset.yaml @@ -32,7 +32,7 @@ spec: - name: worker securityContext: {{- toYaml .Values.securityContext | nindent 10 }} - image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Values.version }}" + image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Values.version | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.worker.image.pullPolicy }} command: ["hindsight-worker"] ports: diff --git a/helm/hindsight/values.yaml b/helm/hindsight/values.yaml index 544f7128..e39e622e 100644 --- a/helm/hindsight/values.yaml +++ b/helm/hindsight/values.yaml @@ -1,7 +1,8 @@ # Default values for hindsight -# Chart version - use this to set a consistent image tag across all components -version: "0.1.1" +# Global version override - use this to set a consistent image tag across all components +# If not set, defaults to Chart.appVersion from Chart.yaml +# version: "" # Use an existing secret instead of creating one from values # When set, all keys from this secret are injected as environment variables via envFrom @@ -75,7 +76,7 @@ worker: image: repository: ghcr.io/vectorize-io/hindsight-api pullPolicy: IfNotPresent - # tag defaults to .Values.version if not specified + # tag: "" # defaults to .Values.version, then Chart.appVersion if not specified service: # Service for metrics scraping (headless for StatefulSet) diff --git a/hindsight-api/hindsight_api/migrations.py b/hindsight-api/hindsight_api/migrations.py index 39dcde8e..3431830f 100644 --- a/hindsight-api/hindsight_api/migrations.py +++ b/hindsight-api/hindsight_api/migrations.py @@ -24,6 +24,7 @@ from alembic import command from alembic.config import Config from alembic.script.revision import ResolutionError from sqlalchemy import create_engine, text + from .utils import mask_network_location logger = logging.getLogger(__name__) diff --git a/hindsight-api/hindsight_api/utils.py b/hindsight-api/hindsight_api/utils.py index 1d92ce24..62cb94cd 100644 --- a/hindsight-api/hindsight_api/utils.py +++ b/hindsight-api/hindsight_api/utils.py @@ -1,5 +1,6 @@ from urllib.parse import urlparse, urlunparse + def mask_network_location(url): if not url: return url @@ -9,4 +10,4 @@ def mask_network_location(url): masked_network_location += f":{parsed_url.port}" if parsed_url.username or parsed_url.password: masked_network_location = f"***:***@{masked_network_location}" - return urlunparse(parsed_url._replace(netloc=masked_network_location)) \ No newline at end of file + return urlunparse(parsed_url._replace(netloc=masked_network_location))