TIS0802 - REMOVE
Operation Ignored for applyTo
Set to ROUTE_CONFIGURATION
or HTTP_ROUTE
The REMOVE
operation will be ignored when applyTo
is set to ROUTE_CONFIGURATION
or HTTP_ROUTE
.
REMOVE
Operation is Used with Compatible applyTo
ValuesTo prevent configuration errors, either remove the REMOVE
operation when applyTo
is set to ROUTE_CONFIGURATION
or HTTP_ROUTE
, or change applyTo
to a compatible value, such as CLUSTER
.
Examples
-
Incorrect
REMOVE
Operation withapplyTo
FieldapiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: invalid-remove-operation
namespace: example-namespace
spec:
configPatches:
- applyTo: ROUTE_CONFIGURATION
match:
context: GATEWAY
patch:
operation: REMOVEExplanation: The
EnvoyFilter
specifies aREMOVE
operation withapplyTo
set toROUTE_CONFIGURATION
, but theREMOVE
operation is not valid forROUTE_CONFIGURATION
orHTTP_ROUTE
. As a result, the configuration will be ignored.
Recommendation
Remove the REMOVE
operation or change the applyTo
field to a valid value.
-
Remove the
REMOVE
OperationIf removing the configuration is not necessary, delete the
REMOVE
operation 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
REMOVE
toMERGE
, the configuration is now valid forapplyTo: ROUTE_CONFIGURATION
. -
Change
applyTo
to a Valid Value forREMOVE
If the intention is to remove an existing configuration, change the
applyTo
field to a value that supports theREMOVE
operation.apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: remove-operation-corrected
namespace: example-namespace
spec:
configPatches:
- applyTo: CLUSTER
match:
context: SIDECAR_OUTBOUND
patch:
operation: REMOVEExplanation: Changing
applyTo
toCLUSTER
allows theREMOVE
operation to be used, as removing clusters is a valid action for thisapplyTo
value.