diff --git a/charts/syseleven-exporter-chart/Chart.yaml b/charts/syseleven-exporter-chart/Chart.yaml index 602541b..54dd253 100644 --- a/charts/syseleven-exporter-chart/Chart.yaml +++ b/charts/syseleven-exporter-chart/Chart.yaml @@ -15,10 +15,10 @@ type: application # 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: 0.4.0 +version: 0.5.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 1.1.1 +appVersion: 1.2.0 diff --git a/charts/syseleven-exporter-chart/templates/secret.yaml b/charts/syseleven-exporter-chart/templates/secret.yaml index 96df47a..767f54c 100644 --- a/charts/syseleven-exporter-chart/templates/secret.yaml +++ b/charts/syseleven-exporter-chart/templates/secret.yaml @@ -1,12 +1,29 @@ - +{{- if and (or .Values.openstack.username .Values.openstack.password) (or .Values.openstack.application_credential_id .Values.openstack.application_credential_secret) }} +{{- fail "openstack.username/password and openstack.application_credential_id/application_credential_secret are mutually exclusive." }} +{{- end }} +{{- if not (or (and .Values.openstack.username .Values.openstack.password) (and .Values.openstack.application_credential_id .Values.openstack.application_credential_secret)) }} +{{- fail "One of openstack.username/password or openstack.application_credential_id/application_credential_secret is required." }} +{{- end }} apiVersion: v1 kind: Secret metadata: name: {{ template "syseleven-exporter.secret" . }} labels: - {{- include "syseleven-exporter.labels" . | nindent 4 }} + {{- include "syseleven-exporter.labels" . | nindent 4 }} type: Opaque stringData: +{{- if .Values.openstack.username }} OS_USERNAME: {{ .Values.openstack.username }} +{{- end }} +{{- if .Values.openstack.password }} OS_PASSWORD: {{ .Values.openstack.password }} - OS_PROJECT_ID: {{ .Values.openstack.projectId }} \ No newline at end of file +{{- end }} +{{- if .Values.openstack.projectId }} + OS_PROJECT_ID: {{ .Values.openstack.projectId }} +{{- end }} +{{- if .Values.openstack.application_credential_id }} + OS_APPLICATION_CREDENTIAL_ID: {{ .Values.openstack.application_credential_id }} +{{- end }} +{{- if .Values.openstack.application_credential_secret }} + OS_APPLICATION_CREDENTIAL_SECRET: {{ .Values.openstack.application_credential_secret }} +{{- end }} diff --git a/charts/syseleven-exporter-chart/values.yaml b/charts/syseleven-exporter-chart/values.yaml index b76d6ae..9555612 100644 --- a/charts/syseleven-exporter-chart/values.yaml +++ b/charts/syseleven-exporter-chart/values.yaml @@ -74,3 +74,6 @@ openstack: projectId: "" username: "" password: "" + # or + application_credential_id: "" + application_credential_secret: ""