cilium-cli: Optimized feature detection by running cluster-wide checks once #40715
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.
This PR focuses on optimizing the
detectFeatures
function used in the setup phase of connectivity tests. Currently this function has a per-cilium-agent loop and on every iteration of this loop, it performs various feature detection checks. But the majority of those detection checks are cluster-wide and not specific to an agent. This means that the same detection logic that could run a single time instead ends up running unnecessarily once per agent.This PR moves all those cluster-wide feature detection checks outside of the per agent loop.
Also the
ExtractFromVersionedConfigMap
function is renamed toExtractFromCiliumVersion
as it is not actually extracting anything from the configmap and there is already theExtractFromConfigMap
function that performs feature extraction from the configmap.Please ensure your pull request adheres to the following guidelines:
description and a
Fixes: #XXX
line if the commit addresses a particularGitHub issue.
Fixes: <commit-id>
tag, thenplease add the commit author[s] as reviewer[s] to this issue.