-
Notifications
You must be signed in to change notification settings - Fork 233
MGMT-18930: Consolidate static network configuration log messages #7592
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
MGMT-18930: Consolidate static network configuration log messages #7592
Conversation
@yoavsc0302: This pull request references MGMT-18930 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.19.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7592 +/- ##
==========================================
+ Coverage 67.32% 67.56% +0.24%
==========================================
Files 335 335
Lines 42344 42658 +314
==========================================
+ Hits 28509 28824 +315
- Misses 11263 11266 +3
+ Partials 2572 2568 -4
🚀 New features to boost your workflow:
|
pkg/staticnetworkconfig/generator.go
Outdated
if len(connectionFileNames) > 0 { | ||
s.log.Infof("Adding NMConnection files: <%s>", strings.Join(connectionFileNames, ">, <")) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(connectionFileNames) > 0 { | |
s.log.Infof("Adding NMConnection files: <%s>", strings.Join(connectionFileNames, ">, <")) | |
} | |
if len(filesList) > 0 { | |
s.log.Infof("Adding NMConnection files: <%s>", | |
strings.Join(lo.Map(filesList, func(f StaticNetworkConfigData, _ int) string { | |
return filepath.Base(f.FilePath) | |
}), ">, <"), | |
) | |
} |
What do you think?
I'm not sure which approach is better, but AFAIK, using append can be less efficient in terms of performance. I'm also not sure if it's worth creating a new list and using append just for an info log...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you. I've changed that accordingly in the commit to improve performance after testing it passes the tests and works correctly in test-infra.
This commit changes the logging behavior in the StaticNetworkConfigGenerator to reduce log verbosity by consolidating multiple individual "Adding NMConnection file" log messages into a single message. Instead of logging each NM connection file separately, the code now collects all file names and outputs them in a single log entry.
98732ed
to
ab72088
Compare
/test ? |
@linoyaslan: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test edge-e2e-metal-assisted-static-ip-suite-4-14 |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: linoyaslan, yoavsc0302 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest |
/retest |
@yoavsc0302: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
f16bd90
into
openshift:master
[ART PR BUILD NOTIFIER] Distgit: ose-agent-installer-api-server |
This commit changes the logging behavior in the StaticNetworkConfigGenerator to reduce log verbosity by consolidating multiple individual "Adding NMConnection file" log messages into a single message. Instead of logging each NM connection file separately, the code now collects all file names and outputs them in a single log entry.
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Checklist
docs
, README, etc)Reviewers Checklist