TIS0801 - ADD
Operation Ignored for applyTo
Set to ROUTE_CONFIGURATION
or HTTP_ROUTE
The ADD
operation will be ignored when applyTo
is set to ROUTE_CONFIGURATION
or HTTP_ROUTE
.
ADD
Operation is Used with Compatible applyTo
ValuesTo prevent configuration errors, either remove the ADD
operation when applyTo
is set to ROUTE_CONFIGURATION
or HTTP_ROUTE
, or change applyTo
to a compatible value, such as CLUSTER
.
Examples
-
Incorrect
ADD
Operation withapplyTo
FieldapiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: invalid-add-operation
namespace: example-namespace
spec:
configPatches:
- applyTo: ROUTE_CONFIGURATION
match:
context: GATEWAY
patch:
operation: ADD
value:
name: "new-route-config"Explanation: The
EnvoyFilter
specifies anADD
operation withapplyTo
set toROUTE_CONFIGURATION
, but theADD
operation is not valid forROUTE_CONFIGURATION
orHTTP_ROUTE
. As a result, the configuration will be ignored.
Recommendation
Remove the ADD
operation or change the applyTo
field to a valid value.
-
Remove the
ADD
OperationIf the
ADD
operation is not necessary, remove it to ensure the configuration is valid.apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: corrected-operation
namespace: example-namespace
spec:
configPatches:
- applyTo: ROUTE_CONFIGURATION
match:
context: GATEWAY
patch:
operation: MERGE
value:
name: "existing-route-config"Explanation: By changing the operation from
ADD
toMERGE
, the configuration is now valid forapplyTo: ROUTE_CONFIGURATION
. -
Change
applyTo
to a Valid Value forADD
If the intention is to add a new configuration, change the
applyTo
field to a value that supports theADD
operation.apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: add-operation-corrected
namespace: example-namespace
spec:
configPatches:
- applyTo: CLUSTER
match:
context: SIDECAR_OUTBOUND
patch:
operation: ADD
value:
name: "new-cluster"Explanation: Changing
applyTo
toCLUSTER
allows theADD
operation to be used, as adding clusters is a valid action for thisapplyTo
value.