Skip to content

Commit 78e4e92

Browse files
authored
Merge branch 'main' into chore/tofu
2 parents d2ca832 + 7d4e20c commit 78e4e92

File tree

27 files changed

+203
-150
lines changed

27 files changed

+203
-150
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
- name: Build binary
172172
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
173173
with:
174-
version: v2.5.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
174+
version: v2.5.1 # renovate: datasource=github-tags depName=goreleaser/goreleaser
175175
args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} --clean
176176
env:
177177
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/conformance.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Build binary
8787
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
8888
with:
89-
version: v2.5.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
89+
version: v2.5.1 # renovate: datasource=github-tags depName=goreleaser/goreleaser
9090
args: build --single-target --snapshot --clean
9191
env:
9292
TELEMETRY_ENDPOINT: "" # disables sending telemetry

.github/workflows/functional.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Build binary
7474
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
7575
with:
76-
version: v2.5.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
76+
version: v2.5.1 # renovate: datasource=github-tags depName=goreleaser/goreleaser
7777
args: build --single-target --snapshot --clean
7878
env:
7979
TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
4141
with:
4242
working-directory: ${{ matrix.directory }}
43-
version: v1.62.2 # renovate: datasource=github-tags depName=golangci/golangci-lint
43+
version: v1.63.3 # renovate: datasource=github-tags depName=golangci/golangci-lint
4444

4545
njs-lint:
4646
name: NJS Lint
@@ -78,7 +78,7 @@ jobs:
7878
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7979

8080
- name: Lint Actions
81-
uses: reviewdog/action-actionlint@08ef4afa963243489a457cca426f705ce4e0d1a5 # v1.60.0
81+
uses: reviewdog/action-actionlint@534eb894142bcf31616e5436cbe4214641c58101 # v1.61.0
8282
with:
8383
actionlint_flags: -shellcheck ""
8484

@@ -90,7 +90,7 @@ jobs:
9090
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9191

9292
- name: Lint Markdown
93-
uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0 # v18.0.0
93+
uses: DavidAnson/markdownlint-cli2-action@a23dae216ce3fee4db69da41fed90d2a4af801cf # v19.0.0
9494
with:
9595
config: .markdownlint-cli2.yaml
9696
globs: "**/*.md"

.github/workflows/nfr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
merge-multiple: true
179179

180180
- name: Open a PR with the results
181-
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
181+
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
182182
with:
183183
token: ${{ secrets.NGINX_PAT }}
184184
commit-message: NFR Test Results for NGF version ${{ needs.vars.outputs.version }}

.github/workflows/release-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
make generate-all
9090
9191
- name: Create Pull Request
92-
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
92+
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
9393
with:
9494
token: ${{ secrets.NGINX_PAT }}
9595
commit-message: Release ${{ inputs.version }}

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
exclude: (^examples/|^docs/|.*_test.go$)
2828

2929
- repo: https://github.com/gitleaks/gitleaks
30-
rev: v8.22.0
30+
rev: v8.22.1
3131
hooks:
3232
- id: gitleaks
3333

@@ -39,7 +39,7 @@ repos:
3939
- javascript
4040

4141
- repo: https://github.com/golangci/golangci-lint
42-
rev: v1.62.2
42+
rev: v1.63.3
4343
hooks:
4444
- id: golangci-lint-full
4545
name: golangci-lint-root
@@ -53,7 +53,7 @@ repos:
5353
# Rules are in .markdownlint-cli2.yaml file
5454
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for rule descriptions
5555
- repo: https://github.com/DavidAnson/markdownlint-cli2
56-
rev: v0.16.0
56+
rev: v0.17.1
5757
hooks:
5858
- id: markdownlint-cli2
5959

@@ -86,7 +86,7 @@ repos:
8686
args: [-w, -s, -i, "4"]
8787

8888
- repo: https://github.com/dadav/helm-schema
89-
rev: 0.17.0
89+
rev: 0.18.1
9090
hooks:
9191
- id: helm-schema
9292
args:

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ GO_LINKER_FLAGS = $(GO_LINKER_FLAGS_OPTIMIZATIONS) $(GO_LINKER_FlAGS_VARS)
2323

2424
# tools versions
2525
# renovate: datasource=github-tags depName=golangci/golangci-lint
26-
GOLANGCI_LINT_VERSION = v1.62.2
26+
GOLANGCI_LINT_VERSION = v1.63.3
2727
# renovate: datasource=docker depName=kindest/node
2828
KIND_K8S_VERSION = v1.32.0
2929
# renovate: datasource=github-tags depName=norwoodj/helm-docs
@@ -37,7 +37,7 @@ NODE_VERSION = 22
3737
# renovate: datasource=docker depName=quay.io/helmpack/chart-testing
3838
CHART_TESTING_VERSION = v3.11.0
3939
# renovate: datasource=github-tags depName=dadav/helm-schema
40-
HELM_SCHEMA_VERSION = 0.17.0
40+
HELM_SCHEMA_VERSION = 0.18.1
4141

4242
# variables that can be overridden by the user
4343
PREFIX ?= nginx-gateway-fabric## The name of the NGF image. For example, nginx-gateway-fabric

examples/grpc-routing/helloworld.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
spec:
2929
containers:
3030
- name: grpc-infra-backend-v1
31-
image: ghcr.io/nginxinc/kic-test-grpc-server:0.2.3
31+
image: ghcr.io/nginxinc/kic-test-grpc-server:0.2.4
3232
env:
3333
- name: POD_NAME
3434
valueFrom:

go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ require (
1010
github.com/nginxinc/nginx-plus-go-client v1.3.0
1111
github.com/nginxinc/nginx-prometheus-exporter v1.3.0
1212
github.com/nginxinc/telemetry-exporter v0.1.2
13-
github.com/onsi/ginkgo/v2 v2.22.1
14-
github.com/onsi/gomega v1.36.1
13+
github.com/onsi/ginkgo/v2 v2.22.2
14+
github.com/onsi/gomega v1.36.2
1515
github.com/prometheus/client_golang v1.20.5
1616
github.com/prometheus/common v0.60.1
1717
github.com/spf13/cobra v1.8.1
@@ -71,7 +71,7 @@ require (
7171
go.uber.org/multierr v1.11.0 // indirect
7272
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
7373
golang.org/x/mod v0.22.0 // indirect
74-
golang.org/x/net v0.32.0 // indirect
74+
golang.org/x/net v0.33.0 // indirect
7575
golang.org/x/oauth2 v0.24.0 // indirect
7676
golang.org/x/sync v0.10.0 // indirect
7777
golang.org/x/sys v0.28.0 // indirect
@@ -83,7 +83,7 @@ require (
8383
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
8484
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
8585
google.golang.org/grpc v1.68.1 // indirect
86-
google.golang.org/protobuf v1.35.2 // indirect
86+
google.golang.org/protobuf v1.36.1 // indirect
8787
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
8888
gopkg.in/inf.v0 v0.9.1 // indirect
8989
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ github.com/nginxinc/nginx-prometheus-exporter v1.3.0 h1:1JtdxsZH0Uwhu1nL/j/QyOXy
8787
github.com/nginxinc/nginx-prometheus-exporter v1.3.0/go.mod h1:hXoH+X6aIKSyQuO6QTIiPKH3eZyxqy/wW8GYiE3dflU=
8888
github.com/nginxinc/telemetry-exporter v0.1.2 h1:97vUGhQYgQ2KEsXKCBmr5gqfuujJCKPHwdg5HKoANUs=
8989
github.com/nginxinc/telemetry-exporter v0.1.2/go.mod h1:eKa/Ceh9irmyZ1xV2QxBIxduIyVC5RlmtiWwcTlHuMg=
90-
github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM=
91-
github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM=
92-
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
93-
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
90+
github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU=
91+
github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk=
92+
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
93+
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
9494
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
9595
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
9696
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -156,8 +156,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
156156
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
157157
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
158158
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
159-
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
160-
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
159+
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
160+
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
161161
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
162162
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
163163
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -196,8 +196,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:
196196
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
197197
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
198198
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
199-
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
200-
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
199+
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
200+
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
201201
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
202202
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
203203
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

internal/mode/static/nginx/config/servers.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -606,22 +606,24 @@ func createRewritesValForRewriteFilter(filter *dataplane.HTTPURLRewriteFilter, p
606606
filterPrefix = "/"
607607
}
608608

609-
// capture everything after the configured prefix
610-
regex := fmt.Sprintf("^%s(.*)$", path)
611-
// replace the configured prefix with the filter prefix and append what was captured
612-
replacement := fmt.Sprintf("%s$1", filterPrefix)
609+
// capture everything following the configured prefix up to the first ?, if present.
610+
regex := fmt.Sprintf("^%s([^?]*)?", path)
611+
// replace the configured prefix with the filter prefix, append the captured segment,
612+
// and include the request arguments stored in nginx variable $args.
613+
// https://nginx.org/en/docs/http/ngx_http_core_module.html#var_args
614+
replacement := fmt.Sprintf("%s$1?$args?", filterPrefix)
613615

614616
// if configured prefix does not end in /, but replacement prefix does end in /,
615617
// then make sure that we *require* but *don't capture* a trailing slash in the request,
616618
// otherwise we'll get duplicate slashes in the full replacement
617619
if strings.HasSuffix(filterPrefix, "/") && !strings.HasSuffix(path, "/") {
618-
regex = fmt.Sprintf("^%s(?:/(.*))?$", path)
620+
regex = fmt.Sprintf("^%s(?:/([^?]*))?", path)
619621
}
620622

621623
// if configured prefix ends in / we won't capture it for a request (since it's not in the regex),
622624
// so append it to the replacement prefix if the replacement prefix doesn't already end in /
623625
if strings.HasSuffix(path, "/") && !strings.HasSuffix(filterPrefix, "/") {
624-
replacement = fmt.Sprintf("%s/$1", filterPrefix)
626+
replacement = fmt.Sprintf("%s/$1?$args?", filterPrefix)
625627
}
626628

627629
rewrites.MainRewrite = fmt.Sprintf("%s %s break", regex, replacement)

internal/mode/static/nginx/config/servers_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ func TestCreateServers(t *testing.T) {
13071307
},
13081308
{
13091309
Path: "/_ngf-internal-rule8-route0",
1310-
Rewrites: []string{"^ $request_uri", "^/rewrite-with-headers(.*)$ /prefix-replacement$1 break"},
1310+
Rewrites: []string{"^ $request_uri", "^/rewrite-with-headers([^?]*)? /prefix-replacement$1?$args? break"},
13111311
ProxyPass: "http://test_foo_80",
13121312
ProxySetHeaders: rewriteProxySetHeaders,
13131313
Type: http.InternalLocationType,
@@ -2427,7 +2427,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
24272427
},
24282428
expected: &rewriteConfig{
24292429
InternalRewrite: "^ $request_uri",
2430-
MainRewrite: "^/original(.*)$ /prefix-path$1 break",
2430+
MainRewrite: "^/original([^?]*)? /prefix-path$1?$args? break",
24312431
},
24322432
msg: "prefix path no trailing slashes",
24332433
},
@@ -2441,7 +2441,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
24412441
},
24422442
expected: &rewriteConfig{
24432443
InternalRewrite: "^ $request_uri",
2444-
MainRewrite: "^/original(?:/(.*))?$ /$1 break",
2444+
MainRewrite: "^/original(?:/([^?]*))? /$1?$args? break",
24452445
},
24462446
msg: "prefix path empty string",
24472447
},
@@ -2455,7 +2455,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
24552455
},
24562456
expected: &rewriteConfig{
24572457
InternalRewrite: "^ $request_uri",
2458-
MainRewrite: "^/original(?:/(.*))?$ /$1 break",
2458+
MainRewrite: "^/original(?:/([^?]*))? /$1?$args? break",
24592459
},
24602460
msg: "prefix path /",
24612461
},
@@ -2469,7 +2469,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
24692469
},
24702470
expected: &rewriteConfig{
24712471
InternalRewrite: "^ $request_uri",
2472-
MainRewrite: "^/original(?:/(.*))?$ /trailing/$1 break",
2472+
MainRewrite: "^/original(?:/([^?]*))? /trailing/$1?$args? break",
24732473
},
24742474
msg: "prefix path replacement with trailing /",
24752475
},
@@ -2483,7 +2483,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
24832483
},
24842484
expected: &rewriteConfig{
24852485
InternalRewrite: "^ $request_uri",
2486-
MainRewrite: "^/original/(.*)$ /prefix-path/$1 break",
2486+
MainRewrite: "^/original/([^?]*)? /prefix-path/$1?$args? break",
24872487
},
24882488
msg: "prefix path original with trailing /",
24892489
},
@@ -2497,7 +2497,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
24972497
},
24982498
expected: &rewriteConfig{
24992499
InternalRewrite: "^ $request_uri",
2500-
MainRewrite: "^/original/(.*)$ /trailing/$1 break",
2500+
MainRewrite: "^/original/([^?]*)? /trailing/$1?$args? break",
25012501
},
25022502
msg: "prefix path both with trailing slashes",
25032503
},

0 commit comments

Comments
 (0)