Skip to content

Commit

Permalink
[prometheus-node-exporter] Use digest instead of sha (prometheus-comm…
Browse files Browse the repository at this point in the history
…unity#3130)

* [prometheus-node-exporter]  Use digest instead of sha

sha is for digest without digest type.

digest is more commonly used, and prepare for possible future
digest types

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>

* Update Chart.yaml

Signed-off-by: MH <zanhsieh@gmail.com>

---------

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
Signed-off-by: MH <zanhsieh@gmail.com>
Co-authored-by: MH <zanhsieh@gmail.com>
  • Loading branch information
2 people authored and Matiasmct committed May 16, 2023
1 parent 6632b72 commit 61e752d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-node-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- prometheus
- exporter
type: application
version: 4.15.0
version: 4.15.1
appVersion: 1.5.0
home: https://github.com/prometheus/node_exporter/
sources:
Expand Down
6 changes: 4 additions & 2 deletions charts/prometheus-node-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ The image to use
*/}}
{{- define "prometheus-node-exporter.image" -}}
{{- if .Values.image.sha }}
{{- fail "image.sha forbidden. Use image.digest instead" }}
{{- else if .Values.image.digest }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s@%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.sha }}
{{- printf "%s/%s:%s@%s" .Values.global.imageRegistry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.digest }}
{{- else }}
{{- printf "%s/%s:%s@%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.sha }}
{{- printf "%s/%s:%s@%s" .Values.image.registry .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.digest }}
{{- end }}
{{- else }}
{{- if .Values.global.imageRegistry }}
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-node-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ image:
# Overrides the image tag whose default is {{ printf "v%s" .Chart.AppVersion }}
tag: ""
pullPolicy: IfNotPresent
sha: ""
digest: ""

imagePullSecrets: []
# - name: "image-pull-secret"
Expand Down

0 comments on commit 61e752d

Please sign in to comment.