This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
ManagedZone updates #1247
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-E2E | |
on: | |
push: | |
branches: | |
- main | |
- "release-*" | |
- 406_dnspolicy_provider_ref | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
paths-ignore: | |
- '**.adoc' | |
- '**.md' | |
- 'samples/**' | |
- 'LICENSE' | |
pull_request_target: | |
branches: | |
- main | |
- "release-*" | |
paths-ignore: | |
- '**.adoc' | |
- '**.md' | |
- 'samples/**' | |
- 'LICENSE' | |
jobs: | |
e2e_test_suite: | |
name: E2E Test Suite | |
runs-on: ubuntu-latest | |
# see https://docs.github.com/en/graphql/reference/enums#commentauthorassociation | |
# for info on author association | |
environment: | |
${{ github.event_name == 'pull_request_target' && | |
github.event.pull_request.author_association != 'OWNER' && | |
github.event.pull_request.author_association != 'MEMBER' && | |
github.event.pull_request.author_association != 'COLLABORATOR' && | |
github.event.pull_request.author_association != 'CONTRIBUTOR' && | |
'e2e-external' || 'e2e-internal' }} | |
steps: | |
- run: cat $GITHUB_EVENT_PATH | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21.x" | |
- name: Create controller-config.env | |
run: | | |
echo "AWS_DNS_PUBLIC_ZONE_ID=Z086929132US3PB46EOLR" >> controller-config.env | |
echo "ZONE_ROOT_DOMAIN=e2e.hcpapps.net" >> controller-config.env | |
echo "ZONE_NAME=e2e-google-hcpapps-net" >> controller-config.env | |
echo "ZONE_DNS_NAME=e2e.google.hcpapps.net" >> controller-config.env | |
- name: Create aws-credentials.env | |
run: | | |
echo "AWS_ACCESS_KEY_ID=${{ secrets.E2E_AWS_ACCESS_KEY_ID }}" >> aws-credentials.env | |
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}" >> aws-credentials.env | |
echo "AWS_REGION=${{ env.AWS_REGION }}" >> aws-credentials.env | |
- name: Create gcp-credentials.env | |
run: | | |
secret="${{ secrets.E2E_GOOGLE }}" | |
decoded=$(echo "$secret" | base64 --decode ) | |
echo "GOOGLE=$decoded" >> gcp-credentials.env | |
echo "PROJECT_ID=${{ secrets.E2E_PROJECT_ID }}" >> gcp-credentials.env | |
- name: Setup environment | |
run: | | |
export OCM_SINGLE=1 | |
make local-setup | |
- name: Deploy | |
run: | | |
make docker-build-gateway-controller kind-load-gateway-controller docker-build-policy-controller kind-load-policy-controller deploy-gateway-controller | |
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system get deployments/mgc-controller-manager -o yaml | yq .spec.template.spec.containers[0].image | |
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system get deployments/mgc-policy-controller -o yaml | yq .spec.template.spec.containers[0].image | |
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system wait --timeout=300s --for=condition=Available deployment/mgc-controller-manager | |
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system wait --timeout=300s --for=condition=Available deployment/mgc-policy-controller | |
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-controller-manager -n multicluster-gateway-controller-system | |
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-policy-controller -n multicluster-gateway-controller-system | |
kubectl get managedzones -n multi-cluster-gateways mgc-dev-mz-aws -o yaml | |
kubectl --context kind-mgc-control-plane -n multi-cluster-gateways wait --timeout=60s --for=condition=Ready managedzone/mgc-dev-mz-aws | |
kubectl get managedzones -n multi-cluster-gateways mgc-dev-mz-gcp -o yaml | |
kubectl --context kind-mgc-control-plane -n multi-cluster-gateways wait --timeout=60s --for=condition=Ready managedzone/mgc-dev-mz-gcp | |
- name: Run suite AWS | |
run: | | |
export OCM_SINGLE=1 | |
export TEST_HUB_NAMESPACE=multi-cluster-gateways | |
export TEST_HUB_KUBE_CONTEXT=kind-mgc-control-plane | |
export TEST_DNS_PROVIDER_SECRET_NAME=mgc-aws-credentials | |
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.hcpapps.net | |
export TEST_DNS_ZONE_ID=Z086929132US3PB46EOLR | |
make test-e2e | |
- name: Run suite GCP | |
run: | | |
export OCM_SINGLE=1 | |
export TEST_HUB_NAMESPACE=multi-cluster-gateways | |
export TEST_HUB_KUBE_CONTEXT=kind-mgc-control-plane | |
export TEST_DNS_PROVIDER_SECRET_NAME=mgc-gcp-credentials | |
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.google.hcpapps.net | |
export TEST_DNS_ZONE_ID=e2e-google-hcpapps-net | |
make test-e2e | |
- name: Dump Gateway Controller logs | |
if: ${{ failure() }} | |
run: | | |
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-controller-manager -n multicluster-gateway-controller-system | |
- name: Dump Policy Controller logs | |
if: ${{ failure() }} | |
run: | | |
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-policy-controller -n multicluster-gateway-controller-system |