Skip to content

Commit 58eeb65

Browse files
committed
Merge branch 'feat/openshift-support' into chore/module-dir
2 parents ada0c8e + 9a4d4f7 commit 58eeb65

File tree

96 files changed

+928
-646
lines changed

Some content is hidden

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

96 files changed

+928
-646
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
ref: ${{ (inputs.tag != '' && !inputs.dry_run ) && format('refs/tags/v{0}', inputs.tag) || github.ref }}
5454

5555
- name: Fetch Cached Artifacts
56-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
56+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
5757
with:
5858
path: ${{ github.workspace }}/dist
5959
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
@@ -69,7 +69,7 @@ jobs:
6969
platforms: arm64
7070

7171
- name: Login to GitHub Container Registry
72-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
72+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
7373
if: ${{ github.event_name != 'pull_request' && ! contains(inputs.image, 'plus') }}
7474
with:
7575
registry: ghcr.io
@@ -86,7 +86,7 @@ jobs:
8686
if: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus')}}
8787

8888
- name: Login to NGINX Registry
89-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
89+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
9090
with:
9191
registry: docker-mgmt.nginx.com
9292
username: ${{ steps.idtoken.outputs.id_token }}
@@ -103,7 +103,7 @@ jobs:
103103
if: ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus') }}
104104

105105
- name: Login to GAR
106-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
106+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
107107
with:
108108
registry: us-docker.pkg.dev
109109
username: oauth2accesstoken
@@ -186,7 +186,7 @@ jobs:
186186
fail-build: false
187187

188188
- name: Upload scan result to GitHub Security tab
189-
uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
189+
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
190190
if: ${{ !inputs.dry_run }}
191191
continue-on-error: true
192192
with:

.github/workflows/ci.yml

Lines changed: 135 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }}
4646
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
4747
helm_changes: ${{ steps.filter.outputs.charts }}
48-
goproxy: ${{ steps.goproxy.outputs.goproxy }}
4948
steps:
5049
- name: Checkout Repository
5150
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -64,7 +63,6 @@ jobs:
6463
echo "Development mode - using dev Artifactory"
6564
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
6665
fi
67-
echo "goproxy=${GOPROXY_VALUE}" >> $GITHUB_OUTPUT
6866
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
6967
7068
- name: Setup Golang Environment
@@ -105,12 +103,20 @@ jobs:
105103
name: Unit Tests
106104
runs-on: ubuntu-24.04
107105
needs: vars
108-
env:
109-
GOPROXY: ${{ needs.vars.outputs.goproxy }}
110106
steps:
111107
- name: Checkout Repository
112108
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
113109

110+
- name: Configure GOPROXY
111+
id: goproxy
112+
run: |
113+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
114+
GOPROXY_VALUE="direct"
115+
else
116+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
117+
fi
118+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
119+
114120
- name: Setup Golang Environment
115121
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
116122
with:
@@ -159,8 +165,8 @@ jobs:
159165
name: Build Binary
160166
runs-on: ${{ github.repository_owner == 'nginx' && (inputs.is_production_release || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && 'ubuntu-24.04-amd64' || 'ubuntu-24.04' }}
161167
needs: [vars, unit-tests, njs-unit-tests]
162-
env:
163-
GOPROXY: ${{ needs.vars.outputs.goproxy }}
168+
outputs:
169+
json: ${{ steps.gateway_binaries.outputs.json }}
164170
permissions:
165171
contents: write # for goreleaser/goreleaser-action and lucacome/draft-release to create/update releases
166172
id-token: write # for goreleaser/goreleaser-action to sign artifacts
@@ -171,6 +177,21 @@ jobs:
171177
with:
172178
fetch-depth: 0
173179

180+
- name: Configure GOPROXY
181+
id: goproxy
182+
run: |
183+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
184+
echo "No Artifactory secrets available - using direct GOPROXY"
185+
GOPROXY_VALUE="direct"
186+
elif [[ "${{ inputs.is_production_release }}" == "true" ]] || [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
187+
echo "Production mode - using production Artifactory"
188+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_ENDPOINT }}"
189+
else
190+
echo "Development mode - using dev Artifactory"
191+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
192+
fi
193+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
194+
174195
- name: Setup Golang Environment
175196
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
176197
with:
@@ -208,7 +229,7 @@ jobs:
208229
- name: Build binary
209230
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
210231
with:
211-
version: v2.12.2 # renovate: datasource=github-tags depName=goreleaser/goreleaser
232+
version: v2.12.4 # renovate: datasource=github-tags depName=goreleaser/goreleaser
212233
args: ${{ (inputs.is_production_release && (inputs.dry_run == false || inputs.dry_run == null)) && 'release' || 'build --snapshot' }} --clean
213234
env:
214235
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -220,12 +241,107 @@ jobs:
220241
TELEMETRY_ENDPOINT: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-') && 'oss-dev.edge.df.f5.com:443' || 'oss.edge.df.f5.com:443' }}
221242
TELEMETRY_ENDPOINT_INSECURE: "false"
222243

244+
- name: Extract gateway binaries info
245+
id: gateway_binaries
246+
run: |
247+
set -e
248+
binaries=()
249+
for bin in $(find ${{ github.workspace }}/dist -type f -name "gateway"); do
250+
dir=$(basename $(dirname "$bin"))
251+
if [[ "$dir" =~ gateway_([a-zA-Z0-9]+)_([a-zA-Z0-9]+) ]]; then
252+
os="${BASH_REMATCH[1]}"
253+
arch="${BASH_REMATCH[2]}"
254+
digest=$(sha256sum "$bin" | cut -d' ' -f1)
255+
binaries+=("{\"path\":\"$bin\",\"os\":\"$os\",\"arch\":\"$arch\",\"digest\":\"$digest\"}")
256+
fi
257+
done
258+
# Join array elements with commas
259+
IFS=','
260+
json="[${binaries[*]}]"
261+
echo "Generated JSON: $json"
262+
echo "json=$json" >> $GITHUB_OUTPUT
263+
223264
- name: Cache Artifacts
224-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
265+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
266+
with:
267+
path: ${{ github.workspace }}/dist
268+
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
269+
270+
assertion:
271+
name: Generate and Sign Assertion Documents
272+
needs: [vars, binary]
273+
if: ${{ inputs.is_production_release }}
274+
permissions:
275+
contents: read
276+
id-token: write # for compliance-rules action to sign assertion doc
277+
runs-on: ubuntu-24.04
278+
strategy:
279+
fail-fast: false
280+
matrix:
281+
gateway: ${{ fromJson(needs.binary.outputs.json) }}
282+
steps:
283+
- name: Checkout Repository
284+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
285+
286+
- name: Configure GOPROXY
287+
id: goproxy
288+
run: |
289+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
290+
echo "No Artifactory secrets available - using direct GOPROXY"
291+
GOPROXY_VALUE="direct"
292+
elif [[ "${{ inputs.is_production_release }}" == "true" ]] || [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
293+
echo "Production mode - using production Artifactory"
294+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_ENDPOINT }}"
295+
else
296+
echo "Development mode - using dev Artifactory"
297+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
298+
fi
299+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
300+
301+
- name: Setup Golang Environment
302+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
303+
with:
304+
go-version: stable
305+
306+
- name: Fetch Cached Artifacts
307+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
225308
with:
226309
path: ${{ github.workspace }}/dist
227310
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}
228311

312+
- name: List Dependencies in Go Binary
313+
id: godeps
314+
run: |
315+
go version -m dist/gateway_${{ matrix.gateway.os }}_${{ matrix.gateway.arch }}*/gateway > goversionm_${{ github.run_id }}_${{ github.run_number }}_${{ matrix.gateway.os }}_${{ matrix.gateway.arch }}.txt
316+
echo "goversionm=$(find -type f -name "goversionm*.txt" | head -n 1)" >> $GITHUB_OUTPUT
317+
goversionm=$(find -type f -name "goversionm*.txt" | head -n 1)
318+
cat $goversionm
319+
320+
- name: Generate Assertion Document
321+
id: assertiondoc
322+
uses: nginxinc/compliance-rules/.github/actions/assertion@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6
323+
with:
324+
artifact-name: ${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_number }}_${{ matrix.gateway.os }}_${{ matrix.gateway.arch }}
325+
artifact-digest: ${{ matrix.gateway.digest }}
326+
build-type: 'github'
327+
builder-id: 'github.com'
328+
builder-version: '0.1.0-xyz'
329+
invocation-id: ${{ github.run_id }}.${{ github.run_number }}.${{ strategy.job-index }}
330+
started-on: ${{ github.event.head_commit.timestamp || github.event.created_at }}
331+
finished-on: ${{ github.event.head_commit.timestamp || github.event.created_at }}
332+
artifactory-user: ${{ secrets.ARTIFACTORY_USER }}
333+
artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }}
334+
artifactory-url: ${{ secrets.ARTIFACTORY_URL }}
335+
artifactory-repo: 'f5-nginx-go-local-approved-dependency'
336+
build-content-path: ${{ steps.godeps.outputs.goversionm }}
337+
assertion-doc-file: assertion_${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_id }}_${{ github.run_number }}_${{ matrix.gateway.os }}_${{ matrix.gateway.arch }}.json
338+
339+
- name: Sign and Store Assertion Document
340+
id: sign
341+
uses: nginxinc/compliance-rules/.github/actions/sign@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6
342+
with:
343+
assertion-doc: ${{ steps.assertiondoc.outputs.assertion-document-path }}
344+
229345
build-oss:
230346
name: Build OSS images
231347
needs: [vars, binary]
@@ -352,7 +468,7 @@ jobs:
352468
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
353469

354470
- name: Login to GitHub Container Registry
355-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
471+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
356472
with:
357473
registry: ghcr.io
358474
username: ${{ github.repository_owner }}
@@ -373,12 +489,20 @@ jobs:
373489
name: CEL Tests
374490
runs-on: ubuntu-24.04
375491
needs: vars
376-
env:
377-
GOPROXY: ${{ needs.vars.outputs.goproxy }}
378492
steps:
379493
- name: Checkout Repository
380494
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
381495

496+
- name: Configure GOPROXY
497+
id: goproxy
498+
run: |
499+
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
500+
GOPROXY_VALUE="direct"
501+
else
502+
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
503+
fi
504+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
505+
382506
- name: Setup Golang Environment
383507
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
384508
with:

.github/workflows/conformance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- name: Build binary
104104
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
105105
with:
106-
version: v2.12.2 # renovate: datasource=github-tags depName=goreleaser/goreleaser
106+
version: v2.12.4 # renovate: datasource=github-tags depName=goreleaser/goreleaser
107107
args: build --single-target --snapshot --clean
108108
env:
109109
TELEMETRY_ENDPOINT: "" # disables sending telemetry

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1616

1717
- name: "Dependency Review"
18-
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
18+
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
1919
with:
2020
config-file: "nginx/k8s-common/dependency-review-config.yml@main"

.github/workflows/functional.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ jobs:
8787
- name: Build binary
8888
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
8989
with:
90+
<<<<<<< HEAD
9091
version: v2.12.3 # renovate: datasource=github-tags depName=goreleaser/goreleaser
92+
=======
93+
version: v2.12.4 # renovate: datasource=github-tags depName=goreleaser/goreleaser
94+
>>>>>>> feat/openshift-support
9195
args: build --single-target --snapshot --clean
9296
env:
9397
TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317

.github/workflows/helm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
fetch-depth: 0
2626

2727
- name: Fetch Cached Artifacts
28-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
28+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
2929
with:
3030
path: ${{ github.workspace }}/dist
3131
key: nginx-gateway-fabric-${{ github.run_id }}-${{ github.run_number }}

.github/workflows/nfr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
9494

9595
- name: Login to GAR
96-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
96+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
9797
with:
9898
registry: us-docker.pkg.dev
9999
username: oauth2accesstoken

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
persist-credentials: false
3535

3636
- name: "Run analysis"
37-
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
37+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
3838
with:
3939
results_file: results.sarif
4040
results_format: sarif
@@ -60,6 +60,6 @@ jobs:
6060

6161
# Upload the results to GitHub's code scanning dashboard.
6262
- name: "Upload to code-scanning"
63-
uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
63+
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
6464
with:
6565
sarif_file: results.sarif

.github/workflows/update-docker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
needs-updating: ${{ steps.update.outputs.needs-updating }}
6060
steps:
6161
- name: Login to GitHub Container Registry
62-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
62+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
6363
with:
6464
registry: ghcr.io
6565
username: ${{ github.repository_owner }}

0 commit comments

Comments
 (0)