Skip to content

Commit

Permalink
internal/volumes_information.go: reuse constants from pkg/apis/velero/v1
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Nov 22, 2024
1 parent 9f0026d commit 3099a39
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions internal/volume/volumes_information.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ const (

const (
FieldValueIsUnknown string = "unknown"
kopia string = "kopia"
veleroDatamover string = "velero"

//TODO reuse these constants from csi-plugin-for-velero after it's merged into the same repo

CSIDriverNameAnnotation = "velero.io/csi-driver-name"
VolumeSnapshotHandleAnnotation = "velero.io/csi-volumesnapshot-handle"
)

type BackupVolumeInfo struct {
Expand Down Expand Up @@ -647,7 +641,7 @@ func (v *BackupVolumesInformation) generateVolumeInfoFromDataUpload() {
},
SnapshotDataMovementInfo: &SnapshotDataMovementInfo{
DataMover: dataMover,
UploaderType: kopia,
UploaderType: velerov1api.BackupRepositoryTypeKopia,
OperationID: operation.Spec.OperationID,
Phase: dataUpload.Status.Phase,
},
Expand Down Expand Up @@ -850,9 +844,9 @@ func (t *RestoreVolumeInfoTracker) Result() []*RestoreVolumeInfo {
SnapshotDataMoved: false,
RestoreMethod: CSISnapshot,
CSISnapshotInfo: &CSISnapshotInfo{
SnapshotHandle: csiSnapshot.Annotations[VolumeSnapshotHandleAnnotation],
SnapshotHandle: csiSnapshot.Annotations[velerov1api.VolumeSnapshotHandleAnnotation],
Size: restoreSize,
Driver: csiSnapshot.Annotations[CSIDriverNameAnnotation],
Driver: csiSnapshot.Annotations[velerov1api.DriverNameAnnotation],
VSCName: vscName,
},
}
Expand Down Expand Up @@ -889,7 +883,7 @@ func (t *RestoreVolumeInfoTracker) Result() []*RestoreVolumeInfo {
RestoreMethod: CSISnapshot,
SnapshotDataMovementInfo: &SnapshotDataMovementInfo{
DataMover: dataMover,
UploaderType: kopia,
UploaderType: velerov1api.BackupRepositoryTypeKopia,
SnapshotHandle: dd.Spec.SnapshotID,
OperationID: operationID,
},
Expand Down

0 comments on commit 3099a39

Please sign in to comment.