Merge pull request #1011 from Madhu-1/fix-size-vsc
Add snapshot size to VSC created for VGS
This commit is contained in:
@@ -477,6 +477,11 @@ func (ctrl *csiSnapshotSideCarController) createGroupSnapshotWrapper(groupSnapsh
|
||||
if err != nil {
|
||||
return groupSnapshotContent, err
|
||||
}
|
||||
|
||||
_, err = ctrl.updateSnapshotContentStatus(volumeSnapshotContent, snapshot.SnapshotId, snapshot.ReadyToUse, snapshot.CreationTime.AsTime().UnixNano(), snapshot.SizeBytes, groupSnapshotID)
|
||||
if err != nil {
|
||||
return groupSnapshotContent, err
|
||||
}
|
||||
}
|
||||
|
||||
newGroupSnapshotContent, err := ctrl.updateGroupSnapshotContentStatus(groupSnapshotContent, groupSnapshotID, readyToUse, creationTime.UnixNano(), snapshotContentNames)
|
||||
|
@@ -446,11 +446,13 @@ func (ctrl *csiSnapshotSideCarController) updateSnapshotContentStatus(
|
||||
SnapshotHandle: &snapshotHandle,
|
||||
ReadyToUse: &readyToUse,
|
||||
CreationTime: &createdAt,
|
||||
RestoreSize: &size,
|
||||
}
|
||||
if groupSnapshotID != "" {
|
||||
newStatus.VolumeGroupSnapshotHandle = &groupSnapshotID
|
||||
}
|
||||
if size > 0 {
|
||||
newStatus.RestoreSize = &size
|
||||
}
|
||||
updated = true
|
||||
} else {
|
||||
newStatus = contentObj.Status.DeepCopy()
|
||||
@@ -469,7 +471,7 @@ func (ctrl *csiSnapshotSideCarController) updateSnapshotContentStatus(
|
||||
newStatus.CreationTime = &createdAt
|
||||
updated = true
|
||||
}
|
||||
if newStatus.RestoreSize == nil {
|
||||
if newStatus.RestoreSize == nil && size > 0 {
|
||||
newStatus.RestoreSize = &size
|
||||
updated = true
|
||||
}
|
||||
|
Reference in New Issue
Block a user