Skip to content

Commit 438e397

Browse files
Merge branch 'main' into fix/register-go-test-coverage-tool
2 parents 79850ce + 51df9fb commit 438e397

132 files changed

Lines changed: 2127 additions & 1882 deletions

File tree

Some content is hidden

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

.github/actions/kubernetes-e2e-tests/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ inputs:
2424
matrix-label:
2525
required: true
2626
description: The version of the matrix being used - used to name artifacts to prevent filename collisions
27+
envtest-k8s-version:
28+
required: false
29+
default: '1.33'
30+
description: Kubernetes minor version for envtest API-server assets
2731

2832
runs:
2933
using: "composite"
@@ -37,6 +41,7 @@ runs:
3741
TEST_PKG: ./test/e2e/tests
3842
# Doesn't really matter, but using the same as `go build` means we can re-use the same Go cache.
3943
CGO_ENABLED: 0
44+
ENVTEST_K8S_VERSION: ${{ inputs.envtest-k8s-version }}
4045
shell: bash
4146
run: make e2e-test
4247
- name: Archive bug report directory on failure

.github/workflows/.env/nightly-tests/max_versions.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ kubectl_version='v1.36.1'
33
kind_version='v0.32.0'
44
istio_version='1.30.1'
55
cluster_type='kind'
6+
envtest_k8s_version='1.36'

.github/workflows/.env/nightly-tests/min_versions.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ kubectl_version='v1.32.5'
33
kind_version='v0.29.0'
44
istio_version='1.23.6'
55
cluster_type='kind'
6+
envtest_k8s_version='1.32'

.github/workflows/nightly-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,4 @@ jobs:
269269
run-regex: ${{ matrix.controllers.regex }}
270270
istio-version: ${{ steps.dotenv.outputs.istio_version }}
271271
matrix-label: "nightly-kgw-api-${{ matrix.env-versions.label }}-${{ matrix.gateway-api-version.version }}-${{ matrix.gateway-api-version.channel }}"
272+
envtest-k8s-version: ${{ steps.dotenv.outputs.envtest_k8s_version }}

.github/workflows/release.yaml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
runs-on: ubuntu-22.04
4545
outputs:
4646
version: ${{ steps.set_vars.outputs.version }}
47+
floating_version: ${{ steps.set_vars.outputs.floating_version }}
4748
goreleaser_args: ${{ steps.set_vars.outputs.goreleaser_args }}
4849
needs_release: ${{ steps.set_vars.outputs.needs_release }}
4950
previous_tag: ${{ steps.set_vars.outputs.previous_tag }}
@@ -56,7 +57,8 @@ jobs:
5657
shell: bash
5758
run: |
5859
set -x
59-
GIT_SHA=$(git rev-parse --short HEAD)
60+
GIT_SHA=$(git rev-parse --short=12 HEAD)
61+
FLOATING_VERSION=""
6062
6163
find_previous_release_notes_tag() {
6264
local version="$1"
@@ -108,7 +110,10 @@ jobs:
108110
NEEDS_RELEASE=true
109111
GORELEASER_ARGS="--clean --skip=validate --release-notes _output/RELEASE_NOTES.md"
110112
elif [[ $GITHUB_REF == refs/heads/main ]]; then
111-
VERSION="$(make --no-print-directory print-ROLLING_MAIN_VERSION)"
113+
# Per-sha version gives parallel main runs non-colliding image tags;
114+
# the floating tag is promoted separately, only by the run that is still HEAD.
115+
FLOATING_VERSION="$(make --no-print-directory print-ROLLING_MAIN_VERSION)"
116+
VERSION="${FLOATING_VERSION}-${GIT_SHA}"
112117
NEEDS_RELEASE=false
113118
GORELEASER_ARGS="--clean --skip=validate"
114119
elif [[ $GITHUB_REF == refs/pull/* ]]; then
@@ -125,6 +130,7 @@ jobs:
125130
# Group redirects to satisfy shellcheck SC2129
126131
{
127132
echo "version=${VERSION}"
133+
echo "floating_version=${FLOATING_VERSION}"
128134
echo "previous_tag=${PREVIOUS_TAG:-}"
129135
echo "needs_release=${NEEDS_RELEASE}"
130136
echo "goreleaser_args=${GORELEASER_ARGS}"
@@ -141,6 +147,20 @@ jobs:
141147
if: ${{ github.event_name != 'pull_request' }}
142148
run: echo "${{ secrets.GITHUB_TOKEN }}" | go tool helm registry login ${{ env.IMAGE_REGISTRY }} -u ${{ github.repository_owner }} --password-stdin
143149

150+
# docker login + buildx are only needed to promote the floating image tags below
151+
# (`docker buildx imagetools create`); gate them on the same condition as that step.
152+
- name: Log into ${{ env.IMAGE_REGISTRY }}
153+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.setup.outputs.floating_version != '' }}
154+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
155+
with:
156+
registry: ${{ env.IMAGE_REGISTRY }}
157+
username: ${{ github.repository_owner }}
158+
password: ${{ secrets.GITHUB_TOKEN }}
159+
160+
- name: Setup Buildx
161+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.setup.outputs.floating_version != '' }}
162+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
163+
144164
- name: Package kgateway charts
145165
run: make package-kgateway-charts
146166
env:
@@ -153,6 +173,40 @@ jobs:
153173
VERSION: ${{ needs.setup.outputs.version }}
154174
IMAGE_REGISTRY: ${{ env.IMAGE_REGISTRY }}
155175

176+
# Promote the floating chart and image tags together, gated on a single origin/main
177+
# HEAD check, so the two artifact tags can never diverge. Doing this in one step (rather
178+
# than promoting images in the goreleaser job and charts here) avoids a race where
179+
# origin/main advances between the two jobs and leaves the floating chart tag behind the
180+
# floating image tag. This job needs [setup, goreleaser], so both the per-sha charts
181+
# (pushed above) and the per-sha images (from goreleaser) already exist by now.
182+
- name: Promote floating chart and image tags if this commit is still main HEAD
183+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.setup.outputs.floating_version != '' }}
184+
shell: bash
185+
run: |
186+
set -euo pipefail
187+
git fetch origin main --depth=1
188+
HEAD_SHA=$(git rev-parse origin/main)
189+
if [ "${HEAD_SHA}" != "${GITHUB_SHA}" ]; then
190+
echo "origin/main (${HEAD_SHA}) has moved past this commit (${GITHUB_SHA}); skipping floating tag promotion"
191+
exit 0
192+
fi
193+
make release-charts VERSION="${FLOAT}"
194+
for image in kgateway sds envoy-wrapper; do
195+
docker buildx imagetools create \
196+
-t "${REG}/${image}:${FLOAT}" \
197+
"${REG}/${image}:${VERSION}"
198+
for arch in amd64 arm64; do
199+
docker buildx imagetools create \
200+
-t "${REG}/${image}:${FLOAT}-${arch}" \
201+
"${REG}/${image}:${VERSION}-${arch}"
202+
done
203+
done
204+
env:
205+
REG: ${{ env.IMAGE_REGISTRY }}
206+
IMAGE_REGISTRY: ${{ env.IMAGE_REGISTRY }}
207+
VERSION: ${{ needs.setup.outputs.version }}
208+
FLOAT: ${{ needs.setup.outputs.floating_version }}
209+
156210
release-notes:
157211
name: Generate release notes
158212
needs: setup

.golangci.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ linters:
1313
enable:
1414
- bodyclose
1515
- copyloopvar
16+
- depguard
1617
- forbidigo
1718
- ginkgolinter
1819
- gomodguard
@@ -63,6 +64,14 @@ linters:
6364
isFirstField: Ignore
6465
useProtobuf: Forbid
6566
usePatchStrategy: Ignore
67+
depguard:
68+
rules:
69+
default:
70+
files:
71+
- "$all"
72+
deny:
73+
- pkg: "sort"
74+
desc: "Should be replaced with slices package"
6675
forbidigo:
6776
forbid:
6877
- pattern: anypb.New

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ golden-translator-%:
482482

483483
# Gateway API v1.6 experimental CRDs (xbackends) use the CEL format library,
484484
# which requires a kube-apiserver newer than 1.31.
485-
ENVTEST_K8S_VERSION = 1.33
485+
# Defaults to a version compatible with the Gateway API experimental CRDs. CI
486+
# matrix lanes may override this to match their Kubernetes version.
487+
ENVTEST_K8S_VERSION ?= 1.33
486488
ENVTEST ?= go -C tools tool setup-envtest
487489

488490
.PHONY: envtest-path

api/annotations/gateway.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const (
3232
// Use in the TLS options field of a TLS listener.
3333
EcdhCurves gwv1.AnnotationKey = "kgateway.dev/ecdh-curves"
3434

35+
// SignatureAlgorithms is the annotation key used to set the supported algorithms for a TLS listener.
36+
// The value is a comma separated list of algorithms, e.g "ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256".
37+
// Use in the TLS options field of a TLS listener.
38+
SignatureAlgorithms gwv1.AnnotationKey = "kgateway.dev/signature-algorithms"
39+
3540
// MinTLSVersion is the annotation key used to set the minimum TLS version for a TLS listener.
3641
// The value is a string representing the version, e.g "1.2".
3742
// Use in the TLS options field of a TLS listener.

api/settings/settings.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ type Settings struct {
323323
// to every Envoy route. This metadata includes the Kubernetes source object (kind, group,
324324
// name, namespace, rule) for each route, which can be useful for debugging and observability.
325325
// Disabled by default.
326+
//
327+
// Note: This feature is experimental and subject to breaking changes in future releases.
326328
EnableRouteSourceMetadata bool `split_words:"true" default:"false"`
327329

328330
// GatewayClassParametersRefs configures the GatewayParameters references to set on the default GatewayClasses.

api/v1alpha1/kgateway/backend_config_policy_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ type TLSParameters struct {
398398

399399
// +optional
400400
EcdhCurves []string `json:"ecdhCurves,omitempty"`
401+
402+
// +optional
403+
SignatureAlgorithms []string `json:"signatureAlgorithms,omitempty"`
401404
}
402405

403406
// +kubebuilder:validation:XValidation:rule="has(self.tlsCertificate) || has(self.tlsKey) || has(self.rootCA)",message="At least one of tlsCertificate, tlsKey, or rootCA must be set in TLSFiles"
@@ -464,6 +467,8 @@ type LoadBalancer struct {
464467
// When enabled, traffic is preferentially routed to endpoints in the same
465468
// availability zone as the Envoy proxy.
466469
// This is mutually exclusive with localityType.
470+
//
471+
// Note: This feature is experimental and subject to breaking changes in future releases.
467472
// +optional
468473
ZoneAware *ZoneAwareLoadBalancer `json:"zoneAware,omitempty"`
469474

@@ -585,6 +590,8 @@ const (
585590
// ZoneAwareLoadBalancer configures zone-aware routing behavior.
586591
// Currently, preferLocal must be specified.
587592
//
593+
// Note: This struct is part of an experimental API and subject to breaking changes in future releases.
594+
//
588595
// +kubebuilder:validation:AtLeastOneOf=preferLocal
589596
type ZoneAwareLoadBalancer struct {
590597
// PreferLocal enables Envoy's zone-aware routing which prefers sending traffic
@@ -599,6 +606,8 @@ type ZoneAwareLoadBalancer struct {
599606
// ZoneAwarePreferLocal configures Envoy's native zone-aware routing.
600607
// Envoy will prefer sending traffic to endpoints in the same zone as the proxy,
601608
// while still maintaining rough request balance across all upstream hosts.
609+
//
610+
// Note: This struct is part of an experimental API and subject to breaking changes in future releases.
602611
type ZoneAwarePreferLocal struct {
603612
// Force enables Envoy forced zone-local routing. Envoy routes to same-zone
604613
// endpoints while the local endpoint threshold is met. If there are not enough
@@ -627,6 +636,8 @@ type ZoneAwarePreferLocal struct {
627636
}
628637

629638
// ZoneAwareForce configures Envoy forceLocalZone behavior.
639+
//
640+
// Note: This struct is part of an experimental API and subject to breaking changes in future releases.
630641
type ZoneAwareForce struct {
631642
// MinEndpointsInZoneThreshold is the minimum number of endpoints that must
632643
// exist in the local zone for forced zone-local routing to be active.

0 commit comments

Comments
 (0)