-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add additional information to the error message #30
Conversation
Signed-off-by: hlts2 <[email protected]>
Signed-off-by: hlts2 <[email protected]>
csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER: struct{}{}, | ||
csi.VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY: struct{}{}, |
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.
Note
Since the struct specifications is not necessary, it has been removed 🙏
@@ -105,10 +105,10 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) | |||
availableSize := int64(quota.DiskGigabytesLimit - quota.DiskGigabytesUsage) | |||
if availableSize < desiredSize { | |||
log.Error().Msg("Requested volume would exceed storage quota available") | |||
return nil, status.Error(codes.OutOfRange, fmt.Sprintf("Requested volume would exceed volume space quota by %d GB", desiredSize-availableSize)) |
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.
Note
I changed it to pass the arguments directory to status.Errorf
, which achieves the same result.
This makes the implementation simpler.
@RealHarshThakur @rytswd |
WHAT
Add additional information, such as the volume id and current state ..etc, to error returned by the handler
WHY
To make it easier to identify the cause of issue by including more detailed information in the error messages, improving debugging efficiency.
FYI
💡 There are no logic changes to this PR.