-
Notifications
You must be signed in to change notification settings - Fork 258
chore: CNS - Only log CreateOrUpdateNetworkContainer on failure #4047
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,9 +567,10 @@ | |
// If the NC was created successfully, log NC snapshot. | ||
if returnCode == types.Success { | ||
logNCSnapshot(req) | ||
} else { | ||
// Only emit response trace/log for non-success responses to avoid noisy success logs. | ||
logger.Response(service.Name, reserveResp, resp.ReturnCode, err) | ||
Check failure on line 572 in cns/restserver/api.go
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as the Lint says, should we switch to cns/logger/v2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this, but want to note: if this logs, it will always result in a redundant log. The only definition of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, I'll leave the logging in |
||
} | ||
|
||
logger.Response(service.Name, reserveResp, resp.ReturnCode, err) | ||
} | ||
|
||
func (service *HTTPRestService) getNetworkContainerByID(w http.ResponseWriter, r *http.Request) { | ||
|
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 variable
reserveResp
appears to be incorrect in this context. Based on the function namecreateOrUpdateNetworkContainer
, this should likely be referencing the create/update response variable, not a reserve response.Copilot uses AI. Check for mistakes.