cec: support for explicit control of Cilium Envoy filter injection#5
Open
MitchLewis930 wants to merge 1 commit intopr_045_beforefrom
Open
cec: support for explicit control of Cilium Envoy filter injection#5MitchLewis930 wants to merge 1 commit intopr_045_beforefrom
MitchLewis930 wants to merge 1 commit intopr_045_beforefrom
Conversation
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>
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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.parseResourcesto take a separateinjectCiliumEnvoyFiltersflag (decoupled fromisL7LB), and wires this through CEC update/delete and the experimental reflector so filter injection can be overridden even whenspec.servicesis 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.