Skip to content

Commit c42f487

Browse files
authored
fix(helm/provisioner): fail if psk and key are both set (coder#15157)
Relates to coder#14985 Context: coder#15122 (comment) Specifying both `provisionerDaemon.pskSecretName` and `provisionerDaemon.keySecretName` will now result in an error. This prevents a potential `CrashLoopBackoff` debug session due to the following error: ``` error: cannot provide both provisioner key --key and pre-shared key --psk ```
1 parent 76bfa9b commit c42f487

File tree

3 files changed

+3
-143
lines changed

3 files changed

+3
-143
lines changed

helm/provisioner/templates/_coder.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ env:
3434
value: "0.0.0.0:2112"
3535
{{- if and (empty .Values.provisionerDaemon.pskSecretName) (empty .Values.provisionerDaemon.keySecretName) }}
3636
{{ fail "Either provisionerDaemon.pskSecretName or provisionerDaemon.keySecretName must be specified." }}
37+
{{- else if and (.Values.provisionerDaemon.pskSecretName) (.Values.provisionerDaemon.keySecretName) }}
38+
{{ fail "Either provisionerDaemon.pskSecretName or provisionerDaemon.keySecretName must be specified, but not both." }}
3739
{{- end }}
3840
{{- if .Values.provisionerDaemon.pskSecretName }}
3941
- name: CODER_PROVISIONER_DAEMON_PSK

helm/provisioner/tests/chart_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var testCases = []testCase{
5858
},
5959
{
6060
name: "provisionerd_psk_and_key",
61-
expectedError: "",
61+
expectedError: `Either provisionerDaemon.pskSecretName or provisionerDaemon.keySecretName must be specified, but not both.`,
6262
},
6363
{
6464
name: "provisionerd_no_psk_or_key",

helm/provisioner/tests/testdata/provisionerd_psk_and_key.golden

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy