[release/0.8] Cherry-pick hcn feature check improvements#1130
Merged
dcantah merged 5 commits intomicrosoft:release/0.8from Aug 26, 2021
Merged
[release/0.8] Cherry-pick hcn feature check improvements#1130dcantah merged 5 commits intomicrosoft:release/0.8from
dcantah merged 5 commits intomicrosoft:release/0.8from
Conversation
Kubeproxy logs are filled with redudnant version check spam from an unexported call that's invoked as part of checking if a feature is supported. The logs don't detail what feature(s) are even being checked so it just seems like spam. With the way things are implemented all of the hcn features are checked for support in any of the `hcn.XSupported()` calls not just the one being checked, so these logs come up quite a bit if there's many features that aren't supported on the machine. Add two new logs in a sync.Once that logs the HNS version and supported features. This should be enough to investigate version issues. Should remedy microsoft#1043 Signed-off-by: Daniel Canter <dcanter@microsoft.com> (cherry picked from commit 6288bb9) Signed-off-by: Daniel Canter <dcanter@microsoft.com>
To avoid a breaking change on GetSupportedFeatures introduce a new GetCachedSupportedFeatures method. This method does the feature check and version parsing once and then assigns a global with the information. This can be used to optimize for situations where many uses of the hcn.IsXSupported methods are going to be used (kube-proxy for example). Signed-off-by: Daniel Canter <dcanter@microsoft.com> (cherry picked from commit 112b5e7) Signed-off-by: Daniel Canter <dcanter@microsoft.com>
- Change versionErr -> featuresErr - Move work inside of the sync.Once out to its own function so we can use standard return err error handling and simply assign the output in GetCachedSupportedFeatures - Mark GetSupportedFeatures as deprecated. Signed-off-by: Daniel Canter <dcanter@microsoft.com> (cherry picked from commit f78d0ff) Signed-off-by: Daniel Canter <dcanter@microsoft.com>
Signed-off-by: Daniel Canter <dcanter@microsoft.com> (cherry picked from commit 16435c7) Signed-off-by: Daniel Canter <dcanter@microsoft.com>
Signed-off-by: Daniel Canter <dcanter@microsoft.com> (cherry picked from commit 57c5d60) Signed-off-by: Daniel Canter <dcanter@microsoft.com>
Contributor
|
lgtm |
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.
This PR cherry-picks some hcn feature checking and logging improvements that will be helpful for k8s.
From: