Skip to content

Commit

Permalink
Add snapshot size to VSC created for VGS
Browse files Browse the repository at this point in the history
Currently the RestoreSize is missing when
the corresponding VSC are created for the
the volumesnapshotgroup, This PR adds the missing
RestoreSize for VSC.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 committed Feb 14, 2024
1 parent ebf903a commit f2e4270
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/sidecar-controller/groupsnapshot_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sidecar-controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,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
}
Expand Down

0 comments on commit f2e4270

Please sign in to comment.