Skip to content

Commit

Permalink
Fix Helm tests on release tag (#1255)
Browse files Browse the repository at this point in the history
Fix Helm tests on release tag and replace cut commands.

Problem: Helm tests fail on release tag because the kind load command did not work when the provided images spanned multiple lines. Also, cut commands did not work as input was not a single value.

Solution: Instead of using steps.*.outputs.tags which can output multiple lines, changed to use the hardcoded path to the image and a specific version.
  • Loading branch information
bjee19 authored Nov 20, 2023
1 parent ab9ead5 commit 59dda24
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,21 @@ jobs:
kube_config=${{ github.workspace }}/deploy/helm-chart/kube-${{ github.run_id }}-helm
make create-kind-cluster KIND_KUBE_CONFIG=${kube_config}
echo "KUBECONFIG=${kube_config}" >> "$GITHUB_ENV"
kind load docker-image ${{ steps.ngf-meta.outputs.tags }} ${{ steps.nginx-meta.outputs.tags }}
kind load docker-image ghcr.io/nginxinc/nginx-gateway-fabric:${{ steps.ngf-meta.outputs.version }} ghcr.io/nginxinc/nginx-gateway-fabric/nginx:${{ steps.nginx-meta.outputs.version }}
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
- name: Install Chart
run: >
helm install
helm-$(echo ${{ steps.ngf-meta.outputs.tags }} | tr '.' '-' | cut -d ":" -f 2)
helm-$(echo ${{ steps.nginx-meta.outputs.version }} | tr '.' '-')
.
--wait
--create-namespace
--set nginxGateway.image.repository=$(echo ${{ steps.ngf-meta.outputs.tags }} | cut -d ":" -f 1)
--set nginxGateway.image.tag=$(echo ${{ steps.ngf-meta.outputs.tags }} | cut -d ":" -f 2)
--set nginxGateway.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric
--set nginxGateway.image.tag=${{ steps.ngf-meta.outputs.version }}
--set nginxGateway.image.pullPolicy=Never
--set nginx.image.repository=$(echo ${{ steps.nginx-meta.outputs.tags }} | cut -d ":" -f 1)
--set nginx.image.tag=$(echo ${{ steps.nginx-meta.outputs.tags }} | cut -d ":" -f 2)
--set nginx.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric/nginx
--set nginx.image.tag=${{ steps.nginx-meta.outputs.version }}
--set nginx.image.pullPolicy=Never
--set service.type=NodePort
-n nginx-gateway
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
- name: Prepare NGF files
run: |
ngf_prefix=$(echo ${{ steps.ngf-meta.outputs.tags }} | cut -d ":" -f 1)
ngf_tag=$(echo ${{ steps.ngf-meta.outputs.tags }} | cut -d ":" -f 2)
make update-ngf-manifest PREFIX=${ngf_prefix} TAG=${ngf_tag}
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
ngf_tag=${{ steps.ngf-meta.outputs.version }}
make update-ngf-manifest NGF_PREFIX=${ngf_prefix} NGF_TAG=${ngf_tag}
working-directory: ./conformance

- name: Build binary
Expand Down Expand Up @@ -142,8 +142,8 @@ jobs:
- name: Setup conformance tests
run: |
ngf_prefix=$(echo ${{ steps.ngf-meta.outputs.tags }} | cut -d ":" -f 1)
ngf_tag=$(echo ${{ steps.ngf-meta.outputs.tags }} | cut -d ":" -f 2)
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
ngf_tag=${{ steps.ngf-meta.outputs.version }}
if [ ${{ github.event_name }} == "schedule" ]; then export GW_API_VERSION=main; fi
if [ ${{ startsWith(matrix.k8s-version, '1.23') || startsWith(matrix.k8s-version, '1.24') }} == "true" ]; then export INSTALL_WEBHOOK=true; fi
make install-ngf-local-no-build PREFIX=${ngf_prefix} TAG=${ngf_tag}
Expand Down

0 comments on commit 59dda24

Please sign in to comment.