Skip to content

Commit 12658c7

Browse files
committed
Merge remote-tracking branch 'origin/main' into rustformation-config-rework
Signed-off-by: Andy Fong <[email protected]>
2 parents 8a41518 + fc79598 commit 12658c7

File tree

487 files changed

+14866
-10427
lines changed

Some content is hidden

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

487 files changed

+14866
-10427
lines changed

.custom-gcl.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: v2.6.1
2+
name: golangci-lint-custom
3+
destination: _output
4+
plugins:
5+
- module: github.com/kgateway-dev/kgateway/v2/hack/krtequals
6+
path: ./hack/krtequals
7+
- module: 'sigs.k8s.io/kube-api-linter'
8+
version: 'v0.0.0-20250715075424-4fab82d26a8e' # Pin to a commit while there's no tag

.github/actions/kube-agent-gateway-conformance-tests/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ runs:
4545
ADDITIONAL_VALUES="-f ${HELM_ADDITIONAL_VALUES}"
4646
echo "Using additional Helm values from: ${HELM_ADDITIONAL_VALUES}"
4747
fi
48-
48+
4949
if [[ -z "${{ matrix.version }}" ]]; then
5050
# If matrix.version is empty, use the local chart path specified in the Makefile.
5151
helm upgrade -i -n kgateway-system kgateway-crds ./install/helm/kgateway-crds/ \
5252
--create-namespace
5353
helm upgrade -i -n kgateway-system kgateway ./install/helm/kgateway/ \
5454
--create-namespace \
55+
--set controller.extraEnv.KGW_ENABLE_EXPERIMENTAL_GATEWAY_API_FEATURES="true" \
5556
--set image.tag=${VERSION} --set image.registry=ghcr.io/kgateway-dev \
5657
${ADDITIONAL_VALUES}
5758
else
@@ -64,6 +65,7 @@ runs:
6465
helm upgrade -i -n kgateway-system kgateway oci://${{ env.IMAGE_REGISTRY }}/charts/kgateway \
6566
--version ${VERSION} \
6667
--create-namespace \
68+
--set controller.extraEnv.KGW_ENABLE_EXPERIMENTAL_GATEWAY_API_FEATURES="true" \
6769
--set image.tag=${VERSION} \
6870
${ADDITIONAL_VALUES}
6971
fi

.github/actions/kube-gateway-api-conformance-tests/action.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ runs:
4545
--create-namespace
4646
helm upgrade -i -n kgateway-system kgateway ./install/helm/kgateway/ \
4747
--create-namespace \
48+
--set controller.extraEnv.KGW_ENABLE_EXPERIMENTAL_GATEWAY_API_FEATURES="true" \
4849
--set image.tag=${VERSION} --set image.registry=ghcr.io/kgateway-dev
4950
else
5051
# TODO(tim): this will require changes once the new helm chart is integrated
@@ -56,6 +57,7 @@ runs:
5657
helm upgrade -i -n kgateway-system kgateway oci://${{ env.IMAGE_REGISTRY }}/charts/kgateway \
5758
--version ${VERSION} \
5859
--create-namespace \
60+
--set controller.extraEnv.KGW_ENABLE_EXPERIMENTAL_GATEWAY_API_FEATURES="true" \
5961
--set image.tag=${VERSION}
6062
fi
6163
- name: Run the kubernetes gateway API conformance tests

.github/actions/kube-inference-extension-conformance-tests/action.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ runs:
4747
--create-namespace \
4848
--set image.tag=${VERSION} \
4949
--set image.registry=ghcr.io/kgateway-dev \
50+
--set controller.extraEnv.KGW_ENABLE_EXPERIMENTAL_GATEWAY_API_FEATURES="true" \
5051
--set inferenceExtension.enabled=true
5152
else
5253
# TODO(tim): this will require changes once the new helm chart is integrated
@@ -60,6 +61,7 @@ runs:
6061
--version ${VERSION} \
6162
--create-namespace \
6263
--set image.tag=${VERSION} \
64+
--set controller.extraEnv.KGW_ENABLE_EXPERIMENTAL_GATEWAY_API_FEATURES="true" \
6365
--set inferenceExtension.enabled=true
6466
fi
6567
- name: Run the kubernetes gateway API inference extension conformance tests

.github/actions/setup-kind-cluster/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ inputs:
1919
required: false
2020
default: "" # If this is undefined the setup-kind script has its own default value
2121
description: The version of the gateway-api to use
22+
gateway-api-channel:
23+
required: false
24+
default: "" # If this is undefined the setup-kind script has its own default value
25+
description: The channel of the gateway-api to use
2226
localstack:
2327
required: false
2428
default: "false"
@@ -38,6 +42,7 @@ runs:
3842
CLUSTER_NODE_VERSION: ${{ inputs.kind-node-version }}
3943
ISTIO_VERSION: ${{ inputs.istio-version }}
4044
CONFORMANCE_VERSION: ${{ inputs.gateway-api-version }}
45+
CONFORMANCE_CHANNEL: ${{ inputs.gateway-api-channel }}
4146
LOCALSTACK: ${{ inputs.localstack }}
4247
CONFORMANCE: true
4348
run: |

.github/workflows/e2e.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ jobs:
7575
- cluster-name: 'agent-gateway-cluster'
7676
go-test-args: '-v -timeout=25m'
7777
go-test-run-regex: '^TestAgentgatewayIntegration'
78-
agentgateway: 'true'
7978
# August 29, 2025: ~3 minutes
8079
- cluster-name: 'api-validation'
8180
go-test-args: '-v -timeout=10m'

.github/workflows/lint.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,8 @@ jobs:
2121
uses: actions/checkout@v4
2222
- name: Prep Go Runner
2323
uses: ./.github/actions/prep-go-runner
24-
- uses: golangci/golangci-lint-action@v7
25-
with:
26-
version: v2.5.0
27-
args: --verbose --modules-download-mode=readonly --allow-parallel-runners
28-
skip-cache: true
29-
skip-save-cache: true
30-
only-new-issues: false
24+
- name: Lint Go code
25+
run: make analyze
3126

3227
# Lint Helm charts
3328
helm-lint:

.github/workflows/nightly-tests.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
description: "Run load testing suite"
2323
type: boolean
2424
default: false
25+
run-e2e-tests:
26+
description: "Run e2e tests"
27+
type: boolean
28+
default: false
2529

2630
concurrency:
2731
group: ${{ github.workflow }}-${{ github.ref_name }}
@@ -59,3 +63,50 @@ jobs:
5963
with:
6064
ref: main
6165
- uses: ./.github/actions/kube-gateway-api-load-tests
66+
67+
kgateway_e2e_tests_for_gateway_api_versions:
68+
name: GwApi E2E
69+
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.run-e2e-tests) || github.event.schedule == '0 5 * * *' }}
70+
runs-on: ubuntu-22.04
71+
timeout-minutes: 120
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
gateway-api-version: [ { version: 'v1.4.0', channel: 'experimental' },
76+
{ version: 'v1.4.0', channel: 'standard' },
77+
{ version: 'v1.3.0', channel: 'experimental' },
78+
{ version: 'v1.3.0', channel: 'standard' },
79+
{ version: 'v1.2.1', channel: 'experimental' },
80+
{ version: 'v1.2.1', channel: 'standard' }]
81+
steps:
82+
- uses: actions/checkout@v4
83+
- name: Prep Go Runner
84+
uses: ./.github/actions/prep-go-runner
85+
- name: Dotenv Action
86+
uses: falti/[email protected]
87+
id: dotenv
88+
with:
89+
path: "./.github/workflows/.env/nightly-tests/max_versions.env"
90+
log-variables: true
91+
- name: Setup KinD Cluster
92+
uses: ./.github/actions/setup-kind-cluster
93+
with:
94+
gateway-api-version: ${{ matrix.gateway-api-version.version }}
95+
gateway-api-channel: ${{ matrix.gateway-api-version.channel }}
96+
cluster-name: "kgw-api-e2e-${{ matrix.gateway-api-version.version }}-${{ matrix.gateway-api-version.channel }}"
97+
kubectl-version: ${{ steps.dotenv.outputs.kubectl_version }}
98+
istio-version: ${{ steps.dotenv.outputs.istio_version }}
99+
kind-node-version: ${{ steps.dotenv.outputs.node_version }}
100+
- id: run-tests
101+
uses: ./.github/actions/kubernetes-e2e-tests
102+
env:
103+
VERSION: '1.0.0-ci1'
104+
GITHUB_TOKEN: ${{ github.token }}
105+
GO_TEST_RETRIES: '3' # Use a higher number of retries because there are so many tests and we don't want to rerun
106+
GOTESTSUM_ARGS: '--format=standard-verbose --rerun-fails-max-failures 60' # High value for "rerun-fails-max-failures" because 3 failed tests can result in gotestsum thinking there's 40+ failures
107+
with:
108+
cluster-name: "kgw-api-e2e-${{ matrix.gateway-api-version.version }}-${{ matrix.gateway-api-version.channel }}"
109+
test-args: '-v -timeout=120m'
110+
run-regex: "^Test"
111+
istio-version: ${{ steps.dotenv.outputs.istio_version }}
112+
matrix-label: "nightly-kgw-api-${{ matrix.gateway-api-version.version }}-${{ matrix.gateway-api-version.channel }}"

.golangci.yaml

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,48 @@ linters:
1919
- gosec
2020
- importas
2121
- ineffassign
22+
- krtequals
23+
- kubeapilinter
2224
- misspell
25+
- modernize
2326
- nakedret
2427
- predeclared
2528
- promlinter
2629
- sloglint
2730
- spancheck
2831
- staticcheck
32+
- unparam
2933
- unused
3034
- usestdlibvars
3135
- whitespace
3236
settings:
37+
custom:
38+
krtequals:
39+
type: "module"
40+
description: Checks Equals() implementations for KRT-style semantic equality issues
41+
settings:
42+
deepEqual: false
43+
kubeapilinter:
44+
type: module
45+
description: Kube API Linter lints Kube like APIs based on API conventions and best practices
46+
settings:
47+
linters:
48+
enable:
49+
- "*"
50+
disable:
51+
- commentstart
52+
- integers
53+
- maxlength
54+
- nobools
55+
- nomaps
56+
- optionalfields
57+
- optionalorrequired
58+
- ssatags
59+
lintersConfig:
60+
conditions:
61+
isFirstField: Ignore
62+
useProtobuf: Forbid
63+
usePatchStrategy: Ignore
3364
forbidigo:
3465
forbid:
3566
- pattern: anypb.New
@@ -76,6 +107,10 @@ linters:
76107
misspell:
77108
ignore-rules:
78109
- kgateway
110+
modernize:
111+
disable:
112+
# disabled because modernize gets confused with conflicting edits. we can probably rely on the kube api linter instead for this one.
113+
- omitzero
79114
nakedret:
80115
# The team consensus is that naked returns hinder the readability of the code.
81116
# However, named return values can still be useful as documentation for certain scenarios.
@@ -124,16 +159,36 @@ linters:
124159
- examples$
125160
rules:
126161
# Forbid t.Cleanup only in e2e tests (exclude the rule from non-e2e paths)
127-
- linters:
162+
- path-except: test/e2e/
163+
linters:
128164
- forbidigo
129165
text: 'require testutils.Cleanup'
130-
path-except: test/e2e/
166+
# Restrict krtequals analyzer to the pkg and internal directories
167+
- path-except: pkg/|internal/
168+
linters:
169+
- krtequals
170+
# Only run kubeapilinter inside the 'api/' directory. This prevents running API-specific checks
171+
# on unrelated packages like controllers or tests and producing false positives.
172+
- path-except: "^api/v1alpha1"
173+
linters:
174+
- kubeapilinter
131175
issues:
132176
max-same-issues: 0
133177
uniq-by-line: true
134178
formatters:
135179
enable:
136-
- goimports
180+
- gofmt
181+
- gci
182+
settings:
183+
gci:
184+
sections:
185+
- standard
186+
- default
187+
- prefix(github.com/kgateway-dev)
188+
- blank
189+
- dot
190+
- localmodule
191+
custom-order: true
137192
exclusions:
138193
generated: lax
139194
paths:

0 commit comments

Comments
 (0)