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

Fix raw pointer log in EnableFastSnapshotRestores #2334

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

torredil
Copy link
Member

What type of PR is this?

/kind bug

What is this PR about? / Why do we need it?

Currently, there is a logging issue in cloud.EnableFastSnapshotRestores which surfaces because the existing code is printing out raw pointers from the error structures rather than their underlying string values. With this cc, we explicitly extract the error code and error message from each failed FSR operation and consolidate them into a single, readable error message.

How was this change tested?

Exceed the regional FSR limit to induce the error, which can be reviewed by looking at the controller logs.

Without this patch:

E0210 16:42:42.944417       1 driver.go:108] "GRPC error" err="rpc error: code = Internal desc = Failed to create Fast Snapshot Restores for snapshot ID \"snapshot-1c0d40ba-7170-40e9-aac0-ccf9b8cd004d\": failed to create fast snapshot restores for snapshot snap-08e035467a65daf9f: [{[{0xc00080f650 0xc00092b668 {}}] 0xc00080f680 {}}]"

With this patch:

E0210 18:32:56.934997       1 driver.go:108] "GRPC error" err="rpc error: code = Internal desc = Failed to create Fast Snapshot Restores for snapshot ID \"snapshot-1c0d40ba-7170-40e9-aac0-ccf9b8cd004d\": Error Code: FastSnapshotRestoreLimitExceeded, Error Message: Your account's regional limit would be exceeded by your request to enable fast snapshot restore on snapshot 'snap-02946ca3646445835' in Availability Zone 'us-east-1f'"

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 10, 2025
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 10, 2025
Copy link

Code Coverage Diff

File Old Coverage New Coverage Delta
github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/cloud/cloud.go 88.9% 88.4% -0.5

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 11, 2025
Copy link
Member

@ElijahQuinones ElijahQuinones left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ElijahQuinones

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 11, 2025
@k8s-ci-robot k8s-ci-robot merged commit 8b7de7e into kubernetes-sigs:master Feb 11, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants