-
Notifications
You must be signed in to change notification settings - Fork 159
Add disk image snapshot support #926
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 disk image snapshot support #926
Conversation
|
Welcome @luohao! |
Hi @luohao. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
pkg/common/utils.go
Outdated
splitId := strings.Split(id, "/") | ||
if len(splitId) != snapshotTotalElements { | ||
return "", "", fmt.Errorf("failed to get id components. Expected projects/{project}/global/snapshot/{name}. Got: %s", id) | ||
return "", "", "", fmt.Errorf("failed to get id components. Expected projects/{project}/global/snapshot/{name}. Got: %s", id) |
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.
Update error message to something like "expected projects/{project}/global/{snapshots|images}/{name}
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, thanks!
/assign @amacaskill Alexis, can you look at this? You're most familiar with our volume cloning code. Note that Han & I agreed offline about removing the paging for listing snapshots (& disk images). We ended up doing a similar thing in the filestore driver. The consumer of ListSnapshots just concatenates all the pages together anyway, so it makes it much easier to combine the disk & snapshot lists if we don't try to maintain the paging too. |
8113c53
to
08422ac
Compare
pkg/gce-pd-csi-driver/controller.go
Outdated
@@ -22,6 +22,8 @@ import ( | |||
"strings" | |||
"time" | |||
|
|||
"github.com/golang/protobuf/ptypes/timestamp" | |||
|
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.
nit: remove extra blank line
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.
Fixed.
case common.DiskImageType: | ||
diskToCreate.SourceImage = snapshotID | ||
default: | ||
return fmt.Errorf("invalid snapshot tyep in snapshot ID: %s", snapshotType) |
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.
nit: type not tyep
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.
Fixed.
LGTM! I just had two small nits to fix. |
08422ac
to
25be424
Compare
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: luohao, mattcary 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
fixes
Which issue(s) this PR fixes:
Fixes #924
Special notes for your reviewer:
Does this PR introduce a user-facing change?: