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
description: Artifact Hub is a web-based application that enables finding, installing, and publishing Cloud Native packages.
type: application
version: 1.21.1-0
version: 1.21.1-1
appVersion: 1.21.0
kubeVersion: ">= 1.19.0-0"
home: https://artifacthub.io

View File

@ -70,10 +70,15 @@ spec:
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.hub.server.cacheDir }}
{{- if or .Values.hub.server.cacheDir .Values.hub.deploy.extraEnvVars }}
env:
{{- if .Values.hub.server.cacheDir }}
- name: XDG_CACHE_HOME
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 }}
volumeMounts:
- name: hub-config

View File

@ -55,10 +55,15 @@ spec:
resources:
{{- toYaml . | nindent 16 }}
{{- end }}
{{- if .Values.scanner.cacheDir }}
{{- if or .Values.scanner.cacheDir .Values.scanner.cronjob.extraEnvVars }}
env:
{{- if .Values.scanner.cacheDir }}
- name: TRIVY_CACHE_DIR
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 }}
volumeMounts:
- name: scanner-config

View File

@ -54,10 +54,15 @@ spec:
resources:
{{- toYaml . | nindent 16 }}
{{- end }}
{{- if .Values.tracker.cacheDir }}
{{- if or .Values.tracker.cacheDir .Values.tracker.cronjob.extraEnvVars }}
env:
{{- if .Values.tracker.cacheDir }}
- name: XDG_CACHE_HOME
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 }}
volumeMounts:
- name: tracker-config

View File

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

View File

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

View File

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