-
Notifications
You must be signed in to change notification settings - Fork 238
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
disk-snapshot: support volume group snapshot APIs #1176
base: master
Are you sure you want to change the base?
disk-snapshot: support volume group snapshot APIs #1176
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AlbeeSo The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
24708a0
to
e0cd772
Compare
e0cd772
to
b51622a
Compare
5fda71e
to
74feccb
Compare
74feccb
to
7c15aef
Compare
return | ||
} | ||
|
||
if disk.MultiAttach != DiskMultiAttachDisabled { |
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.
ECS limitation? add related docs here
if !match { | ||
klog.Errorf("CreateVolumeGroupSnapshot:: GroupSnapshot already exist with same name: name[%s], but with different SourceVolumeIDs[%v]", req.Name, sourceVolumeIds) | ||
err := status.Errorf(codes.AlreadyExists, "groupSnapshot with the same name: %s but with different SourceVolumeIds already exist", req.GetName()) | ||
utils.CreateEvent(cs.recorder, ref, v1.EventTypeWarning, snapshotAlreadyExist, err.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.
Does the snapshot sidecar report events by default? If so , there's no need to report events in the CSI driver.
return &ecsParams, nil | ||
} | ||
|
||
func parseGroupSnapshotParameters(params map[string]string, ecsParams *createGroupSnapshotParams) (err 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.
ut test absent?
// if volumesnapshot have Annotations, use it first. | ||
// storage.alibabacloud.com/snapshot-ttl | ||
func parseGroupSnapshotAnnotations(anno map[string]string, ecsParams *createGroupSnapshotParams) error { | ||
snapshotTTL := anno["storage.alibabacloud.com/snapshot-ttl"] |
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.
Make annotation key const
nCapacityInGiB = capacityInGiB | ||
|
||
switch disk.Category { | ||
case string(DiskESSD), string(DiskESSDAuto): |
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.
Don't use switch, add a new field to CategoryDesc instead. So that we will not forget this when we add more disk type.
var capacityInGiB int | ||
var err error | ||
for _, sourceVolumeId := range sourceVolumeIds { | ||
disks := getDisk(sourceVolumeId, GlobalConfigVar.EcsClient) |
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.
Retrieve all the disk in one DescribeDisks request? BTW, do we really need to do all these validations? Why not just let ECS do the validation and we just check the error code.
This PR will:
alibabacloud-disk-group-snapshot
EnableVolumeGroupSnapshots=true
pls test with yaml like:
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
VolumeGroupSnapshot need K8s >= 1.27
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: