-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Issue 8032: make node agent configMap name configurable #8097
Issue 8032: make node agent configMap name configurable #8097
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8097 +/- ##
==========================================
+ Coverage 58.77% 59.01% +0.23%
==========================================
Files 358 364 +6
Lines 30070 30270 +200
==========================================
+ Hits 17674 17864 +190
- Misses 10949 10960 +11
+ Partials 1447 1446 -1 ☔ View full report in Codecov by Sentry. |
78c087d
to
deff3c8
Compare
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.
lgtm
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.
LGTM.
pkg/cmd/cli/nodeagent/server.go
Outdated
return | ||
} | ||
|
||
if configs == nil { | ||
s.logger.Infof("Node agent configs are not found") | ||
s.logger.WithField("configMap", s.config.nodeAgentConfig).Infof("Node agent configs are not found") |
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.
NIT: Node agent config data is empty/nil
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.
As you can see from nodeagent.GetConfigs
, configs==nil && err ==nil
means the configMap with the name specified by s.config.nodeAgentConfig
is not found, it doesn't mean the configMap data is empty.
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.
The logic seems sound. But IMO its just that when a user sees a not found log they directly interpret it as a Not Found
error, implying that the user specified a config map but velero was unable to fetch/find the config map, but this is not the case here, velero is able to find the config map (as err == nil
) but the config map does not consist of any node agent configs.
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.
@shubham-pampattiwar
I got what you mean. But I think it is not a log problem:
- Now users need to specific the configMap name explicitly, if the configMap is not found, it should be treated as an error by
nodeagent.GetConfigs
as same as other errors (since the configMap is specified by users, we should always assume that the configMap exists) - Then node-agent server will print a warning log and ignore the
specified node-agent-config
parameter
Therefore, I changed the logic a little bit, pls review it.
Signed-off-by: Lyndon-Li <[email protected]>
deff3c8
to
8cf1749
Compare
Fix issue #8032, make node-agent configMap name configurable