Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/0.8] Cherry-pick hcn feature check improvements #1130

Merged
merged 5 commits into from
Aug 26, 2021

Conversation

dcantah
Copy link
Contributor

@dcantah dcantah commented Aug 25, 2021

This PR cherry-picks some hcn feature checking and logging improvements that will be helpful for k8s.

From:

  1. Get rid of redundant logs in HCN version range checks #1053
  2. Add GetCachedSupportedFeatures method to hcn package #1123

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>
@dcantah dcantah requested a review from a team as a code owner August 25, 2021 23:40
Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

lgtm

@ambarve
Copy link
Contributor

ambarve commented Aug 26, 2021

lgtm

@dcantah dcantah merged commit 54f80fb into microsoft:release/0.8 Aug 26, 2021
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.

3 participants