From 39686534f28d17dff7a85053dfedd91a933945f7 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Tue, 9 Feb 2021 18:02:35 +0800 Subject: [PATCH 1/3] fix: correctly generate certificates for long auto-generated domains This hostname is _only_ used in the tls section of the ingress so that the CN of the requested certificate is guaranteed to be < 63 characters. --- .../build-deploy-docker-compose.sh | 1 + .../templates/_helpers.tpl | 8 ++++ .../templates/ingress.yaml | 3 ++ .../nginx-php/templates/_helpers.tpl | 8 ++++ .../nginx-php/templates/ingress.yaml | 3 ++ .../helmcharts/nginx/templates/_helpers.tpl | 8 ++++ .../helmcharts/nginx/templates/ingress.yaml | 3 ++ .../node-persistent/templates/_helpers.tpl | 8 ++++ .../node-persistent/templates/ingress.yaml | 3 ++ .../helmcharts/node/templates/_helpers.tpl | 8 ++++ .../helmcharts/node/templates/ingress.yaml | 3 ++ .../helmcharts/python/templates/_helpers.tpl | 8 ++++ .../helmcharts/python/templates/ingress.yaml | 3 ++ .../varnish-persistent/templates/_helpers.tpl | 8 ++++ .../varnish-persistent/templates/ingress.yaml | 3 ++ .../helmcharts/varnish/templates/_helpers.tpl | 8 ++++ .../helmcharts/varnish/templates/ingress.yaml | 3 ++ ...to-generated-ingress-short-router-url.yaml | 43 +++++++++++++++++ tests/tests/features-kubernetes.yaml | 11 +++++ tests/tests/features/short-router-url.yaml | 48 +++++++++++++++++++ 20 files changed, 191 insertions(+) create mode 100644 tests/checks/check-auto-generated-ingress-short-router-url.yaml create mode 100644 tests/tests/features/short-router-url.yaml diff --git a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh index f5f6006c2b..1f19a00173 100755 --- a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh @@ -531,6 +531,7 @@ yq write -i -- /kubectl-build-deploy/values.yaml 'buildType' $BUILD_TYPE yq write -i -- /kubectl-build-deploy/values.yaml 'routesAutogenerateInsecure' $ROUTES_AUTOGENERATE_INSECURE yq write -i -- /kubectl-build-deploy/values.yaml 'routesAutogenerateEnabled' $ROUTES_AUTOGENERATE_ENABLED yq write -i -- /kubectl-build-deploy/values.yaml 'routesAutogenerateSuffix' $ROUTER_URL +yq write -i -- /kubectl-build-deploy/values.yaml 'routesAutogenerateShortSuffix' $SHORT_ROUTER_URL for i in $ROUTES_AUTOGENERATE_PREFIXES; do yq write -i -- /kubectl-build-deploy/values.yaml 'routesAutogeneratePrefixes[+]' $i; done yq write -i -- /kubectl-build-deploy/values.yaml 'kubernetes' $KUBERNETES yq write -i -- /kubectl-build-deploy/values.yaml 'lagoonVersion' $LAGOON_VERSION diff --git a/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/_helpers.tpl index 7783be5ffc..7a247eea11 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "nginx-php-persistent.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Generate name of Persistent Storage Uses the Release Name (Lagoon Service Name) unless it's overwritten via .Values.persistentStorage.name diff --git a/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/ingress.yaml index 0bbdf51538..b52ad50766 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/nginx-php-persistent/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "nginx-php-persistent.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "nginx-php-persistent.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/_helpers.tpl index 7562523676..553f541623 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "nginx-php.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Common labels */}} diff --git a/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/ingress.yaml index d993810ee6..4042a541d3 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/nginx-php/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "nginx-php.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "nginx-php.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/_helpers.tpl index 623d96ec7f..5925a431cf 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "nginx.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Common labels */}} diff --git a/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/ingress.yaml index e241b8e1ed..35f0f41237 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/nginx/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "nginx.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "nginx.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/_helpers.tpl index 738ebe437b..6f69143d58 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "node-persistent.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Generate name of Persistent Storage Uses the Release Name (Lagoon Service Name) unless it's overwritten via .Values.persistentStorage.name diff --git a/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/ingress.yaml index 90d7ccbea5..8368f4e6ac 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/node-persistent/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "node-persistent.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "node-persistent.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/images/kubectl-build-deploy-dind/helmcharts/node/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/node/templates/_helpers.tpl index 13495ff66d..2dfa04cb6c 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/node/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/node/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "node.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Common labels */}} diff --git a/images/kubectl-build-deploy-dind/helmcharts/node/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/node/templates/ingress.yaml index 8e3e3a89ac..19b586ec0a 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/node/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/node/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "node.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "node.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/images/kubectl-build-deploy-dind/helmcharts/python/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/python/templates/_helpers.tpl index d96c3f2eee..c2bfa3ce5f 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/python/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/python/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "python.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Common labels */}} diff --git a/images/kubectl-build-deploy-dind/helmcharts/python/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/python/templates/ingress.yaml index 9a59944532..67bde8c4be 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/python/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/python/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "python.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "python.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/_helpers.tpl index 22fc0dfa31..01f550d0c3 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "varnish-persistent.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Generate name of Persistent Storage Uses the Release Name (Lagoon Service Name) unless it's overwritten via .Values.persistentStorage.name diff --git a/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/ingress.yaml index 62a0334083..6f70ebe95a 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/varnish-persistent/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "varnish-persistent.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "varnish-persistent.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/_helpers.tpl b/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/_helpers.tpl index 1a9990e361..78456819da 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/_helpers.tpl +++ b/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/_helpers.tpl @@ -32,6 +32,14 @@ Create full hostname for autogenerated hosts {{ end }} {{- end -}} +{{/* +Create short hostname for autogenerated hosts. +This is used to work around problems with long CN fields in certificates. +*/}} +{{- define "varnish.autogeneratedShortHost" -}} +{{- printf "%s.%s" .root.Release.Name .root.Values.routesAutogenerateShortSuffix }} +{{- end }} + {{/* Common labels */}} diff --git a/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/ingress.yaml b/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/ingress.yaml index 43f310f9da..2f158d8831 100644 --- a/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/ingress.yaml +++ b/images/kubectl-build-deploy-dind/helmcharts/varnish/templates/ingress.yaml @@ -25,6 +25,9 @@ spec: tls: - hosts: {{- $host := include "varnish.autogeneratedHost" (dict "root" $) }} + {{- if and .Values.routesAutogenerateShortSuffix (gt ($host | len) 63) }} + - {{ include "varnish.autogeneratedShortHost" (dict "root" $) | quote }} + {{- end }} - {{ $host | quote }} {{- if $.Values.routesAutogeneratePrefixes }} {{- range $k, $prefix := $.Values.routesAutogeneratePrefixes }} diff --git a/tests/checks/check-auto-generated-ingress-short-router-url.yaml b/tests/checks/check-auto-generated-ingress-short-router-url.yaml new file mode 100644 index 0000000000..d0c2cebbb4 --- /dev/null +++ b/tests/checks/check-auto-generated-ingress-short-router-url.yaml @@ -0,0 +1,43 @@ +--- +- name: > + {{ testname }} - Check if auto-generated ingress of namespace + {{ project }}-{{ lagoon_environment }} has the short-router-url in TLS hosts + shell: | + set -e + set -x + + export KUBECONFIG=$(mktemp) + echo "{{ kubeconfig }}" > $KUBECONFIG + # replace with the IP of host from within container + sed -i "s/localhost/$(ip -4 route list match 0/0 | cut -d' ' -f3)/" $KUBECONFIG + + INGRESS_JSON=$(kubectl -n {{ project }}-{{ lagoon_environment }} get ingress -o json) + + NUM_TLS_HOSTS=$(echo $INGRESS_JSON | jq -er '.items[] | select(.metadata.name == "node") | .spec.tls[0].hosts | length') + if [ $NUM_TLS_HOSTS -lt 2 ]; then + echo NUM_TLS_HOSTS: $NUM_TLS_HOSTS + echo $INGRESS_JSON + exit 1 + fi + + FIRST_HOST_LEN=$(echo $INGRESS_JSON | jq -er '.items[] | select(.metadata.name == "node") | .spec.tls[0].hosts[0] | length') + if [ $FIRST_HOST_LEN -gt 63 ]; then + echo FIRST_HOST_LEN: $FIRST_HOST_LEN + echo $INGRESS_JSON + exit 1 + fi + + SECOND_HOST_LEN=$(echo $INGRESS_JSON | jq -er '.items[] | select(.metadata.name == "node") | .spec.tls[0].hosts[1] | length') + if [ $SECOND_HOST_LEN -lt 63 ]; then + echo SECOND_HOST_LEN: $SECOND_HOST_LEN + echo $INGRESS_JSON + exit 1 + fi + register: result + retries: 30 + delay: 10 + until: result.rc == 0 +- name: > + {{ testname }} - Check if {{ ingress }} ingress of namespace + {{ project }}-{{ lagoon_environment }} has the short-router-url in TLS hosts + debug: msg="Success!!!" diff --git a/tests/tests/features-kubernetes.yaml b/tests/tests/features-kubernetes.yaml index 41bded2b2d..a49883aac2 100644 --- a/tests/tests/features-kubernetes.yaml +++ b/tests/tests/features-kubernetes.yaml @@ -26,6 +26,17 @@ project: ci-features-{{ lookup('env','CLUSTER_TYPE') }} branch: ingress-annotations +- include: features/short-router-url.yaml + vars: + testname: "SHORT ROUTER URL {{ cluster_type|upper }}" + git_repo_name: features.git + project: ci-features-{{ cluster_type }} + branch: short-router-url-from-a-very-long-environment-name-like-this + # lagoon_environment is truncated for very long branches. + # See commons/src/tasks.ts + lagoon_environment: short-router-url-from-a-very-l-ebe8 + check_url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix }}" + - include: features/namespace-labels.yaml vars: testname: "NAMESPACE LABELS {{ lookup('env','CLUSTER_TYPE')|upper }}" diff --git a/tests/tests/features/short-router-url.yaml b/tests/tests/features/short-router-url.yaml new file mode 100644 index 0000000000..7ba5499489 --- /dev/null +++ b/tests/tests/features/short-router-url.yaml @@ -0,0 +1,48 @@ + +- name: "{{ testname }} - init git, add files, commit, git push" + hosts: localhost + serial: 1 + vars: + git_files: "features/" + tasks: + - include: ../../tasks/git-init.yaml + - include: ../../tasks/git-add-commit-push.yaml + +- name: "{{ testname }} - api deployEnvironmentBranch on {{ project }}" + hosts: localhost + serial: 1 + vars: + branch: "{{ branch }}" + project: "{{ project }}" + tasks: + - include: ../../tasks/api/deploy-no-sha.yaml + +- name: > + {{ testname }} - check that the auto-generated ingress has the + short-router-url + hosts: localhost + serial: 1 + vars: + branch: "{{ branch }}" + project: "{{ project }}" + lagoon_environment: "{{ lagoon_environment }}" + tasks: + - include: ../../checks/check-auto-generated-ingress-short-router-url.yaml + +- name: "{{ testname }} - api deleteEnvironment on {{ project }}, which should remove all resources" + hosts: localhost + serial: 1 + vars: + project: "{{ project }}" + branch: "{{ branch }}" + tasks: + - include: ../../tasks/api/remove.yaml + +- name: "{{ testname }} - check if site for {{ project }} does not exist anymore" + hosts: localhost + serial: 1 + vars: + url: "{{ check_url }}" + expected_returncode: "{{ del_status_code }}" + tasks: + - include: ../../checks/check-url-returncode.yaml From 114f5d9b4cb4a711f2f545006b3c196ff8ccdc8b Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Wed, 10 Feb 2021 19:18:56 +0800 Subject: [PATCH 2/3] fix: pass raw router pattern in spec The controller will do replacements. --- node-packages/commons/src/tasks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-packages/commons/src/tasks.ts b/node-packages/commons/src/tasks.ts index 3e15dd1673..7d2c00e6b6 100644 --- a/node-packages/commons/src/tasks.ts +++ b/node-packages/commons/src/tasks.ts @@ -302,7 +302,7 @@ const getControllerBuildData = async function(deployData: any) { var projectProductionEnvironment = projectOpenShift.productionEnvironment var projectStandbyEnvironment = projectOpenShift.standbyProductionEnvironment var subfolder = projectOpenShift.subfolder || "" - var routerPattern = projectOpenShift.openshift.routerPattern ? projectOpenShift.openshift.routerPattern.replace('${environment}',environmentName).replace('${project}', projectName) : "" + var routerPattern = projectOpenShift.openshift.routerPattern var prHeadBranch = headBranch || "" var prHeadSha = headSha || "" var prBaseBranch = baseBranch || "" From de31b7c183409374e406699cc40188d124ba7706 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Fri, 19 Feb 2021 20:43:27 +0800 Subject: [PATCH 3/3] fix: re-add Toby's fixes --- tests/tests/features-kubernetes.yaml | 6 +++--- tests/tests/features/short-router-url.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/tests/features-kubernetes.yaml b/tests/tests/features-kubernetes.yaml index a49883aac2..7a2df887d1 100644 --- a/tests/tests/features-kubernetes.yaml +++ b/tests/tests/features-kubernetes.yaml @@ -28,14 +28,14 @@ - include: features/short-router-url.yaml vars: - testname: "SHORT ROUTER URL {{ cluster_type|upper }}" + testname: "SHORT ROUTER URL {{ lookup('env','CLUSTER_TYPE')|upper }}" git_repo_name: features.git - project: ci-features-{{ cluster_type }} + project: ci-features-{{ lookup('env','CLUSTER_TYPE') }} branch: short-router-url-from-a-very-long-environment-name-like-this # lagoon_environment is truncated for very long branches. # See commons/src/tasks.ts lagoon_environment: short-router-url-from-a-very-l-ebe8 - check_url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix }}" + check_url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ lookup('env','ROUTE_SUFFIX_HTTP') }}:{{ lookup('env','ROUTE_SUFFIX_HTTP_PORT') }}" - include: features/namespace-labels.yaml vars: diff --git a/tests/tests/features/short-router-url.yaml b/tests/tests/features/short-router-url.yaml index 7ba5499489..ebd4ca6847 100644 --- a/tests/tests/features/short-router-url.yaml +++ b/tests/tests/features/short-router-url.yaml @@ -43,6 +43,6 @@ serial: 1 vars: url: "{{ check_url }}" - expected_returncode: "{{ del_status_code }}" + expected_returncode: "{{ lookup('env','DELETED_STATUS_CODE') }}" tasks: - include: ../../checks/check-url-returncode.yaml