Skip to content

Commit 2600b2d

Browse files
committed
api: adds AllowModeOverride for extproc
Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent 4d560a2 commit 2600b2d

File tree

7 files changed

+18
-1
lines changed

7 files changed

+18
-1
lines changed

api/v1alpha1/ext_proc_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ type ExtProc struct {
9090
//
9191
// +optional
9292
Metadata *ExtProcMetadata `json:"metadata,omitempty"`
93+
94+
// AllowModeOverride allows the external processor to override the processing mode set via the
95+
// `mode_override` field in the gRPC response message. This defaults to false.
96+
//
97+
// +optional
98+
AllowModeOverride bool `json:"allowModeOverride,omitempty"`
9399
}
94100

95101
// ExtProcMetadata defines options related to the sending and receiving of dynamic metadata to and from the

charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ spec:
5454
description: ExtProc defines the configuration for External Processing
5555
filter.
5656
properties:
57+
allowModeOverride:
58+
description: |-
59+
AllowModeOverride allows the external processor to override the processing mode set via the
60+
`mode_override` field in the gRPC response message. This defaults to false.
61+
type: boolean
5762
backendRef:
5863
description: |-
5964
BackendRef references a Kubernetes object that represents the

internal/gatewayapi/envoyextensionpolicy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ func (t *Translator) buildExtProc(
511511
}
512512
}
513513

514+
extProcIR.AllowModeOverride = extProc.AllowModeOverride
514515
return extProcIR, err
515516
}
516517

internal/ir/xds.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,6 +2787,9 @@ type ExtProc struct {
27872787

27882788
// ReceivingMetadataNamespaces are metadata namespaces updatable by external processor
27892789
ReceivingMetadataNamespaces []string `json:"receivingMetadataNamespaces,omitempty" yaml:"receivingMetadataNamespaces,omitempty"`
2790+
2791+
// AllowModeOverride allows the external processor to modify the processing mode.
2792+
AllowModeOverride bool `json:"allowModeOverride,omitempty" yaml:"allowModeOverride,omitempty"`
27902793
}
27912794

27922795
// Wasm holds the information associated with the Wasm extensions.

internal/xds/translator/extproc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func extProcConfig(extProc ir.ExtProc) *extprocv3.ExternalProcessor {
168168
}
169169
}
170170
}
171-
171+
config.AllowModeOverride = extProc.AllowModeOverride
172172
return config
173173
}
174174

site/content/en/latest/api/extension_types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,7 @@ _Appears in:_
15561556
| `failOpen` | _boolean_ | false | | FailOpen defines if requests or responses that cannot be processed due to connectivity to the<br />external processor are terminated or passed-through.<br />Default: false |
15571557
| `processingMode` | _[ExtProcProcessingMode](#extprocprocessingmode)_ | false | | ProcessingMode defines how request and response body is processed<br />Default: header and body are not sent to the external processor |
15581558
| `metadata` | _[ExtProcMetadata](#extprocmetadata)_ | false | | Refer to Kubernetes API documentation for fields of `metadata`. |
1559+
| `allowModeOverride` | _boolean_ | false | | AllowModeOverride allows the external processor to override the processing mode set via the<br />`mode_override` field in the gRPC response message. This defaults to false. |
15591560

15601561

15611562
#### ExtProcBodyProcessingMode

site/content/zh/latest/api/extension_types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,7 @@ _Appears in:_
15561556
| `failOpen` | _boolean_ | false | | FailOpen defines if requests or responses that cannot be processed due to connectivity to the<br />external processor are terminated or passed-through.<br />Default: false |
15571557
| `processingMode` | _[ExtProcProcessingMode](#extprocprocessingmode)_ | false | | ProcessingMode defines how request and response body is processed<br />Default: header and body are not sent to the external processor |
15581558
| `metadata` | _[ExtProcMetadata](#extprocmetadata)_ | false | | Refer to Kubernetes API documentation for fields of `metadata`. |
1559+
| `allowModeOverride` | _boolean_ | false | | AllowModeOverride allows the external processor to override the processing mode set via the<br />`mode_override` field in the gRPC response message. This defaults to false. |
15591560

15601561

15611562
#### ExtProcBodyProcessingMode

0 commit comments

Comments
 (0)