Skip to content

Commit 8f02fed

Browse files
authored
fix: don't create an empty <appname>-webhook secret with defaults (#553)
* fix: don't create an empty <appname>-webhook secret with defaults Signed-off-by: Yoann LAMOUROUX <yoann.lamouroux@exoscale.ch> * Bump chart version Signed-off-by: Yoann LAMOUROUX <yoann.lamouroux@exoscale.ch> --------- Signed-off-by: Yoann LAMOUROUX <yoann.lamouroux@exoscale.ch>
1 parent f28a240 commit 8f02fed

4 files changed

Lines changed: 34 additions & 11 deletions

File tree

charts/atlantis/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: v1
33
appVersion: v0.43.0
44
description: A Helm chart for Atlantis https://www.runatlantis.io
55
name: atlantis
6-
version: 6.5.0
6+
version: 6.5.1
77
keywords:
88
- terraform
99
home: https://www.runatlantis.io

charts/atlantis/templates/secret-webhook.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
{{- if not .Values.vcsSecretName }}
1+
{{- if and (not .Values.vcsSecretName)
2+
(or
3+
(not (empty .Values.github))
4+
(not (empty .Values.gitlab))
5+
(not (empty .Values.gitea))
6+
(not (empty .Values.githubApp))
7+
(not (empty .Values.azuredevops))
8+
(not (empty .Values.bitbucket))) }}
29
apiVersion: v1
310
kind: Secret
411
metadata:

charts/atlantis/tests/misc_test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ tests:
1212
config: dummy
1313
gitconfigReadOnly: false
1414
gitconfig: dummy
15+
azuredevops:
16+
user: foo
17+
token: bar
18+
webhookUser: foo
19+
webhookPassword: baz
1520
initConfig:
1621
enabled: true
1722
repoConfig: dummy

charts/atlantis/tests/secret-webhook_test.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ release:
77
tests:
88
- it: default values
99
asserts:
10-
- isKind:
11-
of: Secret
12-
- isAPIVersion:
13-
of: v1
14-
- equal:
15-
path: metadata.name
16-
value: my-release-atlantis-webhook
17-
- isNullOrEmpty:
18-
path: data
10+
- hasDocuments:
11+
count: 0
12+
- it: defined repositories and vcsSecretName
13+
set:
14+
vcsSecretName: foo
15+
githubApp:
16+
id: 123456
17+
key: |
18+
-----BEGIN PRIVATE KEY-----
19+
...
20+
-----END PRIVATE KEY-----
21+
azuredevops:
22+
token: bar
23+
webhookPassword: baz
24+
asserts:
25+
- hasDocuments:
26+
count: 0
1927
- it: vcsSecretName
2028
set:
2129
vcsSecretName: atlantis-vcs
@@ -196,6 +204,9 @@ tests:
196204
azuredevops_webhook_password: YmF6
197205
- it: commonLabels
198206
set:
207+
azuredevops:
208+
token: bar
209+
webhookPassword: baz
199210
commonLabels:
200211
team: infra
201212
asserts:

0 commit comments

Comments
 (0)