From 0b7fb69381427360fbd6b8e5ddc7539c318881b0 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 6 Mar 2024 07:32:33 +1100 Subject: [PATCH 1/4] add variable to control ssh portal and nats --- .github/workflows/test-suite.yaml | 48 +++++++++++++++++-------------- Makefile | 4 +++ 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test-suite.yaml b/.github/workflows/test-suite.yaml index b2039684..0c486d65 100644 --- a/.github/workflows/test-suite.yaml +++ b/.github/workflows/test-suite.yaml @@ -9,28 +9,29 @@ jobs: strategy: fail-fast: false matrix: - test: - - active-standby-kubernetes - - api - - deploytarget - - features-kubernetes - - features-kubernetes-2 - - features-variables - - services - - tasks + test: [ + { test: "active-standby-kubernetes", sshportal: false }, + { test: "api", sshportal: false }, + { test: "deploytarget", sshportal: false }, + { test: "features-kubernetes", sshportal: true }, + { test: "features-kubernetes-2", sshportal: false }, + { test: "features-variables", sshportal: false }, + { test: "services", sshportal: false }, + { test: "tasks", sshportal: false } + ] ## Re-enable any of these tests in your branch for specific testing - ## - bitbucket - ## - bulk-deployment - ## - drush - ## - generic - ## - github - ## - gitlab - ## - image-cache - ## - nginx - ## - node - ## - python - ## - ssh-legacy - ## - workflows + ## { test: "bitbucket", sshportal: false }, + ## { test: "bulk-deployment", sshportal: false }, + ## { test: "drush", sshportal: true }, + ## { test: "generic", sshportal: false }, + ## { test: "github", sshportal: false }, + ## { test: "gitlab", sshportal: false }, + ## { test: "image-cache", sshportal: false }, + ## { test: "nginx", sshportal: false }, + ## { test: "node", sshportal: false }, + ## { test: "python", sshportal: false }, + ## { test: "ssh-legacy", sshportal: false }, + ## { test: "workflows", sshportal: false }, steps: # Continue after getting a shell via: `touch continue` @@ -119,6 +120,11 @@ jobs: sudo cp /tmp/kubens /usr/local/bin/kubens sudo ln -s $(which kubectl) /usr/local/bin/kc + - name: Set SSH Portal environment variable + if: matrix.test.sshportal + run: | + echo "ENABLE_SSH_PORTAL=${{ matrix.test.sshportal }}" >> $GITHUB_ENV + - name: Helm-install the test fixtures and fill lagoon-test/ci/linter-values.yaml if: | (steps.list-changed.outputs.changed == 'true') || diff --git a/Makefile b/Makefile index 64088fcf..4942ca0e 100644 --- a/Makefile +++ b/Makefile @@ -181,6 +181,8 @@ install-lagoon-core: install-minio $$([ $(OVERRIDE_BUILD_DEPLOY_DIND_IMAGE) ] && echo '--set buildDeployImage.default.image=$(OVERRIDE_BUILD_DEPLOY_DIND_IMAGE)') \ $$([ $(DISABLE_CORE_HARBOR) ] && echo '--set api.additionalEnvs.DISABLE_CORE_HARBOR=$(DISABLE_CORE_HARBOR)') \ $$([ $(OPENSEARCH_INTEGRATION_ENABLED) ] && echo '--set api.additionalEnvs.OPENSEARCH_INTEGRATION_ENABLED=$(OPENSEARCH_INTEGRATION_ENABLED)') \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .sshPortalAPI.enabled=$(ENABLE_SSH_PORTAL)') \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .nats.enabled=$(ENABLE_SSH_PORTAL)') \ --set "keycloakFrontEndURL=http://lagoon-keycloak.$$($(KUBECTL) get nodes -o jsonpath='{.items[0].status.addresses[0].address}').nip.io:32080" \ --set "lagoonAPIURL=http://lagoon-api.$$($(KUBECTL) get nodes -o jsonpath='{.items[0].status.addresses[0].address}').nip.io:32080/graphql" \ --set actionsHandler.image.repository=$(IMAGE_REGISTRY)/actions-handler \ @@ -233,6 +235,8 @@ install-lagoon-remote: install-lagoon-build-deploy install-lagoon-core install-m --wait \ --timeout $(TIMEOUT) \ --values ./charts/lagoon-remote/ci/linter-values.yaml \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .sshPortal.enabled=$(ENABLE_SSH_PORTAL)') \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .nats.enabled=$(ENABLE_SSH_PORTAL)') \ --set "lagoon-build-deploy.enabled=false" \ --set "dockerHost.registry=registry.$$($(KUBECTL) get nodes -o jsonpath='{.items[0].status.addresses[0].address}').nip.io:32080" \ --set "dbaas-operator.mariadbProviders.development.environment=development" \ From 4c046de4e01e1b8f98f963ebef0a1e489bb37db6 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 6 Mar 2024 07:33:11 +1100 Subject: [PATCH 2/4] accomodate missing sshportal value --- .github/workflows/test-suite.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-suite.yaml b/.github/workflows/test-suite.yaml index 0c486d65..ae9d0a9d 100644 --- a/.github/workflows/test-suite.yaml +++ b/.github/workflows/test-suite.yaml @@ -121,16 +121,15 @@ jobs: sudo ln -s $(which kubectl) /usr/local/bin/kc - name: Set SSH Portal environment variable - if: matrix.test.sshportal run: | - echo "ENABLE_SSH_PORTAL=${{ matrix.test.sshportal }}" >> $GITHUB_ENV + echo "ENABLE_SSH_PORTAL=${{ matrix.test.sshportal || 'true' }}" >> $GITHUB_ENV - name: Helm-install the test fixtures and fill lagoon-test/ci/linter-values.yaml if: | (steps.list-changed.outputs.changed == 'true') || (contains(github.event.pull_request.labels.*.name, 'needs-testing')) - # run: make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test }}] IMAGE_REGISTRY=testlagoon IMAGE_TAG=main OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main - run: make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test }}] + # run: make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test.test }}] IMAGE_REGISTRY=testlagoon IMAGE_TAG=main OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main + run: make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test.test }}] - name: Free up some disk space if: | From bf810dc2f5055d9bea48760d59b707f8a070c0bf Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 6 Mar 2024 07:33:11 +1100 Subject: [PATCH 3/4] remove sshportal fallback --- .github/workflows/test-suite.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-suite.yaml b/.github/workflows/test-suite.yaml index ae9d0a9d..564e74f3 100644 --- a/.github/workflows/test-suite.yaml +++ b/.github/workflows/test-suite.yaml @@ -122,7 +122,7 @@ jobs: - name: Set SSH Portal environment variable run: | - echo "ENABLE_SSH_PORTAL=${{ matrix.test.sshportal || 'true' }}" >> $GITHUB_ENV + echo "ENABLE_SSH_PORTAL=${{ matrix.test.sshportal }}" >> $GITHUB_ENV - name: Helm-install the test fixtures and fill lagoon-test/ci/linter-values.yaml if: | From 944de074998d0188cdade3a65233df0574d49673 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 6 Mar 2024 07:33:11 +1100 Subject: [PATCH 4/4] ssh portal check --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4942ca0e..b5e3639b 100644 --- a/Makefile +++ b/Makefile @@ -181,8 +181,8 @@ install-lagoon-core: install-minio $$([ $(OVERRIDE_BUILD_DEPLOY_DIND_IMAGE) ] && echo '--set buildDeployImage.default.image=$(OVERRIDE_BUILD_DEPLOY_DIND_IMAGE)') \ $$([ $(DISABLE_CORE_HARBOR) ] && echo '--set api.additionalEnvs.DISABLE_CORE_HARBOR=$(DISABLE_CORE_HARBOR)') \ $$([ $(OPENSEARCH_INTEGRATION_ENABLED) ] && echo '--set api.additionalEnvs.OPENSEARCH_INTEGRATION_ENABLED=$(OPENSEARCH_INTEGRATION_ENABLED)') \ - $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .sshPortalAPI.enabled=$(ENABLE_SSH_PORTAL)') \ - $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .nats.enabled=$(ENABLE_SSH_PORTAL)') \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set sshPortalAPI.enabled=$(ENABLE_SSH_PORTAL)') \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set nats.enabled=$(ENABLE_SSH_PORTAL)') \ --set "keycloakFrontEndURL=http://lagoon-keycloak.$$($(KUBECTL) get nodes -o jsonpath='{.items[0].status.addresses[0].address}').nip.io:32080" \ --set "lagoonAPIURL=http://lagoon-api.$$($(KUBECTL) get nodes -o jsonpath='{.items[0].status.addresses[0].address}').nip.io:32080/graphql" \ --set actionsHandler.image.repository=$(IMAGE_REGISTRY)/actions-handler \ @@ -235,8 +235,8 @@ install-lagoon-remote: install-lagoon-build-deploy install-lagoon-core install-m --wait \ --timeout $(TIMEOUT) \ --values ./charts/lagoon-remote/ci/linter-values.yaml \ - $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .sshPortal.enabled=$(ENABLE_SSH_PORTAL)') \ - $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set .nats.enabled=$(ENABLE_SSH_PORTAL)') \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set sshPortal.enabled=$(ENABLE_SSH_PORTAL)') \ + $$([ $(ENABLE_SSH_PORTAL) ] && echo '--set nats.enabled=$(ENABLE_SSH_PORTAL)') \ --set "lagoon-build-deploy.enabled=false" \ --set "dockerHost.registry=registry.$$($(KUBECTL) get nodes -o jsonpath='{.items[0].status.addresses[0].address}').nip.io:32080" \ --set "dbaas-operator.mariadbProviders.development.environment=development" \