Skip to content

Commit

Permalink
Let user specify secret used for key. (#7)
Browse files Browse the repository at this point in the history
add support for value license.keyRef for having the key defined in
secret manually.
Closes #6
  • Loading branch information
aviramha authored Nov 7, 2023
1 parent 243f045 commit 66e4b63
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mirrord-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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.4
version: 0.2.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
Expand Down
2 changes: 1 addition & 1 deletion mirrord-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mirrord Operator Helm Crate

To setup the mirrord Operator on your cluster you can use this Helm chart.
* You must add `license.key` or license file to `values.yaml`
* You must add `license.key` or license file to `values.yaml` or create a secret with key `OPERATOR_LICENSE_KEY` with the key as value and set `keyRef`.
* If `certManager.enabled` is set to `false`, you must set `tls.data['tls.key']` and `tls.data['tls.crt']`
8 changes: 7 additions & 1 deletion mirrord-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ spec:
{{- if .Values.license.file.data }}
- name: OPERATOR_LICENSE_PATH
value: /license/license.pem
{{- else }}
{{- else if .Values.license.key }}
envFrom:
- secretRef:
name: {{ .Values.license.file.secret }}
{{ else if .Values.license.keyRef }}
envFrom:
- secretRef:
name: {{ .Values.license.keyRef }}
{{ else }}
{{ required "Either keyRef, file or key value is required for license!" }}
{{- end }}
image: {{ .Values.operator.image }}:{{ .Chart.AppVersion }}
imagePullPolicy: IfNotPresent
Expand Down
3 changes: 2 additions & 1 deletion mirrord-operator/templates/license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
namespace: {{ .Values.namespace }}
stringData:
{{- toYaml .Values.license.file.data | nindent 2 }}
{{- else }}
{{- else if .Values.license.key }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -15,3 +15,4 @@ metadata:
stringData:
OPERATOR_LICENSE_KEY: {{ .Values.license.key }}
{{- end }}
// don't create secret if using keyRef
1 change: 1 addition & 0 deletions mirrord-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ license:
secret: mirrord-operator-license
# data:
# license.pem:
keyRef: ""

service:
name: mirrord-operator
Expand Down

0 comments on commit 66e4b63

Please sign in to comment.