Skip to content

Commit

Permalink
Merge pull request #158 from Kulagin-G/master
Browse files Browse the repository at this point in the history
fix(moon2): add a check whether k8s licenseSecretName secret exists
  • Loading branch information
aandryashin authored Jun 22, 2022
2 parents 45d96d1 + db18dca commit eb0e6b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions moon2/templates/license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ metadata:
spec:
namespace: {{ .Release.Namespace }}
data: {{ if .Values.licenseSecretName -}}
{{- index (lookup "v1" "Secret" .Release.Namespace .Values.licenseSecretName).data "license.key" | b64dec | quote -}}
{{- if $licenseSecretName := (lookup "v1" "Secret" .Release.Namespace .Values.licenseSecretName).data }}
{{- index $licenseSecretName "license.key" | b64dec | quote }}
{{- else }}
{{- default "MG1RSVdpc2Z6YjdQQVZjd2lpei9KMkd1T3dzMTFuL1dlRjVSc3NOMUcxZk9QaUxWa3Q5SnBIakIxa09wWm0vVFJqQ0tsa21xVG1OODVRZnlQbjBjVmRHVWFLampTOFF1a3VLRXRPcEUwbnEySG16QWFQWHRDYTVjMm9jZzZFaUJqeFd5ODE4UFBHZzNCNWpCYXlha3oweFBscFl1RnB0V0U1Q3FwOGl5VDdKTk9abG5aSmlPdnRmZDFvSG1nNnVwVXBLV2E4RmYwWHcreERIR29ZTE1XTldPb1hvT2ZCUnZpcDhPWW05a1FqN0hBWWVOYUtLT1lPWlVJa1dsb1gxdjNOT1htTFpZalhsQ3h1Q3V6NWhiQjIwSjVIY0JTYnZybm9zYm14RXFkSFpQWVBKWUlKTzZvVlBnODhQeFErZ1EyTk5sWG82TC9XeXU3aisrNU0rSEdPcXlOSEdlNGx4Zm1nNVhjMWlnNkN1OCtNSVVYRzNqUllqOUY4ZHdReWpSbFNMNmFpL2dRQnc3TzY0U0lwdVF2d29jYi9kVzFSYWFRVkd3ZXYrOVdING8zRWRrYkVONUhRTmQ2MUxsUnFNdmtKeWVHV21tVlVUZ2dsMDRsTFFLTmZN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