Skip to content

Commit ec81971

Browse files
committed
Merge remote-tracking branch 'upstream/main' into adam--add-admission-control
Signed-off-by: Adam Buran <aburan28@gmail.com> # Conflicts: # api/v1alpha1/envoyproxy_types.go
2 parents 3778905 + ae25790 commit ec81971

325 files changed

Lines changed: 43937 additions & 14757 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/workflows/build_and_test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
with:
3636
filters: |
3737
run_test_workflow:
38-
- "!?(site|release-notes)/**"
38+
- "!?(.github|site|release-notes)/**"
39+
- ".github/workflows/build_and_test.yaml"
3940
4041
lint:
4142
runs-on: ubuntu-22.04

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
- uses: ./tools/github-actions/setup-deps
3737

3838
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
39+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
4040
with:
4141
languages: ${{ matrix.language }}
4242

4343
- name: Autobuild
44-
uses: github/codeql-action/autobuild@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
44+
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
4545

4646
- name: Perform CodeQL Analysis
47-
uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
47+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
4848
with:
4949
category: "/language:${{matrix.language}}"

.github/workflows/run-gen-check.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,16 @@ jobs:
3838
run: |
3939
PR_NUM="${{ github.event.issue.number }}"
4040
HEAD_REF=$(gh pr view "$PR_NUM" --json headRefName -q .headRefName)
41-
HEAD_REPO=$(gh pr view "$PR_NUM" --json headRepository -q '.headRepository.owner.login + "/" + .headRepository.name')
41+
HEAD_REPO=$(gh pr view "$PR_NUM" --json headRepository -q .headRepository.full_name)
4242
echo "head_ref=$HEAD_REF" >> $GITHUB_OUTPUT
43-
if [ "$HEAD_REPO" != "${{ github.repository }}" ]; then
44-
echo "::error::Cannot run /run-gen-check on pull requests from forks. Push to a branch in this repository."
45-
exit 1
46-
fi
43+
echo "head_repo=$HEAD_REPO" >> $GITHUB_OUTPUT
4744
env:
4845
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4946

5047
- name: Checkout PR branch
5148
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5249
with:
50+
repository: ${{ steps.pr.outputs.head_repo }}
5351
ref: ${{ steps.pr.outputs.head_ref }}
5452
token: ${{ secrets.GITHUB_TOKEN }}
5553

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ jobs:
4040
retention-days: 5
4141

4242
- name: "Upload to code-scanning"
43-
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
43+
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
4444
with:
4545
sarif_file: results.sarif

.github/workflows/trivy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
IMAGE=envoy-proxy/gateway-dev TAG=${{ github.sha }} make image
3636
3737
- name: Run Trivy vulnerability scanner
38-
uses: aquasecurity/trivy-action@c1824fd6edce30d7ab345a9989de00bbd46ef284 # v0.34.0
38+
uses: aquasecurity/trivy-action@e368e328979b113139d6f9068e03accaed98a518 # v0.34.1
3939
with:
4040
image-ref: envoy-proxy/gateway-dev:${{ github.sha }}
4141
exit-code: '1'

api/v1alpha1/backendtrafficpolicy_types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,10 @@ type BackendTrafficPolicySpec struct {
131131

132132
// RoutingType can be set to "Service" to use the Service Cluster IP for routing to the backend,
133133
// or it can be set to "Endpoint" to use Endpoint routing.
134-
// When specified, this overrides the EnvoyProxy-level setting for the relevant targeRefs.
134+
// When specified, this overrides the EnvoyProxy-level setting for the relevant targetRefs.
135135
// If not specified, the EnvoyProxy-level setting is used.
136136
//
137137
// +optional
138-
// +notImplementedHide
139138
RoutingType *RoutingType `json:"routingType,omitempty"`
140139
}
141140

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Copyright Envoy Gateway Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
// The full text of the Apache license is available in the LICENSE file at
4+
// the root of the repo.
5+
6+
package v1alpha1
7+
8+
import (
9+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
10+
)
11+
12+
// DynamicModuleEntry defines a dynamic module that is registered and allowed
13+
// for use by EnvoyExtensionPolicy resources.
14+
type DynamicModuleEntry struct {
15+
// Name is the logical name for this module. EnvoyExtensionPolicy resources
16+
// reference modules by this name.
17+
//
18+
// +kubebuilder:validation:MinLength=1
19+
// +kubebuilder:validation:MaxLength=253
20+
// +kubebuilder:validation:Pattern=`^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$`
21+
Name string `json:"name"`
22+
23+
// LibraryName is the name of the shared library file that Envoy will load.
24+
// Envoy searches for lib${libraryName}.so in the path specified by the
25+
// ENVOY_DYNAMIC_MODULES_SEARCH_PATH environment variable.
26+
// If not specified, defaults to the value of Name.
27+
//
28+
// +optional
29+
// +kubebuilder:validation:MaxLength=253
30+
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9_]([a-zA-Z0-9_.-]*[a-zA-Z0-9_])?$`
31+
LibraryName *string `json:"libraryName,omitempty"`
32+
33+
// DoNotClose prevents the module from being unloaded with dlclose when no
34+
// more references exist. This is useful for modules that maintain global
35+
// state that should not be destroyed on configuration updates.
36+
// Defaults to false.
37+
//
38+
// +optional
39+
// +kubebuilder:default=false
40+
DoNotClose *bool `json:"doNotClose,omitempty"`
41+
42+
// LoadGlobally loads the dynamic module with the RTLD_GLOBAL flag.
43+
// By default, modules are loaded with RTLD_LOCAL to avoid symbol conflicts.
44+
// Set this to true when the module needs to share symbols with other
45+
// dynamic libraries it loads.
46+
// Defaults to false.
47+
//
48+
// +optional
49+
// +kubebuilder:default=false
50+
LoadGlobally *bool `json:"loadGlobally,omitempty"`
51+
}
52+
53+
// DynamicModule defines a dynamic module HTTP filter to be loaded by Envoy.
54+
// The module must be registered in the EnvoyProxy resource's dynamicModules
55+
// allowlist by the infrastructure operator.
56+
type DynamicModule struct {
57+
// Name references a dynamic module registered in the EnvoyProxy resource's
58+
// dynamicModules list. The referenced module must exist in the registry;
59+
// otherwise, the policy will be rejected.
60+
//
61+
// +kubebuilder:validation:MinLength=1
62+
// +kubebuilder:validation:MaxLength=253
63+
// +kubebuilder:validation:Pattern=`^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$`
64+
Name string `json:"name"`
65+
66+
// FilterName identifies a specific filter implementation within the dynamic
67+
// module. A single shared library can contain multiple filter implementations.
68+
// This value is passed to the module's HTTP filter config init function to
69+
// select the appropriate implementation.
70+
// If not specified, defaults to an empty string.
71+
//
72+
// +optional
73+
// +kubebuilder:validation:MaxLength=253
74+
FilterName *string `json:"filterName,omitempty"`
75+
76+
// Config is the configuration for the dynamic module filter.
77+
// This is serialized as JSON and passed to the module's initialization function.
78+
//
79+
// +optional
80+
Config *apiextensionsv1.JSON `json:"config,omitempty"`
81+
82+
// TerminalFilter indicates that this dynamic module handles requests without
83+
// requiring an upstream backend. The module is responsible for generating and
84+
// sending the response to downstream directly.
85+
// Defaults to false.
86+
//
87+
// +optional
88+
// +kubebuilder:default=false
89+
TerminalFilter *bool `json:"terminalFilter,omitempty"`
90+
}

api/v1alpha1/envoyextensionypolicy_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ type EnvoyExtensionPolicySpec struct {
6565
// +kubebuilder:validation:MaxItems=16
6666
// +optional
6767
Lua []Lua `json:"lua,omitempty"`
68+
69+
// DynamicModule is an ordered list of dynamic module HTTP filters
70+
// that should be added to the envoy filter chain.
71+
// Each module must be registered in the EnvoyProxy resource's dynamicModules
72+
// allowlist.
73+
// Order matters, as the filters will be loaded in the order they are
74+
// defined in this list.
75+
//
76+
// +kubebuilder:validation:MaxItems=16
77+
// +optional
78+
DynamicModule []DynamicModule `json:"dynamicModule,omitempty"`
6879
}
6980

7081
//+kubebuilder:object:root=true

api/v1alpha1/envoygateway_types.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,9 @@ type EnvoyGatewaySpec struct {
134134

135135
// GatewayAPI defines an experimental Gateway API resource that can be enabled.
136136
// +enum
137-
// +kubebuilder:validation:Enum=XListenerSet;XBackendTrafficPolicy
137+
// +kubebuilder:validation:Enum=XBackendTrafficPolicy
138138
type GatewayAPI string
139139

140-
const (
141-
// XListenerSet enables the Gateway API XListenerSet resource.
142-
XListenerSet GatewayAPI = "XListenerSet"
143-
)
144-
145140
// GatewayAPISettings provides a mechanism to opt into experimental Gateway API resources.
146141
// These APIs are experimental today and are subject to change or removal as they mature.
147142
type GatewayAPISettings struct {

api/v1alpha1/envoyproxy_types.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ type EnvoyProxySpec struct {
132132
//
133133
// - envoy.filters.http.wasm
134134
//
135+
// - envoy.filters.http.dynamic_modules
136+
//
135137
// - envoy.filters.http.rbac
136138
//
137139
// - envoy.filters.http.local_ratelimit
@@ -182,6 +184,20 @@ type EnvoyProxySpec struct {
182184
// Default: Strict
183185
// +optional
184186
LuaValidation *LuaValidation `json:"luaValidation,omitempty"`
187+
188+
// DynamicModules defines the set of dynamic modules that are allowed to be
189+
// used by EnvoyExtensionPolicy resources. Each entry registers a module by
190+
// a logical name and specifies the shared library that Envoy will load.
191+
//
192+
// The EnvoyProxy owner is responsible for ensuring the module .so files are available
193+
// on the proxy container's filesystem (e.g., via init containers, custom images,
194+
// or shared volumes).
195+
//
196+
// +kubebuilder:validation:MaxItems=16
197+
// +listType=map
198+
// +listMapKey=name
199+
// +optional
200+
DynamicModules []DynamicModuleEntry `json:"dynamicModules,omitempty"`
185201
}
186202

187203
// +kubebuilder:validation:Enum=Strict;InsecureSyntax;Disabled
@@ -248,7 +264,7 @@ type FilterPosition struct {
248264
}
249265

250266
// EnvoyFilter defines the type of Envoy HTTP filter.
251-
// +kubebuilder:validation:Enum=envoy.filters.http.custom_response;envoy.filters.http.health_check;envoy.filters.http.fault;envoy.filters.http.admission_control;envoy.filters.http.cors;envoy.filters.http.header_mutation;envoy.filters.http.ext_authz;envoy.filters.http.api_key_auth;envoy.filters.http.basic_auth;envoy.filters.http.oauth2;envoy.filters.http.jwt_authn;envoy.filters.http.stateful_session;envoy.filters.http.buffer;envoy.filters.http.lua;envoy.filters.http.ext_proc;envoy.filters.http.wasm;envoy.filters.http.rbac;envoy.filters.http.local_ratelimit;envoy.filters.http.ratelimit;envoy.filters.http.grpc_web;envoy.filters.http.grpc_stats;envoy.filters.http.credential_injector;envoy.filters.http.compressor;envoy.filters.http.dynamic_forward_proxy
267+
// +kubebuilder:validation:Enum=envoy.filters.http.custom_response;envoy.filters.http.health_check;envoy.filters.http.fault;envoy.filters.http.admission_control;envoy.filters.http.cors;envoy.filters.http.header_mutation;envoy.filters.http.ext_authz;envoy.filters.http.api_key_auth;envoy.filters.http.basic_auth;envoy.filters.http.oauth2;envoy.filters.http.jwt_authn;envoy.filters.http.stateful_session;envoy.filters.http.buffer;envoy.filters.http.lua;envoy.filters.http.ext_proc;envoy.filters.http.wasm;envoy.filters.http.dynamic_modules;envoy.filters.http.rbac;envoy.filters.http.local_ratelimit;envoy.filters.http.ratelimit;envoy.filters.http.grpc_web;envoy.filters.http.grpc_stats;envoy.filters.http.credential_injector;envoy.filters.http.compressor;envoy.filters.http.dynamic_forward_proxy
252268
type EnvoyFilter string
253269

254270
const (
@@ -301,6 +317,9 @@ const (
301317
// EnvoyFilterWasm defines the Envoy HTTP WebAssembly filter.
302318
EnvoyFilterWasm EnvoyFilter = "envoy.filters.http.wasm"
303319

320+
// EnvoyFilterDynamicModules defines the Envoy HTTP dynamic modules filter.
321+
EnvoyFilterDynamicModules EnvoyFilter = "envoy.filters.http.dynamic_modules"
322+
304323
// EnvoyFilterRBAC defines the Envoy RBAC filter.
305324
EnvoyFilterRBAC EnvoyFilter = "envoy.filters.http.rbac"
306325

0 commit comments

Comments
 (0)