Skip to content

Conversation

@Gaspi
Copy link
Contributor

@Gaspi Gaspi commented Jul 11, 2025

No description provided.

@Gaspi Gaspi requested a review from ddecrulle July 11, 2025 12:58
@Gaspi Gaspi self-assigned this Jul 11, 2025
@sonarqubecloud
Copy link

@ihiverlet
Copy link
Contributor

@olevitt we are two in favor of checksum annotations now 😄

Copy link
Contributor

@ddecrulle ddecrulle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Gaspi,

I agree that using a checksum is very convenient. However, the current PR introduces an implicit dependency on the file system.

I suggest defining the ConfigMap as a named template and including it both for rendering and for computing the checksum.
This makes the logic more robust and avoids relying on file path resolution.

{{- define "onyxia.XXXXX.configmap" }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "onyxia.XXXXX.name" . }}
  labels:
    app: {{ template "onyxia.XXXXX.name" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  # ...
{{- end }}

# Include once to render the resource
{{- include "onyxia.XXXXX.configmap" . }}

Then in the Deployment:

annotations:
  checksum/config: {{ include "onyxia.XXXXX.configmap" . | sha256sum }}

Let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants