-
Notifications
You must be signed in to change notification settings - Fork 7
Include the return code only if Backend has no ReturnCode #124
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
Conversation
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
6b31d3e
to
2a0d7bb
Compare
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
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.
Can you please provide actual logs with these changes
} | ||
//If the CSIError is not empty | ||
if msg.CSIError != "" { | ||
return fmt.Sprintf("{RequestID: %s, Code: %s, Description: %s, Error: %s, Action: %s}", msg.RequestID, msg.Code, msg.Description, msg.CSIError, msg.Action) | ||
} | ||
return fmt.Sprintf("{RequestID: %s, Code: %s, Description: %s, Action: %s}", msg.RequestID, msg.Code, msg.Description, msg.Action) |
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.
When this will be used?
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.
This will be used for all existing errors we populated from cSI Driver. Check the logs from below existing CSI and new CSI error. The backend will use getCSIBackendError
https://github.ibm.com/alchemy-containers/armada-storage/issues/6171#issuecomment-106016766
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.
Added documentation with example
pkg/messages/messages.go
Outdated
userMsg.RequestID = requestID | ||
userMsg.BackendError = backendError | ||
|
||
logger.Error("FAILED CSI ERROR", zap.Error(userMsg)) |
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.
Can we add FIELD WITH BACKEND ERROR
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.
Ok this can be done
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.
Done
pkg/messages/messages.go
Outdated
if err != nil { | ||
backendError = err.Error() | ||
} | ||
if strings.Contains(backendError, RC5XX) { |
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.
Can you add code comments here
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.
done
@@ -176,4 +176,7 @@ const ( | |||
|
|||
// SubnetFindFailed ... | |||
SubnetFindFailed = "SubnetFindFailed" | |||
|
|||
// RC5XX | |||
RC5XX = "RC:5" |
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.
hope this will not cause any issue like existing string contains "RC: 500" or " RC : 501 " etc
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.
We have 2 ways to get RC one from the RIAAS backend we know it is RC:5xx or RC:4xx and other way is via our defined messages which does not have space. So we should be good. Please check here https://github.com/IBM/ibmcloud-volume-interface/pull/48/files and example o/p
https://github.ibm.com/alchemy-containers/armada-storage/issues/6171#issuecomment-106016766
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.
Done
https://github.ibm.com/alchemy-containers/armada-storage/issues/6171#issuecomment-106016766 |
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
pkg/messages/messages.go
Outdated
@@ -42,9 +44,23 @@ func (msg Message) Error() string { | |||
|
|||
// Info ... | |||
func (msg Message) Info() string { | |||
/*If the BackendError is from library e.g BackendError: {Trace Code:920df6e8-6be9-4b4a-89e4-837ecb3f513d, | |||
Code:volume_profile_capacity_iops_invalid,Description:The capacity or IOPS specified in the request is not valid for the custom profile, |
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.
can we remove reference of any storage related comments ?
apart from this PR looks good
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.
Updated @arahamad
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
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
No description provided.