Skip to content

Commit

Permalink
Add support for application credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
baurmatt committed Mar 21, 2024
1 parent 62041e9 commit 7ebd177
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charts/syseleven-exporter-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 20 additions & 3 deletions charts/syseleven-exporter-chart/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
{{- 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 }}
3 changes: 3 additions & 0 deletions charts/syseleven-exporter-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ openstack:
projectId: ""
username: ""
password: ""
# or
application_credential_id: ""
application_credential_secret: ""

0 comments on commit 7ebd177

Please sign in to comment.