Skip to content

Comments

cec: support for explicit control of Cilium Envoy filter injection#5

Open
MitchLewis930 wants to merge 1 commit intopr_045_beforefrom
pr_045_after
Open

cec: support for explicit control of Cilium Envoy filter injection#5
MitchLewis930 wants to merge 1 commit intopr_045_beforefrom
pr_045_after

Conversation

@MitchLewis930
Copy link

@MitchLewis930 MitchLewis930 commented Jan 30, 2026

PR_045


Note

Medium Risk
Changes affect how Envoy listeners/filters are constructed from CEC resources, which can alter proxy behavior and policy enforcement; coverage was added, but behavior differences may impact existing L7 LB deployments relying on implicit injection.

Overview
Adds a new CEC annotation, cec.cilium.io/inject-cilium-filters, to explicitly enable/disable automatic injection of Cilium Envoy network/L7 filters.

Refactors cec_resource_parser.parseResources to take a separate injectCiliumEnvoyFilters flag (decoupled from isL7LB), and wires this through CEC update/delete and the experimental reflector so filter injection can be overridden even when spec.services is present (or forced when it’s absent). Tests are updated and expanded to cover the new override behavior, including a case ensuring missing Cilium filters are not auto-added when injection is disabled.

Written by Cursor Bugbot for commit 97eba0e. This will update automatically on new commits. Configure here.

Currently, the Cilium Envoy network- and L7 filters are always automatically
injected when the CiliumEnvoyConfig is used for L7LB (parameter `isL7LB` - that
is set to true when `Spec.Services` are defined on the CEC).

This commit adds the possibility for a more explicit configuration of this
behaviour by adding the annotation `cec.cilium.io/inject-cilium-filters`.

If the annotation is present on the `CiliumEnvoyConfig` it is used to decide
whether Cilium Envoy filters should be automatically injected or not.

Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

cecObjectMeta.GetName(),
cecSpec.Resources,
len(cecSpec.Services) > 0,
len(cecSpec.Services) > 0,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation for filter injection ignored during CEC add

High Severity

In addCiliumEnvoyConfig, the fifth parameter to parseResources is len(cecSpec.Services) > 0 instead of injectCiliumEnvoyFilters(&cecObjectMeta, cecSpec). This means the cec.cilium.io/inject-cilium-filters annotation is ignored when adding a new CEC, breaking the explicit control feature that this PR aims to introduce. The annotation works correctly in updateCiliumEnvoyConfig, deleteCiliumEnvoyConfig, and exp_reflector.go, but not here.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants