Skip to content

Commit

Permalink
Merge pull request #118 from dasmeta/DMVP-5837
Browse files Browse the repository at this point in the history
fix(DMVP-5837): Fix secret management
  • Loading branch information
aghamyan44 authored Oct 25, 2024
2 parents b9ba6a1 + 7dd3168 commit b8748f1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/base-cronjob/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ 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.1.17
version: 0.1.18

# 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.
# It is recommended to use it with quotes.

appVersion: "0.1.17"
appVersion: "0.1.18"
8 changes: 8 additions & 0 deletions charts/base-cronjob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,12 @@ storage:
requestedSize: 10Gi
className: standard
enableDataSource: true
```

Use secrets:
```
secrets:
- APP_NAME:
from: secret-name
key: APP_NAME
```
11 changes: 11 additions & 0 deletions charts/base-cronjob/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ spec:
- name: {{ $env.name | quote }}
value: {{ $env.value | quote }}
{{- end }}
{{- range $secret := $job.secrets }}
{{- if ne (kindOf $secret) "string" }}
{{- range $map_key,$map_value := $secret }}
- name: {{ $map_key }}
valueFrom:
secretKeyRef:
key: {{ $map_value.key }}
name: {{ $map_value.from }}
{{- end }}
{{- end }}
{{- end }}
envFrom:
{{- $config := (default dict $job.config) }}
{{- if and (kindIs "map" $config) (hasKey $config "enabled") (eq $config.enabled true) }}
Expand Down

0 comments on commit b8748f1

Please sign in to comment.