Skip to content

Commit bc40b77

Browse files
authored
Merge branch 'main' into main
2 parents c795322 + 118488e commit bc40b77

File tree

136 files changed

+4584
-1143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4584
-1143
lines changed

.ct.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
remote: origin
2+
target-branch: main
3+
4+
check-version-increment: false

.github/release-notes.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- skip-changelog
5+
categories:
6+
- title: Changelog
7+
labels:
8+
- release-notes

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
platforms: arm64
5757

5858
- name: Login to GitHub Container Registry
59-
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
59+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
6060
if: ${{ github.event_name != 'pull_request' && ! contains(inputs.image, 'plus') }}
6161
with:
6262
registry: ghcr.io
@@ -73,7 +73,7 @@ jobs:
7373
if: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus')}}
7474

7575
- name: Login to NGINX Registry
76-
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
76+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
7777
with:
7878
registry: docker-mgmt.nginx.com
7979
username: ${{ steps.idtoken.outputs.id_token }}
@@ -152,7 +152,7 @@ jobs:
152152
fail-build: false
153153

154154
- name: Upload scan result to GitHub Security tab
155-
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
155+
uses: github/codeql-action/upload-sarif@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
156156
continue-on-error: true
157157
with:
158158
sarif_file: ${{ steps.scan.outputs.sarif }}

.github/workflows/ci.yml

+30-95
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,33 @@ jobs:
3131
outputs:
3232
go_path: ${{ steps.vars.outputs.go_path }}
3333
min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }}
34+
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
35+
helm_changes: ${{ steps.filter.outputs.charts }}
3436
steps:
3537
- name: Checkout Repository
3638
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
39+
with:
40+
fetch-depth: 0
3741

3842
- name: Setup Golang Environment
3943
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
4044
with:
4145
go-version: stable
4246

47+
- name: Check for changes
48+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
49+
id: filter
50+
with:
51+
filters: |
52+
charts:
53+
- charts/nginx-gateway-fabric/**/*
54+
4355
- name: Output Variables
4456
id: vars
4557
run: |
4658
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
47-
echo "min_k8s_version=1.25.16" >> $GITHUB_OUTPUT
59+
echo "min_k8s_version=v1.25.16" >> $GITHUB_OUTPUT
60+
echo "k8s_latest=$(grep -m1 'FROM kindest/node' <tests/Dockerfile | awk -F'[:]' '{print $2}')" >> $GITHUB_OUTPUT
4861
4962
- name: Check if go.mod and go.sum are up to date
5063
run: go mod tidy && git diff --exit-code -- go.mod go.sum
@@ -131,7 +144,7 @@ jobs:
131144
go-version: stable
132145

133146
- name: Create/Update Draft
134-
uses: lucacome/draft-release@e076259ceb036bc5f2c2a76559784c12cf8d2e74 # v1.0.4
147+
uses: lucacome/draft-release@8a63d32c79a171ae6048e614a8988f0ac3ed56d4 # v1.1.0
135148
with:
136149
minor-label: "enhancement"
137150
major-label: "change"
@@ -211,7 +224,7 @@ jobs:
211224
fail-fast: false
212225
matrix:
213226
image: [nginx, plus]
214-
k8s-version: ["${{ needs.vars.outputs.min_k8s_version }}", "latest"]
227+
k8s-version: ["${{ needs.vars.outputs.min_k8s_version }}", "${{ needs.vars.outputs.k8s_latest }}"]
215228
uses: ./.github/workflows/functional.yml
216229
with:
217230
image: ${{ matrix.image }}
@@ -226,7 +239,7 @@ jobs:
226239
fail-fast: false
227240
matrix:
228241
image: [nginx, plus]
229-
k8s-version: ["${{ needs.vars.outputs.min_k8s_version }}", "latest"]
242+
k8s-version: ["${{ needs.vars.outputs.min_k8s_version }}", "${{ needs.vars.outputs.k8s_latest }}"]
230243
enable-experimental: [true, false]
231244
uses: ./.github/workflows/conformance.yml
232245
with:
@@ -238,96 +251,18 @@ jobs:
238251

239252
helm-tests:
240253
name: Helm Tests
241-
runs-on: ubuntu-22.04
242-
needs: [vars, build-oss]
243-
steps:
244-
- name: Checkout Repository
245-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
246-
247-
- name: Fetch Cached Artifacts
248-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
249-
with:
250-
path: ${{ github.workspace }}/dist
251-
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
252-
253-
- name: Docker Buildx
254-
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
255-
256-
- name: NGF Docker meta
257-
id: ngf-meta
258-
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
259-
with:
260-
images: |
261-
name=ghcr.io/nginxinc/nginx-gateway-fabric
262-
tags: |
263-
type=semver,pattern={{version}}
264-
type=edge
265-
type=ref,event=pr
266-
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
267-
268-
- name: NGINX Docker meta
269-
id: nginx-meta
270-
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
271-
with:
272-
images: |
273-
name=ghcr.io/nginxinc/nginx-gateway-fabric/nginx
274-
tags: |
275-
type=semver,pattern={{version}}
276-
type=edge
277-
type=ref,event=pr
278-
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
279-
280-
- name: Build NGF Docker Image
281-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
282-
with:
283-
file: build/Dockerfile
284-
tags: ${{ steps.ngf-meta.outputs.tags }}
285-
context: "."
286-
target: goreleaser
287-
load: true
288-
cache-from: type=gha,scope=ngf
289-
pull: true
290-
291-
- name: Build NGINX Docker Image
292-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
293-
with:
294-
file: build/Dockerfile.nginx
295-
tags: ${{ steps.nginx-meta.outputs.tags }}
296-
context: "."
297-
load: true
298-
cache-from: type=gha,scope=nginx
299-
pull: true
300-
build-args: |
301-
NJS_DIR=internal/mode/static/nginx/modules/src
302-
NGINX_CONF_DIR=internal/mode/static/nginx/conf
303-
BUILD_AGENT=gha
304-
305-
- name: Deploy Kubernetes
306-
id: k8s
307-
run: |
308-
kube_config=${{ github.workspace }}/kube-${{ github.run_id }}-helm
309-
make create-kind-cluster KIND_KUBE_CONFIG=${kube_config}
310-
echo "KUBECONFIG=${kube_config}" >> "$GITHUB_ENV"
311-
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 }}
312-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
313-
314-
- name: Install Chart
315-
run: >
316-
helm install
317-
helm-$(echo ${{ steps.ngf-meta.outputs.version }} | tr '.' '-')
318-
.
319-
--wait
320-
--create-namespace
321-
--set nginxGateway.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric
322-
--set nginxGateway.image.tag=${{ steps.ngf-meta.outputs.version }}
323-
--set nginxGateway.image.pullPolicy=Never
324-
--set nginxGateway.productTelemetry.enable=false
325-
--set nginx.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric/nginx
326-
--set nginx.image.tag=${{ steps.nginx-meta.outputs.version }}
327-
--set nginx.image.pullPolicy=Never
328-
--set service.type=NodePort
329-
-n nginx-gateway
330-
working-directory: ${{ github.workspace }}/charts/nginx-gateway-fabric
254+
needs: [vars, build-oss, build-plus]
255+
strategy:
256+
fail-fast: false
257+
matrix:
258+
image: [nginx, plus]
259+
k8s-version: ["${{ needs.vars.outputs.min_k8s_version }}", "${{ needs.vars.outputs.k8s_latest }}"]
260+
uses: ./.github/workflows/helm.yml
261+
with:
262+
image: ${{ matrix.image }}
263+
k8s-version: ${{ matrix.k8s-version }}
264+
secrets: inherit
265+
if: ${{ needs.vars.outputs.helm_changes == 'true' || github.event_name == 'schedule' }}
331266

332267
publish-helm:
333268
name: Package and Publish Helm Chart
@@ -342,7 +277,7 @@ jobs:
342277
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
343278

344279
- name: Login to GitHub Container Registry
345-
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
280+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
346281
with:
347282
registry: ghcr.io
348283
username: ${{ github.repository_owner }}

.github/workflows/codeql-analysis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
47+
uses: github/codeql-action/init@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -63,7 +63,7 @@ jobs:
6363
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
6464
# If this step fails, then you should remove it and run the build manually (see below)
6565
- name: Autobuild
66-
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
66+
uses: github/codeql-action/autobuild@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
6767

6868
# ℹ️ Command-line programs to run using the OS shell.
6969
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -76,6 +76,6 @@ jobs:
7676
# ./location_of_script_within_repo/buildscript.sh
7777

7878
- name: Perform CodeQL Analysis
79-
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
79+
uses: github/codeql-action/analyze@f079b8493333aace61c81488f8bd40919487bd9f # v3.25.7
8080
with:
8181
category: "/language:${{matrix.language}}"

.github/workflows/conformance.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,22 @@ jobs:
129129
- name: Deploy Kubernetes
130130
id: k8s
131131
run: |
132-
k8s_version=${{ inputs.k8s-version }}
133-
make create-kind-cluster KIND_KUBE_CONFIG=${{ github.workspace }}/kube-${{ github.run_id }} ${{ ! contains(inputs.k8s-version, 'latest') && 'KIND_IMAGE=kindest/node:v${k8s_version}' || '' }}
134-
echo "KUBECONFIG=${{ github.workspace }}/kube-${{ github.run_id }}" >> "$GITHUB_ENV"
135-
working-directory: ./tests
132+
kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }}
133+
kind load docker-image ${{ join(fromJSON(steps.ngf-meta.outputs.json).tags, ' ') }} ${{ join(fromJSON(steps.nginx-meta.outputs.json).tags, ' ') }} --name ${{ github.run_id }}
136134
137135
- name: Setup conformance tests
138136
run: |
139137
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
140138
ngf_tag=${{ steps.ngf-meta.outputs.version }}
141139
if [ ${{ github.event_name }} == "schedule" ]; then export GW_API_VERSION=main; fi
142140
if [ ${{ inputs.enable-experimental }} == "true" ]; then export ENABLE_EXPERIMENTAL=true; fi
143-
make install-ngf-local-no-build${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
141+
make helm-install-local${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
142+
make deploy-updated-provisioner PREFIX=${ngf_prefix} TAG=${ngf_tag}
144143
working-directory: ./tests
145144

146145
- name: Run conformance tests
147146
run: |
148-
make run-conformance-tests CONFORMANCE_TAG=${{ github.sha }} NGF_VERSION=${{ github.ref_name }}
147+
make run-conformance-tests CONFORMANCE_TAG=${{ github.sha }} NGF_VERSION=${{ github.ref_name }} CLUSTER_NAME=${{ github.run_id }}
149148
core_result=$(cat conformance-profile.yaml | yq '.profiles[0].core.result')
150149
extended_result=$(cat conformance-profile.yaml | yq '.profiles[0].extended.result')
151150
if [ "${core_result}" == "failure" ] || [ "${extended_result}" == "failure" ]; then echo "Conformance test failed, see above for details." && exit 2; fi

.github/workflows/functional.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,19 @@ jobs:
101101
- name: Deploy Kubernetes
102102
id: k8s
103103
run: |
104-
k8s_version=${{ inputs.k8s-version }}
105-
make create-kind-cluster KIND_KUBE_CONFIG=${{ github.workspace }}/kube-${{ github.run_id }} ${{ ! contains(inputs.k8s-version, 'latest') && 'KIND_IMAGE=kindest/node:v${k8s_version}' || '' }}
106-
echo "KUBECONFIG=${{ github.workspace }}/kube-${{ github.run_id }}" >> "$GITHUB_ENV"
104+
kind create cluster --name ${{ github.run_id }} --image=kindest/node:${{ inputs.k8s-version }}
105+
kind load docker-image ${{ join(fromJSON(steps.ngf-meta.outputs.json).tags, ' ') }} ${{ join(fromJSON(steps.nginx-meta.outputs.json).tags, ' ') }} --name ${{ github.run_id }}
107106
108-
- name: Setup functional tests
109-
id: setup
107+
- name: Run functional telemetry tests
110108
run: |
111109
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
112110
ngf_tag=${{ steps.ngf-meta.outputs.version }}
113-
make load-images${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
111+
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=telemetry
114112
working-directory: ./tests
115113

116-
- name: Run functional telemetry tests
114+
- name: Run functional tests
117115
run: |
118116
ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric
119117
ngf_tag=${{ steps.ngf-meta.outputs.version }}
120-
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=telemetry
118+
make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
121119
working-directory: ./tests

0 commit comments

Comments
 (0)