Allow setting extra env vars from chart (#4448)

Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
This commit is contained in:
Sergio Castaño Arteaga 2025-07-08 11:08:26 +02:00 committed by GitHub
parent 10997a42b0
commit e7d3d58337
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 46 additions and 4 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: artifact-hub name: artifact-hub
description: Artifact Hub is a web-based application that enables finding, installing, and publishing Cloud Native packages. description: Artifact Hub is a web-based application that enables finding, installing, and publishing Cloud Native packages.
type: application type: application
version: 1.21.1-0 version: 1.21.1-1
appVersion: 1.21.0 appVersion: 1.21.0
kubeVersion: ">= 1.19.0-0" kubeVersion: ">= 1.19.0-0"
home: https://artifacthub.io home: https://artifacthub.io

View File

@ -70,10 +70,15 @@ spec:
securityContext: securityContext:
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
{{- if .Values.hub.server.cacheDir }} {{- if or .Values.hub.server.cacheDir .Values.hub.deploy.extraEnvVars }}
env: env:
{{- if .Values.hub.server.cacheDir }}
- name: XDG_CACHE_HOME - name: XDG_CACHE_HOME
value: {{ .Values.hub.server.cacheDir | quote }} value: {{ .Values.hub.server.cacheDir | quote }}
{{- end }}
{{- if .Values.hub.deploy.extraEnvVars }}
{{- include "chart.tplvalues.render" (dict "value" .Values.hub.deploy.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
- name: hub-config - name: hub-config

View File

@ -55,10 +55,15 @@ spec:
resources: resources:
{{- toYaml . | nindent 16 }} {{- toYaml . | nindent 16 }}
{{- end }} {{- end }}
{{- if .Values.scanner.cacheDir }} {{- if or .Values.scanner.cacheDir .Values.scanner.cronjob.extraEnvVars }}
env: env:
{{- if .Values.scanner.cacheDir }}
- name: TRIVY_CACHE_DIR - name: TRIVY_CACHE_DIR
value: {{ .Values.scanner.cacheDir | quote }} value: {{ .Values.scanner.cacheDir | quote }}
{{- end }}
{{- if .Values.scanner.cronjob.extraEnvVars }}
{{- include "chart.tplvalues.render" (dict "value" .Values.scanner.cronjob.extraEnvVars "context" $) | nindent 16 }}
{{- end }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
- name: scanner-config - name: scanner-config

View File

@ -54,10 +54,15 @@ spec:
resources: resources:
{{- toYaml . | nindent 16 }} {{- toYaml . | nindent 16 }}
{{- end }} {{- end }}
{{- if .Values.tracker.cacheDir }} {{- if or .Values.tracker.cacheDir .Values.tracker.cronjob.extraEnvVars }}
env: env:
{{- if .Values.tracker.cacheDir }}
- name: XDG_CACHE_HOME - name: XDG_CACHE_HOME
value: {{ .Values.tracker.cacheDir | quote }} value: {{ .Values.tracker.cacheDir | quote }}
{{- end }}
{{- if .Values.tracker.cronjob.extraEnvVars }}
{{- include "chart.tplvalues.render" (dict "value" .Values.tracker.cronjob.extraEnvVars "context" $) | nindent 16 }}
{{- end }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
- name: tracker-config - name: tracker-config

View File

@ -41,6 +41,9 @@ hub:
requests: requests:
cpu: 1 cpu: 1
memory: 1000Mi memory: 1000Mi
extraEnvVars:
- name: KEY1
value: VALUE1
server: server:
bannersURL: https://cncf.github.io/banners/banners.yml bannersURL: https://cncf.github.io/banners/banners.yml
baseURL: https://staging.artifacthub.io baseURL: https://staging.artifacthub.io

View File

@ -305,6 +305,12 @@
"type": "array", "type": "array",
"default": "[]" "default": "[]"
}, },
"extraEnvVars": {
"title": "Extra environment variables",
"description": "Optionally specify extra list of additional environment variables for the hub container",
"type": "array",
"default": "[]"
},
"image": { "image": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -1047,6 +1053,12 @@
"type": "array", "type": "array",
"default": "[]" "default": "[]"
}, },
"extraEnvVars": {
"title": "Extra environment variables",
"description": "Optionally specify extra list of additional environment variables for the scanner container",
"type": "array",
"default": "[]"
},
"image": { "image": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -1171,6 +1183,12 @@
"type": "array", "type": "array",
"default": "[]" "default": "[]"
}, },
"extraEnvVars": {
"title": "Extra environment variables",
"description": "Optionally specify extra list of additional environment variables for the tracker container",
"type": "array",
"default": "[]"
},
"image": { "image": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -192,6 +192,8 @@ hub:
nodeSelector: {} nodeSelector: {}
# Optionally specify extra list of additional containers for the hub deployment # Optionally specify extra list of additional containers for the hub deployment
extraContainers: [] extraContainers: []
# Optionally specify extra list of additional environment variables for the hub container
extraEnvVars: []
server: server:
# Allow adding private repositories to the Hub # Allow adding private repositories to the Hub
allowPrivateRepositories: false allowPrivateRepositories: false
@ -338,6 +340,8 @@ scanner:
extraVolumes: [] extraVolumes: []
# Optionally specify extra list of additional volume mounts for the scanner cronjob # Optionally specify extra list of additional volume mounts for the scanner cronjob
extraVolumeMounts: [] extraVolumeMounts: []
# Optionally specify extra list of additional environment variables for the scanner container
extraEnvVars: []
# Optionally specify a node selector for the scanner cronjob # Optionally specify a node selector for the scanner cronjob
nodeSelector: {} nodeSelector: {}
# Number of snapshots to process concurrently # Number of snapshots to process concurrently
@ -376,6 +380,8 @@ tracker:
extraVolumes: [] extraVolumes: []
# Optionally specify extra list of additional volume mounts for the tracker cronjob # Optionally specify extra list of additional volume mounts for the tracker cronjob
extraVolumeMounts: [] extraVolumeMounts: []
# Optionally specify extra list of additional environment variables for the tracker container
extraEnvVars: []
# Optionally specify a node selector for the tracker cronjob # Optionally specify a node selector for the tracker cronjob
nodeSelector: {} nodeSelector: {}
# Cache directory path. If set, the cache directory for the Helm client will be explicitly set (otherwise defaults # Cache directory path. If set, the cache directory for the Helm client will be explicitly set (otherwise defaults