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>
Greptile OverviewGreptile SummaryThis PR introduces explicit control over Cilium Envoy filter injection through a new annotation Key Changes:
Critical Issue Found:
Confidence Score: 1/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User/K8s API
participant CEC as CEC Manager
participant Helper as injectCiliumEnvoyFilters
participant Parser as CEC Resource Parser
participant Envoy as Envoy Config
User->>CEC: Create/Update CiliumEnvoyConfig
Note over User,CEC: With annotation cec.cilium.io/inject-cilium-filters
CEC->>Helper: injectCiliumEnvoyFilters(metadata, spec)
alt Annotation exists
Helper->>Helper: Parse annotation value
alt Valid boolean
Helper-->>CEC: Return parsed boolean
else Invalid value
Helper-->>CEC: Fall back to len(spec.Services) > 0
end
else No annotation
Helper-->>CEC: Return len(spec.Services) > 0
end
CEC->>Parser: parseResources(..., injectCiliumEnvoyFilters, ...)
alt injectCiliumEnvoyFilters == true
Parser->>Parser: Inject Cilium Network filters
Parser->>Parser: Inject Cilium L7 filters
Parser-->>CEC: Resources with Cilium filters
else injectCiliumEnvoyFilters == false
Parser-->>CEC: Resources without Cilium filters
end
CEC->>Envoy: Apply Envoy configuration
|
Comment on lines
92
to
+93
| len(cecSpec.Services) > 0, | ||
| len(cecSpec.Services) > 0, |
There was a problem hiding this comment.
incorrect parameter passed to parseResources - should call injectCiliumEnvoyFilters(&cecObjectMeta, cecSpec) instead of len(cecSpec.Services) > 0
Suggested change
| len(cecSpec.Services) > 0, | |
| len(cecSpec.Services) > 0, | |
| len(cecSpec.Services) > 0, | |
| injectCiliumEnvoyFilters(&cecObjectMeta, cecSpec), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: pkg/ciliumenvoyconfig/cec_manager.go
Line: 92:93
Comment:
incorrect parameter passed to `parseResources` - should call `injectCiliumEnvoyFilters(&cecObjectMeta, cecSpec)` instead of `len(cecSpec.Services) > 0`
```suggestion
len(cecSpec.Services) > 0,
injectCiliumEnvoyFilters(&cecObjectMeta, cecSpec),
```
How can I resolve this? If you propose a fix, please make it concise.
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