Skip to content

Commit bef2a3a

Browse files
committed
Fix unwritable .aws directory
1 parent 6637864 commit bef2a3a

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

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.35.1
44
description: A Helm chart for Atlantis https://www.runatlantis.io
55
name: atlantis
6-
version: 5.18.1
6+
version: 5.18.2
77
keywords:
88
- terraform
99
home: https://www.runatlantis.io

charts/atlantis/templates/statefulset.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ spec:
130130
secret:
131131
secretName: {{ .Values.netrcSecretName }}
132132
{{- end }}
133+
{{- if or .Values.aws.credentials .Values.aws.config }}
134+
- name: aws-dir
135+
emptyDir: {}
136+
{{- end }}
133137
{{- if or .Values.aws.credentials .Values.aws.config .Values.awsSecretName }}
134138
- name: aws-volume
135139
secret:
@@ -584,10 +588,23 @@ spec:
584588
mountPath: /home/atlantis/.netrc
585589
subPath: netrc
586590
{{- end }}
587-
{{- if or .Values.aws.credentials .Values.aws.config .Values.awsSecretName }}
591+
{{- if .Values.awsSecretName }}
588592
- name: aws-volume
589593
readOnly: true
590594
mountPath: {{ .Values.aws.directory | default "/home/atlantis/.aws" }}
595+
{{- else if or .Values.aws.credentials .Values.aws.config }}
596+
- name: aws-dir
597+
mountPath: {{ .Values.aws.directory | default "/home/atlantis/.aws" }}
598+
{{- end }}
599+
{{- if .Values.aws.credentials }}
600+
- name: aws-volume
601+
mountPath: {{ .Values.aws.directory | default "/home/atlantis/.aws" }}/credentials
602+
subPath: credentials
603+
{{- end }}
604+
{{- if .Values.aws.config }}
605+
- name: aws-volume
606+
mountPath: {{ .Values.aws.directory | default "/home/atlantis/.aws" }}/config
607+
subPath: config
591608
{{- end }}
592609
{{- if .Values.tlsSecretName }}
593610
- name: tls

charts/atlantis/tests/statefulset_test.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,27 @@ tests:
508508
asserts:
509509
- equal:
510510
path: spec.template.spec.volumes[1]
511+
value:
512+
name: aws-dir
513+
emptyDir: {}
514+
- equal:
515+
path: spec.template.spec.volumes[2]
511516
value:
512517
name: aws-volume
513518
secret:
514519
secretName: my-release-atlantis-aws
515520
- equal:
516-
path: spec.template.spec.containers[0].volumeMounts[?(@.name == "aws-volume")]
521+
path: spec.template.spec.containers[0].volumeMounts[?(@.name == "aws-volume" && @.subPath == "credentials")]
517522
value:
518-
mountPath: /home/atlantis/.aws
523+
mountPath: /home/atlantis/.aws/credentials
519524
name: aws-volume
520-
readOnly: true
525+
subPath: credentials
526+
- equal:
527+
path: spec.template.spec.containers[0].volumeMounts[?(@.name == "aws-volume" && @.subPath == "config")]
528+
value:
529+
mountPath: /home/atlantis/.aws/config
530+
name: aws-volume
531+
subPath: config
521532
- it: aws directory
522533
template: statefulset.yaml
523534
set:

0 commit comments

Comments
 (0)