From ba8e54dacac829fcd51800a691f63b4f3fbdabef Mon Sep 17 00:00:00 2001 From: Luke Kysow <1034429+lkysow@users.noreply.github.com> Date: Thu, 1 Nov 2018 11:01:36 -0500 Subject: [PATCH 1/2] Fix helm chart. - Set fsGroup for correct file permissions - Set memory default to 256 since Atlantis doesn't need more unless you have large TF - Use latest version of Atlantis --- helm/atlantis/templates/statefulset.yaml | 4 +++- helm/atlantis/values.yaml | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/helm/atlantis/templates/statefulset.yaml b/helm/atlantis/templates/statefulset.yaml index 07dad290b..797f4c26f 100644 --- a/helm/atlantis/templates/statefulset.yaml +++ b/helm/atlantis/templates/statefulset.yaml @@ -19,6 +19,8 @@ spec: app: {{ template "atlantis.name" . }} release: {{ .Release.Name }} spec: + securityContext: + fsGroup: 1000 volumes: {{- range $name, $_ := .Values.serviceAccountSecrets }} - name: {{ $name }}-volume @@ -187,4 +189,4 @@ spec: requests: # The biggest thing Atlantis stores is the Git repo when it checks it out. # It deletes the repo after the pull request is merged. - storage: 5Gi \ No newline at end of file + storage: 5Gi diff --git a/helm/atlantis/values.yaml b/helm/atlantis/values.yaml index 42feecb83..b1f382490 100644 --- a/helm/atlantis/values.yaml +++ b/helm/atlantis/values.yaml @@ -73,7 +73,7 @@ serviceAccountSecrets: image: repository: runatlantis/atlantis - tag: v0.4.5 + tag: v0.4.11 pullPolicy: IfNotPresent ## enable using atlantis.yaml file @@ -115,10 +115,10 @@ ingress: resources: requests: - memory: 1Gi + memory: 256Mi cpu: 100m limits: - memory: 1Gi + memory: 256Mi cpu: 100m replicaCount: 1 From 374b26f44e4ae55adf99d5491555b4510d66b76c Mon Sep 17 00:00:00 2001 From: Luke Kysow <1034429+lkysow@users.noreply.github.com> Date: Thu, 1 Nov 2018 11:13:34 -0500 Subject: [PATCH 2/2] Fix non-deterministic tests. --- server/events_controller_e2e_test.go | 8 +++---- .../simple-yaml/exp-output-apply-all.txt | 8 +++---- .../simple-yaml/exp-output-apply-default.txt | 4 ++-- .../simple-yaml/exp-output-apply-staging.txt | 4 ++-- .../simple/exp-output-apply-var-all.txt | 24 +++++++++---------- ...exp-output-apply-var-default-workspace.txt | 12 +++++----- .../exp-output-apply-var-new-workspace.txt | 12 +++++----- .../simple/exp-output-apply-var.txt | 12 +++++----- .../test-repos/simple/exp-output-apply.txt | 12 +++++----- .../exp-output-apply-default.txt | 4 ++-- .../exp-output-apply-staging.txt | 4 ++-- .../tfvars-yaml/exp-output-apply-default.txt | 4 ++-- .../tfvars-yaml/exp-output-apply-staging.txt | 4 ++-- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/server/events_controller_e2e_test.go b/server/events_controller_e2e_test.go index d1b6500cd..49ed55e93 100644 --- a/server/events_controller_e2e_test.go +++ b/server/events_controller_e2e_test.go @@ -486,10 +486,10 @@ func assertCommentEquals(t *testing.T, expFile string, act string, repoDir strin idRegex := regexp.MustCompile(`Creation complete after [0-9]+s \(ID: [0-9]+\)`) act = idRegex.ReplaceAllString(act, "Creation complete after *s (ID: ******************)") - // Replace all null_resource.simple{n} with null_resource.simple because with - // multiple resources they might be created at different times and so the - // output is unordered. - resourceRegex := regexp.MustCompile(`null_resource\.simple\d:`) + // Replace all null_resource.simple{n}: .* with null_resource.simple: because + // with multiple resources being created the logs are all out of order which + // makes comparison impossible. + resourceRegex := regexp.MustCompile(`null_resource\.simple\d?:.*`) act = resourceRegex.ReplaceAllString(act, "null_resource.simple:") if string(exp) != act { diff --git a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt index 6f0a00c64..4de00a6ae 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt @@ -4,8 +4,8 @@ Ran Apply for 2 projects: ### 1. workspace: `default` dir: `.` ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. @@ -19,8 +19,8 @@ workspace = default --- ### 2. workspace: `staging` dir: `.` ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt index a68dfd29f..1738f6f59 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt @@ -1,8 +1,8 @@ Ran Apply in dir: `.` workspace: `default` ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt index fa18ee320..4e38e9600 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt @@ -1,8 +1,8 @@ Ran Apply in dir: `.` workspace: `staging` ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt index 2a32fa2ca..1a0ab13c9 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt @@ -6,12 +6,12 @@ Ran Apply for 2 projects:
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: Apply complete! Resources: 3 added, 0 changed, 0 destroyed. @@ -28,12 +28,12 @@ workspace = default
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: Apply complete! Resources: 3 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt index 71a83e0ff..5173c8dc9 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt @@ -3,12 +3,12 @@ Ran Apply in dir: `.` workspace: `default`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: Apply complete! Resources: 3 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt index 17898412f..83db19f6f 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt @@ -3,12 +3,12 @@ Ran Apply in dir: `.` workspace: `new_workspace`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: Apply complete! Resources: 3 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var.txt index 3c0728e44..fe0acaddd 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var.txt @@ -3,12 +3,12 @@ Ran Apply in dir: `.` workspace: `default`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: Apply complete! Resources: 3 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/simple/exp-output-apply.txt b/server/testfixtures/test-repos/simple/exp-output-apply.txt index 0bfebb470..0efc493ee 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply.txt @@ -3,12 +3,12 @@ Ran Apply in dir: `.` workspace: `default`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: +null_resource.simple: Apply complete! Resources: 3 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt index cf7903df0..2f1c7775d 100644 --- a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt +++ b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt @@ -3,8 +3,8 @@ Ran Apply in dir: `.` workspace: `default`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt index 03fe1e86d..b5cf2a93b 100644 --- a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt @@ -3,8 +3,8 @@ Ran Apply in dir: `.` workspace: `default`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt index cf7903df0..2f1c7775d 100644 --- a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt +++ b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt @@ -3,8 +3,8 @@ Ran Apply in dir: `.` workspace: `default`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed. diff --git a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt index 03fe1e86d..b5cf2a93b 100644 --- a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt @@ -3,8 +3,8 @@ Ran Apply in dir: `.` workspace: `default`
Show Output ```diff -null_resource.simple: Creating... -null_resource.simple: Creation complete after *s (ID: ******************) +null_resource.simple: +null_resource.simple: Apply complete! Resources: 1 added, 0 changed, 0 destroyed.