diff --git a/charts/backstage/Chart.yaml b/charts/backstage/Chart.yaml index a8d4b78..bfc5e0d 100644 --- a/charts/backstage/Chart.yaml +++ b/charts/backstage/Chart.yaml @@ -38,4 +38,4 @@ sources: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.6.1 +version: 2.7.0 diff --git a/charts/backstage/README.md b/charts/backstage/README.md index ed80a5d..aab11a5 100644 --- a/charts/backstage/README.md +++ b/charts/backstage/README.md @@ -2,7 +2,7 @@ # Backstage Helm Chart [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/backstage)](https://artifacthub.io/packages/search?repo=backstage) -![Version: 2.6.1](https://img.shields.io/badge/Version-2.6.1-informational?style=flat-square) +![Version: 2.7.0](https://img.shields.io/badge/Version-2.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for deploying a Backstage application diff --git a/charts/backstage/templates/backstage-deployment.yaml b/charts/backstage/templates/backstage-deployment.yaml index bcdcd73..e8f759a 100644 --- a/charts/backstage/templates/backstage-deployment.yaml +++ b/charts/backstage/templates/backstage-deployment.yaml @@ -158,8 +158,16 @@ spec: key: {{ include "backstage.postgresql.databaseSecretKey" . }} {{- end }} {{- if .Values.backstage.extraEnvVars }} + {{- if (kindIs "map" .Values.backstage.extraEnvVars) }} + {{- /* If extraEnvVars is a dict, Helm will merge it automatically by key */ -}} + {{- range $_, $value := .Values.backstage.extraEnvVars }} + - {{- include "common.tplvalues.render" ( dict "value" $value "context" $) | nindent 14 }} + {{- end }} + {{- else if (kindIs "slice" .Values.backstage.extraEnvVars) }} + {{- /* If extraEnvVars is a list, keep current behavior (no merging) */ -}} {{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraEnvVars "context" $) | nindent 12 }} {{- end }} + {{- end }} ports: - name: backend containerPort: {{ .Values.backstage.containerPorts.backend }} diff --git a/charts/backstage/values.schema.json b/charts/backstage/values.schema.json index 591f87b..79f44f9 100644 --- a/charts/backstage/values.schema.json +++ b/charts/backstage/values.schema.json @@ -2272,130 +2272,258 @@ "type": "array" }, "extraEnvVars": { - "default": [], - "examples": [ - [ - { - "name": "APP_CONFIG_backend_cache_store", - "value": "memory" - } - ] - ], - "items": { - "description": "EnvVar represents an environment variable present in a Container.", - "properties": { - "name": { - "description": "Name of the environment variable. Must be a C_IDENTIFIER.", - "type": "string" - }, - "value": { - "description": "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", - "type": "string" - }, - "valueFrom": { - "description": "EnvVarSource represents a source for the value of an EnvVar.", + "oneOf": [ + { + "default": [], + "examples": [ + [ + { + "name": "APP_CONFIG_backend_cache_store", + "value": "memory" + } + ] + ], + "items": { + "description": "EnvVar represents an environment variable present in a Container.", "properties": { - "configMapKeyRef": { - "description": "Selects a key from a ConfigMap.", - "properties": { - "key": { - "description": "The key to select.", - "type": "string" - }, - "name": { - "description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the ConfigMap or its key must be defined", - "type": "boolean" - } - }, - "required": [ - "key" - ], - "type": "object", - "x-kubernetes-map-type": "atomic" + "name": { + "description": "Name of the environment variable. Must be a C_IDENTIFIER.", + "type": "string" }, - "fieldRef": { - "description": "ObjectFieldSelector selects an APIVersioned field of an object.", - "properties": { - "apiVersion": { - "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", - "type": "string" - }, - "fieldPath": { - "description": "Path of the field to select in the specified API version.", - "type": "string" - } - }, - "required": [ - "fieldPath" - ], - "type": "object", - "x-kubernetes-map-type": "atomic" + "value": { + "description": "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", + "type": "string" }, - "resourceFieldRef": { - "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", + "valueFrom": { + "description": "EnvVarSource represents a source for the value of an EnvVar.", "properties": { - "containerName": { - "description": "Container name: required for volumes, optional for env vars", - "type": "string" + "configMapKeyRef": { + "description": "Selects a key from a ConfigMap.", + "properties": { + "key": { + "description": "The key to select.", + "type": "string" + }, + "name": { + "description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + "type": "string" + }, + "optional": { + "description": "Specify whether the ConfigMap or its key must be defined", + "type": "boolean" + } + }, + "required": [ + "key" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" }, - "divisor": { - "oneOf": [ - { + "fieldRef": { + "description": "ObjectFieldSelector selects an APIVersioned field of an object.", + "properties": { + "apiVersion": { + "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", "type": "string" }, - { - "type": "number" + "fieldPath": { + "description": "Path of the field to select in the specified API version.", + "type": "string" } - ] + }, + "required": [ + "fieldPath" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" }, - "resource": { - "description": "Required: resource to select", - "type": "string" + "resourceFieldRef": { + "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", + "properties": { + "containerName": { + "description": "Container name: required for volumes, optional for env vars", + "type": "string" + }, + "divisor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "resource": { + "description": "Required: resource to select", + "type": "string" + } + }, + "required": [ + "resource" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" + }, + "secretKeyRef": { + "description": "SecretKeySelector selects a key of a Secret.", + "properties": { + "key": { + "description": "The key of the secret to select from. Must be a valid secret key.", + "type": "string" + }, + "name": { + "description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + "type": "string" + }, + "optional": { + "description": "Specify whether the Secret or its key must be defined", + "type": "boolean" + } + }, + "required": [ + "key" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" } }, - "required": [ - "resource" - ], - "type": "object", - "x-kubernetes-map-type": "atomic" + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + { + "additionalProperties": { + "description": "EnvVar represents an environment variable present in a Container.", + "properties": { + "name": { + "description": "Name of the environment variable. Must be a C_IDENTIFIER.", + "type": "string" + }, + "value": { + "description": "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", + "type": "string" }, - "secretKeyRef": { - "description": "SecretKeySelector selects a key of a Secret.", + "valueFrom": { + "description": "EnvVarSource represents a source for the value of an EnvVar.", "properties": { - "key": { - "description": "The key of the secret to select from. Must be a valid secret key.", - "type": "string" + "configMapKeyRef": { + "description": "Selects a key from a ConfigMap.", + "properties": { + "key": { + "description": "The key to select.", + "type": "string" + }, + "name": { + "description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + "type": "string" + }, + "optional": { + "description": "Specify whether the ConfigMap or its key must be defined", + "type": "boolean" + } + }, + "required": [ + "key" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" }, - "name": { - "description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" + "fieldRef": { + "description": "ObjectFieldSelector selects an APIVersioned field of an object.", + "properties": { + "apiVersion": { + "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", + "type": "string" + }, + "fieldPath": { + "description": "Path of the field to select in the specified API version.", + "type": "string" + } + }, + "required": [ + "fieldPath" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" }, - "optional": { - "description": "Specify whether the Secret or its key must be defined", - "type": "boolean" + "resourceFieldRef": { + "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", + "properties": { + "containerName": { + "description": "Container name: required for volumes, optional for env vars", + "type": "string" + }, + "divisor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "resource": { + "description": "Required: resource to select", + "type": "string" + } + }, + "required": [ + "resource" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" + }, + "secretKeyRef": { + "description": "SecretKeySelector selects a key of a Secret.", + "properties": { + "key": { + "description": "The key of the secret to select from. Must be a valid secret key.", + "type": "string" + }, + "name": { + "description": "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + "type": "string" + }, + "optional": { + "description": "Specify whether the Secret or its key must be defined", + "type": "boolean" + } + }, + "required": [ + "key" + ], + "type": "object", + "x-kubernetes-map-type": "atomic" } }, - "required": [ - "key" - ], - "type": "object", - "x-kubernetes-map-type": "atomic" + "type": "object" } }, + "required": [ + "name" + ], "type": "object" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "title": "Backstage container environment variables", - "type": "array" + }, + "examples": [ + { + "APP_CONFIG_backend_cache_store": { + "name": "APP_CONFIG_backend_cache_store", + "value": "memory" + } + } + ], + "type": "object" + } + ], + "title": "Backstage container environment variables" }, "extraEnvVarsCM": { "default": [], diff --git a/charts/backstage/values.schema.tmpl.json b/charts/backstage/values.schema.tmpl.json index 0b3e9b0..e1dcf00 100644 --- a/charts/backstage/values.schema.tmpl.json +++ b/charts/backstage/values.schema.tmpl.json @@ -423,18 +423,37 @@ }, "extraEnvVars": { "title": "Backstage container environment variables", - "type": "array", - "items": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.4/_definitions.json#/definitions/io.k8s.api.core.v1.EnvVar" - }, - "default": [], - "examples": [ - [ - { - "name": "APP_CONFIG_backend_cache_store", - "value": "memory" - } - ] + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.4/_definitions.json#/definitions/io.k8s.api.core.v1.EnvVar" + }, + "default": [], + "examples": [ + [ + { + "name": "APP_CONFIG_backend_cache_store", + "value": "memory" + } + ] + ] + }, + { + "type": "object", + "additionalProperties": { + "type": "object", + "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.4/_definitions.json#/definitions/io.k8s.api.core.v1.EnvVar" + }, + "examples": [ + { + "APP_CONFIG_backend_cache_store": { + "name": "APP_CONFIG_backend_cache_store", + "value": "memory" + } + } + ] + } ] }, "extraEnvVarsCM": {