Skip to content

Commit 501833f

Browse files
Merge branch 'main' into optimization-sync-process
2 parents 8128c81 + cb04b22 commit 501833f

File tree

18 files changed

+91
-53
lines changed

18 files changed

+91
-53
lines changed

.github/workflows/chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python-version: 3.x
2929

3030
- name: Set up Helm
31-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
31+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
3232

3333
- name: Set up Helm Chart Testing
3434
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
| gzip > docker.tar.gz
203203
204204
- name: cache
205-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
205+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
206206
with:
207207
name: docker.tar.gz
208208
path: docker.tar.gz
@@ -223,7 +223,7 @@ jobs:
223223
python-version: 3.x
224224

225225
- name: Set up Helm
226-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
226+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
227227

228228
- name: Set up Helm Chart Testing
229229
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0

.github/workflows/scorecards.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
persist-credentials: false
3333

3434
- name: "Run analysis"
35-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
35+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
3636
with:
3737
results_file: results.sarif
3838
results_format: sarif
@@ -51,14 +51,14 @@ jobs:
5151
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
5252
# format to the repository Actions tab.
5353
- name: "Upload artifact"
54-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
54+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
5555
with:
5656
name: SARIF file
5757
path: results.sarif
5858
retention-days: 5
5959

6060
# Upload the results to GitHub's code scanning dashboard.
6161
- name: "Upload to code-scanning"
62-
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
62+
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
6363
with:
6464
sarif_file: results.sarif

.github/workflows/vulnerability-scans.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575

7676
# This step checks out a copy of your repository.
7777
- name: Upload SARIF file
78-
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
78+
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
7979
with:
8080
token: ${{ github.token }}
8181
# Path to SARIF file relative to the root of the repository

.github/workflows/zz-tmpl-k8s-e2e.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
make kind-e2e-test
5050
5151
- name: Upload e2e junit-reports ${{ inputs.variation }}
52-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
52+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
5353
if: success() || failure()
5454
with:
5555
name: e2e-test-reports-${{ inputs.k8s-version }}${{ inputs.variation }}

build/dev-env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ echo "[dev-env] building image"
6464
make build image
6565
docker tag "${REGISTRY}/controller:${TAG}" "${DEV_IMAGE}"
6666

67-
export K8S_VERSION=${K8S_VERSION:-v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027}
67+
export K8S_VERSION=${K8S_VERSION:-v1.32.2@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f}
6868

6969
KIND_CLUSTER_NAME="ingress-nginx-dev"
7070

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ require (
1717
github.com/onsi/ginkgo/v2 v2.22.2
1818
github.com/opencontainers/runc v1.2.5
1919
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
20-
github.com/prometheus/client_golang v1.20.5
20+
github.com/prometheus/client_golang v1.21.0
2121
github.com/prometheus/client_model v0.6.1
2222
github.com/prometheus/common v0.62.0
2323
github.com/spf13/cobra v1.9.1
2424
github.com/spf13/pflag v1.0.6
2525
github.com/stretchr/testify v1.10.0
2626
github.com/yudai/gojsondiff v1.0.0
2727
github.com/zakjan/cert-chain-resolver v0.0.0-20221221105603-fcedb00c5b30
28-
golang.org/x/crypto v0.33.0
28+
golang.org/x/crypto v0.34.0
2929
google.golang.org/grpc v1.70.0
3030
google.golang.org/grpc/examples v0.0.0-20240223204917-5ccf176a08ab
3131
gopkg.in/go-playground/pool.v3 v3.1.1
@@ -47,7 +47,7 @@ require (
4747
require (
4848
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect
4949
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
50-
github.com/klauspost/compress v1.17.9 // indirect
50+
github.com/klauspost/compress v1.17.11 // indirect
5151
github.com/moby/sys/userns v0.1.0 // indirect
5252
github.com/x448/float16 v0.8.4 // indirect
5353
go.opentelemetry.io/otel v1.32.0 // indirect

go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
107107
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
108108
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
109109
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
110-
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
111-
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
110+
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
111+
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
112112
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
113113
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
114114
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -180,8 +180,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
180180
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
181181
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
182182
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
183-
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
184-
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
183+
github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA=
184+
github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
185185
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
186186
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
187187
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
@@ -243,8 +243,8 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
243243
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
244244
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
245245
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
246-
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
247-
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
246+
golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA=
247+
golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
248248
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
249249
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
250250
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=

images/custom-error-pages/rootfs/go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ module k8s.io/ingress-nginx/custom-error-pages
22

33
go 1.23.6
44

5-
require github.com/prometheus/client_golang v1.20.5
5+
require github.com/prometheus/client_golang v1.21.0
66

77
require (
88
github.com/beorn7/perks v1.0.1 // indirect
99
github.com/cespare/xxhash/v2 v2.3.0 // indirect
10-
github.com/klauspost/compress v1.17.9 // indirect
10+
github.com/klauspost/compress v1.17.11 // indirect
1111
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
1212
github.com/prometheus/client_model v0.6.1 // indirect
13-
github.com/prometheus/common v0.55.0 // indirect
13+
github.com/prometheus/common v0.62.0 // indirect
1414
github.com/prometheus/procfs v0.15.1 // indirect
15-
golang.org/x/sys v0.22.0 // indirect
16-
google.golang.org/protobuf v1.34.2 // indirect
15+
golang.org/x/sys v0.28.0 // indirect
16+
google.golang.org/protobuf v1.36.1 // indirect
1717
)

images/custom-error-pages/rootfs/go.sum

+18-10
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
22
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
33
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
44
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
5+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
57
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
68
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
7-
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
8-
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
9+
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
10+
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
911
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
1012
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
1113
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
1214
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
13-
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
14-
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
15+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
16+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
17+
github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA=
18+
github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
1519
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
1620
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
17-
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
18-
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
21+
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
22+
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
1923
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
2024
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
21-
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
22-
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
23-
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
24-
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
25+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
26+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
27+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
28+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
29+
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
30+
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
31+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
32+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

images/nginx/rootfs/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export NGINX_DIGEST_AUTH=v1.0.0
3535
# Check for recent changes: https://github.com/SpiderLabs/ModSecurity-nginx/compare/v1.0.3...master
3636
export MODSECURITY_VERSION=v1.0.3
3737

38-
# Check for recent changes: https://github.com/SpiderLabs/ModSecurity/compare/v3.0.13...v3/master
39-
export MODSECURITY_LIB_VERSION=v3.0.13
38+
# Check for recent changes: https://github.com/SpiderLabs/ModSecurity/compare/v3.0.14...v3/master
39+
export MODSECURITY_LIB_VERSION=v3.0.14
4040

4141
# Check for recent changes: https://github.com/coreruleset/coreruleset/compare/v4.10.0...main
4242
export OWASP_MODSECURITY_CRS_VERSION=v4.10.0

internal/ingress/controller/config/config.go

-2
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,10 @@ type Configuration struct {
9797
// AllowCrossNamespaceResources enables users to consume cross namespace resource on annotations
9898
// Case disabled, attempts to use secrets or configmaps from a namespace different from Ingress will
9999
// be denied
100-
// This value will default to `false` on future releases
101100
AllowCrossNamespaceResources bool `json:"allow-cross-namespace-resources"`
102101

103102
// AnnotationsRiskLevel represents the risk accepted on an annotation. If the risk is, for instance `Medium`, annotations
104103
// with risk High and Critical will not be accepted.
105-
// Default Risk is Critical by default, but this may be changed in future releases
106104
AnnotationsRiskLevel string `json:"annotations-risk-level"`
107105

108106
// AnnotationValueWordBlocklist defines words that should not be part of an user annotation value

internal/ingress/defaults/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ type SecurityConfiguration struct {
195195
// AllowCrossNamespaceResources enables users to consume cross namespace resource on annotations
196196
// Case disabled, attempts to use secrets or configmaps from a namespace different from Ingress will
197197
// be denied
198-
// This valid will default to `false` on future releases
199198
AllowCrossNamespaceResources bool `json:"allow-cross-namespace-resources"`
200199

201200
// AnnotationsRiskLevel represents the risk accepted on an annotation. If the risk is, for instance `Medium`, annotations

internal/net/net.go

+18-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ package net
1919
import (
2020
"fmt"
2121
_net "net"
22-
"os/exec"
22+
"os"
23+
"strings"
2324
)
2425

2526
// IsIPV6 checks if the input contains a valid IPV6 address
@@ -41,11 +42,25 @@ func IsPortAvailable(p int) bool {
4142
// IsIPv6Enabled checks if IPV6 is enabled or not and we have
4243
// at least one configured in the pod
4344
func IsIPv6Enabled() bool {
44-
cmd := exec.Command("test", "-f", "/proc/net/if_inet6")
45-
if cmd.Run() != nil {
45+
// Skip interface checks if the IPv6 kernel feature is disabled.
46+
disable, err := os.ReadFile("/proc/sys/net/ipv6/conf/all/disable_ipv6")
47+
if err != nil {
48+
return false
49+
}
50+
if strings.TrimSpace(string(disable)) == "1" {
51+
return false
52+
}
53+
54+
// Check that there are interfaces with IPv6 enabled.
55+
ifaces, err := os.Stat("/proc/net/if_inet6")
56+
if err != nil {
57+
return false
58+
}
59+
if ifaces.IsDir() {
4660
return false
4761
}
4862

63+
// Check IPv6 addresses on interfaces.
4964
addrs, err := _net.InterfaceAddrs()
5065
if err != nil {
5166
return false

internal/net/net_ipv6_test.go

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//go:build test_ipv6
2+
3+
/*
4+
Copyright 2015 The Kubernetes Authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
package net
20+
21+
import "testing"
22+
23+
func TestIsIPv6Enabled(t *testing.T) {
24+
isEnabled := IsIPv6Enabled()
25+
if !isEnabled {
26+
t.Fatalf("expected IPV6 be enabled")
27+
}
28+
}

internal/net/net_test.go

-10
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,3 @@ func TestIsPortAvailable(t *testing.T) {
5858
t.Fatalf("expected port %v to not be available", p)
5959
}
6060
}
61-
62-
/*
63-
// TODO: this test should be optional or running behind a flag
64-
func TestIsIPv6Enabled(t *testing.T) {
65-
isEnabled := IsIPv6Enabled()
66-
if !isEnabled {
67-
t.Fatalf("expected IPV6 be enabled")
68-
}
69-
}
70-
*/

test/e2e/run-chart-test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export KUBECONFIG="${KUBECONFIG:-$HOME/.kube/kind-config-$KIND_CLUSTER_NAME}"
6262
if [ "${SKIP_CLUSTER_CREATION:-false}" = "false" ]; then
6363
echo "[dev-env] creating Kubernetes cluster with kind"
6464

65-
export K8S_VERSION=${K8S_VERSION:-v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027}
65+
export K8S_VERSION=${K8S_VERSION:-v1.32.2@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f}
6666

6767
kind create cluster \
6868
--verbosity=${KIND_LOG_LEVEL} \

test/e2e/run-kind-e2e.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ echo "Running e2e with nginx base image ${NGINX_BASE_IMAGE}"
6363
if [ "${SKIP_CLUSTER_CREATION}" = "false" ]; then
6464
echo "[dev-env] creating Kubernetes cluster with kind"
6565

66-
export K8S_VERSION=${K8S_VERSION:-v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027}
66+
export K8S_VERSION=${K8S_VERSION:-v1.32.2@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f}
6767

6868
# delete the cluster if it exists
6969
if kind get clusters | grep "${KIND_CLUSTER_NAME}"; then

0 commit comments

Comments
 (0)