Skip to content
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

feat: include image digest to prevent supply chain issues #215

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/opencost/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- finops
- monitoring
- opencost
version: 1.40.0
version: 1.41.0
maintainers:
- name: mattray
url: https://mattray.dev
Expand Down
24 changes: 24 additions & 0 deletions charts/opencost/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,27 @@ apiVersion: networking.k8s.io/v1
apiVersion: networking.k8s.io/v1beta1
{{- end }}
{{- end -}}

{{- define "opencost.imageTag" -}}
{{ .Values.opencost.exporter.image.tag | default (printf "%s" .Chart.AppVersion) }}
{{- end -}}

{{- define "opencost.fullImageName" -}}
{{- if .Values.opencost.exporter.image.fullImageName }}
{{- .Values.opencost.exporter.image.fullImageName -}}
{{- else}}
{{- .Values.opencost.exporter.image.registry -}}/{{- .Values.opencost.exporter.image.repository -}}:{{- include "opencost.imageTag" . -}}
{{- end -}}
{{- end -}}

{{- define "opencostUi.imageTag" -}}
{{- .Values.opencost.ui.image.tag | default (printf "%s" .Chart.AppVersion) -}}
{{- end -}}

{{- define "opencostUi.fullImageName" -}}
{{- if .Values.opencost.ui.image.fullImageName }}
{{- .Values.opencost.ui.image.fullImageName -}}
{{- else}}
{{- .Values.opencost.ui.image.registry -}}/{{- .Values.opencost.ui.image.repository -}}:{{- include "opencostUi.imageTag" . -}}
{{- end -}}
{{- end -}}
12 changes: 2 additions & 10 deletions charts/opencost/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ spec:
{{- end }}
containers:
- name: {{ include "opencost.fullname" . }}
{{- if .Values.opencost.exporter.image.fullImageName }}
image: {{ .Values.opencost.exporter.image.fullImageName }}
{{- else }}
image: "{{ .Values.opencost.exporter.image.registry }}/{{ .Values.opencost.exporter.image.repository }}:{{ .Values.opencost.exporter.image.tag | default (printf "%s" .Chart.AppVersion) }}"
{{- end}}
image: {{ include "opencost.fullImageName" . }}
imagePullPolicy: {{ .Values.opencost.exporter.image.pullPolicy }}
args:
{{- range .Values.opencost.exporter.extraArgs }}
Expand Down Expand Up @@ -268,11 +264,7 @@ spec:
{{- end }}
{{- if .Values.opencost.ui.enabled }}
- name: opencost-ui
{{- if .Values.opencost.ui.image.fullImageName }}
image: {{ .Values.opencost.ui.image.fullImageName }}
{{- else}}
image: "{{ .Values.opencost.ui.image.registry }}/{{ .Values.opencost.ui.image.repository }}:{{ .Values.opencost.ui.image.tag | default (printf "%s" .Chart.AppVersion) }}"
{{- end }}
image: {{ include "opencostUi.fullImageName" .}}
imagePullPolicy: {{ .Values.opencost.ui.image.pullPolicy }}
ports:
- containerPort: {{ .Values.opencost.ui.uiPort }}
Expand Down
5 changes: 2 additions & 3 deletions charts/opencost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ opencost:
# -- Exporter container image name
repository: opencost/opencost
# -- Exporter container image tag
# @default -- `""` (use appVersion in Chart.yaml)
tag: ""
tag: "1.111.0@sha256:6aa68e52a24b14ba41f23db08d1b9db1429a1c0300f4c0381ecc2c61fc311a97"
# -- Exporter container image pull policy
pullPolicy: IfNotPresent
# -- Override the full image name for development purposes
Expand Down Expand Up @@ -374,7 +373,7 @@ opencost:
repository: opencost/opencost-ui
# -- UI container image tag
# @default -- `""` (use appVersion in Chart.yaml)
tag: ""
tag: "1.111.0@sha256:f7221e7a708d71663f5eca6c238268757eb4352f3e9f46b1029d33ab4e53fd8a"
# -- UI container image pull policy
pullPolicy: IfNotPresent
# -- Override the full image name for development purposes
Expand Down
Loading