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

Issue 8032: make node agent configMap name configurable #8097

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

Lyndon-Li
Copy link
Contributor

Fix issue #8032, make node-agent configMap name configurable

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 59.01%. Comparing base (dd3d05b) to head (8cf1749).
Report is 27 commits behind head on main.

Files Patch % Lines
pkg/cmd/cli/nodeagent/server.go 75.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

reasonerjt
reasonerjt previously approved these changes Aug 15, 2024
Copy link
Contributor

@reasonerjt reasonerjt left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

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

LGTM.

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")
Copy link
Collaborator

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

Copy link
Contributor Author

@Lyndon-Li Lyndon-Li Aug 16, 2024

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

@Lyndon-Li Lyndon-Li Aug 19, 2024

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.

@shubham-pampattiwar shubham-pampattiwar merged commit 86963bf into vmware-tanzu:main Aug 19, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants