Skip to content

Commit

Permalink
Merge pull request #6 from uselagoon/tls-acme
Browse files Browse the repository at this point in the history
Ignore tls-acme fields in routes
  • Loading branch information
smlx authored Oct 30, 2021
2 parents f30b205 + 26709b7 commit 3783890
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 3 deletions.
3 changes: 0 additions & 3 deletions internal/lagoonyml/lagoon.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import "encoding/json"

// Ingress represents a Lagoon route.
type Ingress struct {
TLSACME string `json:"tls-acme"`
Insecure string `json:"insecure"`
HSTS string `json:"hsts"`
Annotations map[string]string `json:"annotations"`
}

Expand Down
8 changes: 8 additions & 0 deletions internal/lagoonyml/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ func TestLint(t *testing.T) {
input: "testdata/valid.1.lagoon.yml",
valid: true,
},
"tls-acme boolean": {
input: "testdata/valid.2.lagoon.yml",
valid: true,
},
"complete .lagoon.yml": {
input: "testdata/valid.3.lagoon.yml",
valid: true,
},
"invalid.0.lagoon.yml": {
input: "testdata/invalid.0.lagoon.yml",
valid: false,
Expand Down
9 changes: 9 additions & 0 deletions internal/lagoonyml/testdata/valid.2.lagoon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# tls-acme boolean value
environments:
main:
monitoring_urls:
- "https://www.example.com"
routes:
- nginx:
- "www.example.com":
tls-acme: true
73 changes: 73 additions & 0 deletions internal/lagoonyml/testdata/valid.3.lagoon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# more complete valid .lagoon.yml
docker-compose-yaml: example-docker-compose.yml

tasks:
post-rollout:
- run:
name: Post-rollout script
command: /app/scripts/post-rollout.sh
service: cli

production_routes:
active:
routes:
- nginx:
- "www.example.com":
tls-acme: true
insecure: Redirect
- "de.example.com":
tls-acme: "true"
insecure: Redirect

standby:
routes:
- nginx:
- "www.standby.example.com":
tls-acme: "false"
insecure: Redirect
- "de.standby.example.com":
tls-acme: "false"
insecure: Redirect

routes:
autogenerate:
prefixes:
- www
- de

environments:
production-green:
cronjobs:
- name: drush cron
schedule: "22 * * * *"
command: drush --root=/app/docroot cron
service: cli
production-blue:
cronjobs:
- name: drush cron
schedule: "22 * * * *"
command: drush --root=/app/docroot cron
service: cli
staging:
cronjobs:
- name: drush cron
schedule: "34 * * * *"
command: drush cron
service: cli
routes:
- nginx:
- "www.test.example.com":
tls-acme: false
insecure: Redirect
- "de.test.example.com":
tls-acme: "false"
insecure: Redirect
develop:
routes:
- nginx:
- "www.dev.example.com":
tls-acme: "false"
insecure: Redirect
- "de.dev.example.com":
tls-acme: false
insecure: Redirect

0 comments on commit 3783890

Please sign in to comment.