Skip to content

Commit 26a68e3

Browse files
committed
product key as a show_if
1 parent 9fe79f2 commit 26a68e3

4 files changed

Lines changed: 32 additions & 17 deletions

File tree

linux/sample-helm-chart-statefulset-deployment/questions.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,32 @@ questions:
33
label: ACCEPT_EULA
44
description: Accepts the SQL Server EULA (any value confirms acceptance)
55
default: "Yes"
6+
required: true
67
group: SQL Server options
78

8-
- variable: SQL Server Edition aka. MSSQL_PID
9-
description: |
10-
Evaluation |
11-
Developer |
12-
Express |
13-
Web |
14-
Standard |
15-
Enterprise |
16-
Product Key of the format "#####-#####-#####-#####-#####"
9+
- variable: MSSQL_PID
10+
label: SQL Server Edition aka. MSSQL_PID
11+
description: Selects SQL Server Edition or choose Product Key to enter a product key.
12+
type: enum
13+
options:
14+
- Evaluation
15+
- Developer
16+
- Express
17+
- Web
18+
- Standard
19+
- Enterprise
20+
- Product Key
1721
default: Developer
22+
required: true
23+
group: SQL Server options
24+
25+
- variable: PRODUCT_KEY
26+
label: SQL Server Product Key
27+
description: SQL Server Product Key of the format "#####-#####-#####-#####-#####"
28+
min: 29
29+
max: 29
30+
valid_chars: a-zA-Z0-9-
31+
show_if: MSSQL_PID="Product Key"
1832
group: SQL Server options
1933

2034
- variable: MSSQL_SA_PASSWORD
@@ -25,6 +39,7 @@ questions:
2539
max: 128
2640
default: ""
2741
valid_chars: a-zA-Z0-9(`~!@#$%^&*_-+=|\\{}[]:;\"'<>,.?)/
42+
required: true
2843
group: SQL Server options
2944

3045
- variable: MSSQL_AGENT_ENABLED

linux/sample-helm-chart-statefulset-deployment/templates/deployment.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ spec:
3030
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3131
imagePullPolicy: {{ .Values.image.pullPolicy }}
3232
ports:
33-
- containerPort: {{ .Values.containers.ports.containerPort}}
33+
- containerPort: {{ .Values.containers.ports.containerPort }}
3434
env:
3535
- name: MSSQL_PID
36-
value: "{{ .Values.MSSQL_PID}}"
36+
value: "{{ .Values.MSSQL_PID }}"
3737
- name: ACCEPT_EULA
38-
value: "{{ .Values.ACCEPT_EULA | upper}}"
38+
value: "{{ .Values.ACCEPT_EULA | upper }}"
3939
- name: MSSQL_AGENT_ENABLED
40-
value: "{{ .Values.MSSQL_AGENT_ENABLED}}"
40+
value: "{{ .Values.MSSQL_AGENT_ENABLED }}"
4141
- name: MSSQL_SA_PASSWORD
4242
valueFrom:
4343
secretKeyRef:
4444
name: mssql-secret
4545
key: mssql_sa_password
4646
volumeMounts:
4747
- name: mssql
48-
mountPath: "/var/opt/mssql"
48+
mountPath: /var/opt/mssql
4949
- name: mssql-config-volume
5050
mountPath: /var/opt/config
5151
volumes:

linux/sample-helm-chart-statefulset-deployment/templates/secret.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ metadata:
66
{{- include "sql-statefull-deploy.labels" . | nindent 4 }}
77
type: Opaque
88
data:
9-
mssql_sa_password : {{ .Values.MSSQL_SA_PASSWORD | b64enc | quote}}
9+
mssql_sa_password : {{ .Values.MSSQL_SA_PASSWORD | b64enc | quote }}

linux/sample-helm-chart-statefulset-deployment/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ image:
1111
tag: "2019-latest"
1212

1313
ACCEPT_EULA: "Yes"
14-
MSSQL_PID: Developer
14+
MSSQL_PID: {{ .Product_KEY | default "Developer" }}
1515
MSSQL_AGENT_ENABLED: false
1616

1717
containers:
@@ -24,4 +24,4 @@ podSecurityContext:
2424
fsGroup: 10001
2525

2626
service:
27-
port: 1433
27+
port: 1433

0 commit comments

Comments
 (0)