Skip to content

Commit a29c943

Browse files
authored
Merge branch 'main' into patch-2
Signed-off-by: Mateusz <[email protected]>
2 parents ed09f1b + 95ce73e commit a29c943

File tree

63 files changed

+4364
-65
lines changed

Some content is hidden

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

63 files changed

+4364
-65
lines changed

.github/data/matrix-smoke-oss.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
"label": "policies 1/2",
4040
"image": "alpine",
4141
"type": "oss",
42-
"marker": "'policies and not policies_rl and not policies_ac and not policies_jwt and not policies_mtls'",
42+
"marker": "'policies and not policies_rl and not policies_ac and not policies_jwt and not policies_mtls and not policies_cache'",
4343
"platforms": "linux/arm64, linux/amd64"
4444
},
4545
{
4646
"label": "policies 2/2",
4747
"image": "alpine",
4848
"type": "oss",
49-
"marker": "'policies_rl or policies_ac or policies_jwt or policies_mtls or otel'",
49+
"marker": "'policies_rl or policies_ac or policies_jwt or policies_mtls or policies_cache or otel'",
5050
"platforms": "linux/arm64, linux/amd64"
5151
},
5252
{

.github/data/matrix-smoke-plus.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"label": "policies 1/3",
6868
"image": "ubi-9-plus",
6969
"type": "plus",
70-
"marker": "'policies and not policies_ac and not policies_jwt and not policies_mtls and not policies_rl'",
70+
"marker": "'policies and not policies_ac and not policies_jwt and not policies_mtls and not policies_rl and not policies_cache'",
7171
"platforms": "linux/arm64, linux/amd64"
7272
},
7373
{
@@ -81,7 +81,7 @@
8181
"label": "policies 3/3",
8282
"image": "ubi-9-plus",
8383
"type": "plus",
84-
"marker": "policies_rl",
84+
"marker": "'policies_rl or policies_cache'",
8585
"platforms": "linux/arm64, linux/amd64"
8686
},
8787
{

.github/scripts/variables.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ get_tests_md5() {
2626
}
2727

2828
get_chart_md5() {
29-
find charts .github/data/version.txt -type f -exec md5sum {} + | LC_ALL=C sort | md5sum | awk '{ print $1 }'
29+
find charts .github/data/version.txt config/crd/bases -type f -exec md5sum {} + | LC_ALL=C sort | md5sum | awk '{ print $1 }'
3030
}
3131

3232
get_actions_md5() {
@@ -49,6 +49,15 @@ get_stable_tag() {
4949
echo "$(get_build_tag) $(get_tests_md5) $(get_chart_md5) $(get_actions_md5)" | md5sum | awk '{ print $1 }'
5050
}
5151

52+
get_additional_tag() {
53+
if [[ ${REF} =~ /merge$ ]]; then
54+
pr=${REF%*/merge}
55+
echo "pr-${pr##*/}"
56+
else
57+
echo "${REF//\//-}"
58+
fi
59+
}
60+
5261
case $INPUT in
5362
docker_md5)
5463
echo "docker_md5=$(get_docker_md5)"
@@ -66,6 +75,10 @@ case $INPUT in
6675
echo "stable_tag=s-$(get_stable_tag)"
6776
;;
6877

78+
additional_tag)
79+
echo "additional_tag=$(get_additional_tag)"
80+
;;
81+
6982
*)
7083
echo "ERROR: option not found"
7184
exit 2

.github/workflows/ci.yml

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
image_matrix_oss: ${{ steps.vars.outputs.image_matrix_oss }}
5757
image_matrix_plus: ${{ steps.vars.outputs.image_matrix_plus }}
5858
image_matrix_nap: ${{ steps.vars.outputs.image_matrix_nap }}
59+
docker_build: ${{ steps.docker_build.outputs.docker_build }}
5960
steps:
6061
- name: Checkout Repository
6162
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -83,7 +84,7 @@ jobs:
8384
with:
8485
go-version-file: go.mod
8586

86-
- name: Output Variables
87+
- name: Configure pipeline Variables
8788
id: vars
8889
run: |
8990
kindest_latest=$(curl -s "https://hub.docker.com/v2/repositories/kindest/node/tags" \
@@ -110,13 +111,7 @@ jobs:
110111
./.github/scripts/variables.sh docker_md5 >> $GITHUB_OUTPUT
111112
./.github/scripts/variables.sh build_tag >> $GITHUB_OUTPUT
112113
./.github/scripts/variables.sh stable_tag >> $GITHUB_OUTPUT
113-
ref=${{ github.ref_name }}
114-
if [[ $ref =~ merge ]]; then
115-
additional_tag="pr-${ref%*/merge}"
116-
else
117-
additional_tag="${ref//\//-}"
118-
fi
119-
echo "additional_tag=${additional_tag}" >> $GITHUB_OUTPUT
114+
REF=${{ github.ref_name }} ./.github/scripts/variables.sh additional_tag >> $GITHUB_OUTPUT
120115
echo "image_matrix_oss=$(cat .github/data/matrix-images-oss.json | jq -c)" >> $GITHUB_OUTPUT
121116
echo "image_matrix_plus=$(cat .github/data/matrix-images-plus.json | jq -c)" >> $GITHUB_OUTPUT
122117
echo "image_matrix_nap=$(cat .github/data/matrix-images-nap.json | jq -c)" >> $GITHUB_OUTPUT
@@ -150,11 +145,26 @@ jobs:
150145
- name: Check if stable image exists
151146
id: stable_exists
152147
run: |
148+
exists=false
153149
if docker pull gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:${{ steps.vars.outputs.stable_tag }}; then
154-
echo "exists=true" >> $GITHUB_OUTPUT
150+
exists=true
155151
fi
152+
echo "exists=${exists}" >> $GITHUB_OUTPUT
156153
if: ${{ steps.vars.outputs.forked_workflow == 'false' }}
157154

155+
- name: Check if docker build is needed
156+
id: docker_build
157+
run: |
158+
docker_build="false"
159+
if [ "${{ inputs.force }}" = "true" ]; then
160+
docker_build="true"
161+
elif [ "$forked_workflow" = "true" ] && [ "${{ steps.docs.outputs.docs_only }}" = "false" ]; then
162+
docker_build="true"
163+
elif [ "$forked_workflow" = "false" ] && [ "${{ steps.docs.outputs.docs_only }}" = "false" ] && [ "${{ steps.stable_exists.outputs.exists }}" = "false" ]; then
164+
docker_build="true"
165+
fi
166+
echo "docker_build=${docker_build}" >> $GITHUB_OUTPUT
167+
158168
- name: Output variables
159169
run: |
160170
echo docs_only: ${{ github.event.pull_request && steps.docs.outputs.docs_only == 'true' }}
@@ -173,6 +183,7 @@ jobs:
173183
echo 'image_matrix_oss: ${{ steps.vars.outputs.image_matrix_oss }}'
174184
echo 'image_matrix_plus: ${{ steps.vars.outputs.image_matrix_plus }}'
175185
echo 'image_matrix_nap: ${{ steps.vars.outputs.image_matrix_nap }}'
186+
echo 'docker_build: ${{ steps.docker_build.outputs.docker_build }}'
176187
177188
verify-codegen:
178189
name: Verify generated code
@@ -200,7 +211,7 @@ jobs:
200211
password ${{ secrets.ARTIFACTORY_TOKEN }}
201212
EOF
202213
chmod 600 $HOME/.netrc
203-
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
214+
if: ${{ inputs.force || (needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true') }}
204215

205216
- name: Check if go.mod and go.sum are up to date
206217
run: go mod tidy && git diff --exit-code -- go.mod go.sum
@@ -251,7 +262,7 @@ jobs:
251262
password ${{ secrets.ARTIFACTORY_TOKEN }}
252263
EOF
253264
chmod 600 $HOME/.netrc
254-
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
265+
if: ${{ inputs.force || (needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true') }}
255266

256267
- name: Run Tests
257268
run: make cover
@@ -289,7 +300,7 @@ jobs:
289300
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
290301
with:
291302
go-version-file: go.mod
292-
if: ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
303+
if: ${{ inputs.force || needs.checks.outputs.binary_cache_hit != 'true' }}
293304

294305
- name: Setup netrc
295306
run: |
@@ -299,7 +310,7 @@ jobs:
299310
password ${{ secrets.ARTIFACTORY_TOKEN }}
300311
EOF
301312
chmod 600 $HOME/.netrc
302-
if: ${{ needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true' }}
313+
if: ${{ inputs.force || (needs.checks.outputs.binary_cache_hit != 'true' && needs.checks.outputs.forked_workflow != 'true') }}
303314

304315
- name: Build binaries
305316
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
@@ -319,14 +330,14 @@ jobs:
319330
AWS_NAP_WAF_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_WAF_DOS_PRODUCT_CODE }}
320331
AWS_NAP_WAF_DOS_PUB_KEY: ${{ secrets.AWS_NAP_WAF_DOS_PUB_KEY }}
321332
GORELEASER_CURRENT_TAG: "v${{ needs.checks.outputs.ic_version }}"
322-
if: ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
333+
if: ${{ inputs.force || needs.checks.outputs.binary_cache_hit != 'true' }}
323334

324335
- name: Store Artifacts in Cache
325336
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
326337
with:
327338
path: ${{ github.workspace }}/dist
328339
key: nginx-ingress-${{ needs.checks.outputs.go_code_md5 }}
329-
if: ${{ (inputs.force && inputs.force || false) || needs.checks.outputs.binary_cache_hit != 'true' }}
340+
if: ${{ inputs.force || needs.checks.outputs.binary_cache_hit != 'true' }}
330341

331342
build-docker:
332343
name: Build Docker OSS
@@ -341,7 +352,7 @@ jobs:
341352
go-md5: ${{ needs.checks.outputs.go_code_md5 }}
342353
base-image-md5: ${{ needs.checks.outputs.docker_md5 }}
343354
authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }}
344-
full-build: ${{ inputs.force && inputs.force || false }}
355+
full-build: ${{ inputs.force }}
345356
tag: ${{ needs.checks.outputs.build_tag }}
346357
branch: ${{ (github.head_ref && needs.checks.outputs.forked_workflow != 'true') && github.head_ref || github.ref }}
347358
ic-version: ${{ needs.checks.outputs.ic_version }}
@@ -352,7 +363,7 @@ jobs:
352363
packages: write
353364
pull-requests: write # for scout report
354365
secrets: inherit
355-
if: ${{ inputs.force || (needs.checks.outputs.forked_workflow == 'true' && needs.checks.outputs.docs_only == 'false') || (needs.checks.outputs.forked_workflow == 'false' && needs.checks.outputs.stable_image_exists != 'true' && needs.checks.outputs.docs_only == 'false') }}
366+
if: ${{ needs.checks.outputs.docker_build == 'true' }}
356367

357368
build-docker-plus:
358369
name: Build Docker Plus
@@ -370,14 +381,14 @@ jobs:
370381
branch: ${{ (github.head_ref && needs.checks.outputs.forked_workflow != 'true') && github.head_ref || github.ref }}
371382
tag: ${{ needs.checks.outputs.build_tag }}
372383
authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }}
373-
full-build: ${{ inputs.force && inputs.force || false }}
384+
full-build: ${{ inputs.force }}
374385
ic-version: ${{ needs.checks.outputs.ic_version }}
375386
permissions:
376387
contents: read
377388
id-token: write
378389
pull-requests: write # for scout report
379390
secrets: inherit
380-
if: ${{ inputs.force || (needs.checks.outputs.forked_workflow == 'true' && needs.checks.outputs.docs_only == 'false') || (needs.checks.outputs.forked_workflow == 'false' && needs.checks.outputs.stable_image_exists != 'true' && needs.checks.outputs.docs_only == 'false') }}
391+
if: ${{ needs.checks.outputs.docker_build == 'true' }}
381392

382393
build-docker-nap:
383394
name: Build Docker NAP
@@ -396,14 +407,14 @@ jobs:
396407
tag: ${{ needs.checks.outputs.build_tag }}
397408
nap-modules: ${{ matrix.nap_modules }}
398409
authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }}
399-
full-build: ${{ inputs.force && inputs.force || false }}
410+
full-build: ${{ inputs.force }}
400411
ic-version: ${{ needs.checks.outputs.ic_version }}
401412
permissions:
402413
contents: read
403414
id-token: write # gcr login
404415
pull-requests: write # for scout report
405416
secrets: inherit
406-
if: ${{ inputs.force || (needs.checks.outputs.forked_workflow == 'true' && needs.checks.outputs.docs_only == 'false') || (needs.checks.outputs.forked_workflow == 'false' && needs.checks.outputs.stable_image_exists != 'true' && needs.checks.outputs.docs_only == 'false') }}
417+
if: ${{ needs.checks.outputs.docker_build == 'true' }}
407418

408419
tag-target:
409420
name: Tag untested image with PR number
@@ -706,6 +717,7 @@ jobs:
706717
stable-tag: ${{ needs.checks.outputs.stable_tag }}
707718
authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }}
708719
k8s-version: ${{ matrix.k8s }}
720+
force: ${{ inputs.run_tests }}
709721

710722
smoke-tests-plus:
711723
if: ${{ inputs.force || (inputs.run_tests && inputs.run_tests || true) || needs.checks.outputs.docs_only != 'true' }}
@@ -733,6 +745,7 @@ jobs:
733745
stable-tag: ${{ needs.checks.outputs.stable_tag }}
734746
authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }}
735747
k8s-version: ${{ matrix.k8s }}
748+
force: ${{ inputs.run_tests }}
736749

737750
smoke-tests-nap:
738751
if: ${{ inputs.force || (inputs.run_tests && inputs.run_tests || true) || needs.checks.outputs.docs_only != 'true' }}
@@ -760,6 +773,7 @@ jobs:
760773
stable-tag: ${{ needs.checks.outputs.stable_tag }}
761774
authenticated: ${{ needs.checks.outputs.forked_workflow != 'true' }}
762775
k8s-version: ${{ matrix.k8s }}
776+
force: ${{ inputs.run_tests }}
763777

764778
tag-stable:
765779
name: Tag tested image as stable
@@ -835,4 +849,4 @@ jobs:
835849
pull-requests: write # for scout report
836850
uses: ./.github/workflows/image-promotion.yml
837851
secrets: inherit
838-
if: ${{ inputs.force && inputs.force || false }}
852+
if: ${{ inputs.force }}

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525

2626
- name: "Dependency Review"
27-
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
27+
uses: actions/dependency-review-action@bc41886e18ea39df68b1b1245f4184881938e050 # v4.7.2
2828
with:
2929
config-file: "nginx/k8s-common/dependency-review-config.yml@main"
3030
base-ref: ${{ github.event.pull_request.base.sha || github.event.repository.default_branch }}

.github/workflows/image-promotion.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
image_matrix_oss: ${{ steps.vars.outputs.image_matrix_oss }}
4848
image_matrix_plus: ${{ steps.vars.outputs.image_matrix_plus }}
4949
image_matrix_nap: ${{ steps.vars.outputs.image_matrix_nap }}
50+
additional_tag: ${{ steps.vars.outputs.additional_tag }}
5051
steps:
5152
- name: Checkout Repository
5253
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -71,6 +72,7 @@ jobs:
7172
echo "image_matrix_oss=$(cat .github/data/matrix-images-oss.json | jq -c)" >> $GITHUB_OUTPUT
7273
echo "image_matrix_plus=$(cat .github/data/matrix-images-plus.json | jq -c)" >> $GITHUB_OUTPUT
7374
echo "image_matrix_nap=$(cat .github/data/matrix-images-nap.json | jq -c)" >> $GITHUB_OUTPUT
75+
REF=${{ github.ref_name }} ./.github/scripts/variables.sh additional_tag >> $GITHUB_OUTPUT
7476
7577
- name: Fetch Cached Binary Artifacts
7678
id: binary-cache
@@ -158,7 +160,7 @@ jobs:
158160
fi
159161
160162
- name: Upload SARIF file
161-
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
163+
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
162164
if: steps.check-sarif.outputs.sarif_has_results == 'true'
163165
with:
164166
sarif_file: govulncheck.sarif
@@ -328,7 +330,7 @@ jobs:
328330
uses: ./.github/workflows/retag-images.yml
329331
with:
330332
source_tag: ${{ needs.checks.outputs.stable_tag }}
331-
target_tag: ${{ github.ref_name == github.event.repository.default_branch && 'edge' || github.ref_name }}
333+
target_tag: ${{ github.ref_name == github.event.repository.default_branch && 'edge' || needs.checks.outputs.additional_tag }}
332334
dry_run: false
333335
secrets: inherit
334336
if: ${{ !cancelled() && !failure() }}
@@ -494,7 +496,7 @@ jobs:
494496
overwrite: true
495497

496498
- name: Upload Scan results to GitHub Security tab
497-
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
499+
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
498500
with:
499501
sarif_file: "${{ steps.directory.outputs.directory }}/"
500502

@@ -583,7 +585,7 @@ jobs:
583585
overwrite: true
584586

585587
- name: Upload Scan results to GitHub Security tab
586-
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
588+
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
587589
with:
588590
sarif_file: "${{ steps.directory.outputs.directory }}/"
589591

@@ -679,7 +681,7 @@ jobs:
679681
overwrite: true
680682

681683
- name: Upload Scan results to GitHub Security tab
682-
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
684+
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
683685
with:
684686
sarif_file: "${{ steps.directory.outputs.directory }}/"
685687
continue-on-error: true

.github/workflows/lint-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Checkout Repository
6464
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6565

66-
- uses: reviewdog/action-actionlint@50b75b9513baa71e6a1899a1ebaa9ac9851cf16c # v1.66.0
66+
- uses: reviewdog/action-actionlint@e37e2ca68a70112d21e135229272da28ce2d0d5a # v1.66.1
6767
with:
6868
actionlint_flags: -shellcheck ""
6969

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ jobs:
5757

5858
# Upload the results to GitHub's code scanning dashboard.
5959
- name: "Upload to code-scanning"
60-
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
60+
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
6161
with:
6262
sarif_file: results.sarif

.github/workflows/setup-smoke.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ on:
3333
k8s-version:
3434
required: true
3535
type: string
36+
force:
37+
required: true
38+
type: boolean
3639

3740
defaults:
3841
run:
@@ -81,6 +84,9 @@ jobs:
8184
if docker pull ${{ steps.image_details.outputs.name }}:${{ steps.image_details.outputs.stable_tag }}; then
8285
echo "exists=true" >> $GITHUB_OUTPUT
8386
fi
87+
if [ "${{ inputs.force }}" = "true" ]; then
88+
echo "exists=false" >> $GITHUB_OUTPUT
89+
fi
8490
if: ${{ inputs.authenticated }}
8591

8692
- name: NAP modules
@@ -103,15 +109,15 @@ jobs:
103109
fail-on-cache-miss: true
104110
if: ${{ !inputs.authenticated }}
105111

106-
- name: Check if test image exists
112+
- name: Check if pytest image exists
107113
id: check-image
108114
run: |
109115
docker manifest inspect "gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/test-runner:${{ hashFiles('./tests/requirements.txt', './tests/Dockerfile') || 'latest' }}"
110116
shell: bash
111117
continue-on-error: true
112118
if: ${{ inputs.authenticated }}
113119

114-
- name: Build Test-Runner Container
120+
- name: Build Pytest-Runner Container
115121
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
116122
with:
117123
file: tests/Dockerfile

0 commit comments

Comments
 (0)