-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify design according to comments. Add PVInfo structure. Signed-off-by: Xun Jiang <[email protected]>
- Loading branch information
Xun Jiang
committed
Nov 7, 2023
1 parent
6b7ce66
commit 5724f83
Showing
4 changed files
with
138 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add VolumeInfo metadata structures. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package volume | ||
|
||
type VolumeInfoVersion struct { | ||
Version string `json:"version"` | ||
} | ||
|
||
const ( | ||
VolumeInfoVersionV1 string = "1" | ||
) | ||
|
||
type VolumeInfos struct { | ||
VolumeInfosV1 []VolumeInfoV1 | ||
Version string | ||
} | ||
|
||
// CSISnapshotInfo is used for displaying the CSI snapshot status | ||
type CSISnapshotInfo struct { | ||
// The actual snapshot ID. It's the storage provider's snapshot ID for CSI. | ||
SnapshotHandle string `json:"snapshotHandle"` | ||
|
||
// The snapshot corresponding volume size. Some of the volume backup methods cannot retrieve the data by current design, for example, the Velero native snapshot. | ||
Size int64 `json:"size"` | ||
|
||
// The name of the CSI driver. | ||
Driver string `json:"driver"` | ||
|
||
// The name of the VolumeSnapshotContent. | ||
VSCName string `json:"vscName"` | ||
} | ||
|
||
// SnapshotDataMoveInfo is used for displaying the snapshot data mover status. | ||
type SnapshotDataMoveInfo struct { | ||
// The data mover used by the backup. The valid values are `velero` and ``(equals to `velero`). | ||
DataMover string `json:"dataMover"` | ||
|
||
// The type of the uploader that uploads the snapshot data. The valid values are `kopia` and `restic`. It's useful for file-system backup and snapshot data mover. | ||
UploaderType string `json:"uploaderType"` | ||
|
||
// The name or ID of the snapshot associated object(SAO). | ||
RetainedSnapshot string `json:"retainedSnapshot"` | ||
} | ||
|
||
// VeleroNativeSnapshotInfo is used for displaying the Velero native snapshot status. | ||
type VeleroNativeSnapshotInfo struct { | ||
// The actual snapshot ID. It's the storage provider's snapshot ID for the Velero-native snapshot. | ||
SnapshotHandle string `json:"snapshotHandle"` | ||
|
||
// The snapshot corresponding volume size. Some of the volume backup methods cannot retrieve the data by current design, for example, the Velero native snapshot. | ||
Size int64 `json:"size"` | ||
|
||
// The cloud provider snapshot volume type. | ||
VolumeType string `json:"volumeType"` | ||
|
||
// The cloud provider snapshot volume's availability zones. | ||
VolumeAZ string `json:"volumeAZ"` | ||
|
||
// The cloud provider snapshot volume's IOPS. | ||
IOPS string `json:"iops"` | ||
} | ||
|
||
// PodVolumeBackupInfo is used for displaying the PodVolumeBackup snapshot status. | ||
type PodVolumeBackupInfo struct { | ||
// The actual snapshot ID. It's the file-system uploader's snapshot ID for PodVolumeBackup. | ||
SnapshotHandle string `json:"snapshotHandle"` | ||
|
||
// The snapshot corresponding volume size. Some of the volume backup methods cannot retrieve the data by current design, for example, the Velero native snapshot. | ||
Size int64 `json:"size"` | ||
|
||
// The type of the uploader that uploads the data. The valid values are `kopia` and `restic`. It's useful for file-system backup and snapshot data mover. | ||
UploaderType string `json:"uploaderType"` | ||
|
||
// The PVC's corresponding volume name used by Pod | ||
VolumeName string `json:"volumeName"` | ||
|
||
// The Pod name mounting this PVC. The format should be <namespace-name>/<pod-name>. | ||
PodName string `json:"podName"` | ||
|
||
// The PVB-taken k8s node's name. | ||
NodeName string `json:"nodeName"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package volume | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
type VolumeInfosV1 struct { | ||
Infos []VolumeInfoV1 `json:"infos"` | ||
|
||
// VolumeInfo structure's version information. | ||
Version string `json:"version"` | ||
} | ||
|
||
type VolumeInfoV1 struct { | ||
// The PVC's name. The format should be <namespace-name>/<PVC-name> | ||
PVCName string `json:"pvcName"` | ||
|
||
// The PV name. | ||
PVName string `json:"pvName"` | ||
|
||
// The way the volume data is backed up. The valid value includes `VeleroNativeSnapshot`, `PodVolumeBackup` and `CSISnapshot`. | ||
BackupMethod string `json:"backupMethod,omitempty"` | ||
|
||
// Whether the volume's snapshot data is moved to specified storage. | ||
SnapshotDataMovement bool `json:"snapshotDataMovement"` | ||
|
||
// Whether the Volume is skipped in this backup. | ||
Skipped bool `json:"skipped"` | ||
|
||
// The reason for the volume is skipped in the backup. | ||
SkippedReason string `json:"skippedReason,omitempty"` | ||
|
||
// Snapshot starts timestamp. | ||
StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"` | ||
|
||
CSISnapshotInfo CSISnapshotInfo `json:"csiSnapshotInfo,omitempty"` | ||
SnapshotDataMoveInfo SnapshotDataMoveInfo `json:"snapshotDataMoveInfo,omitempty"` | ||
NativeSnapshotInfo VeleroNativeSnapshotInfo `json:"nativeSnapshotInfo,omitempty"` | ||
PVBInfo PodVolumeBackupInfo `json:"pvbInfo,omitempty"` | ||
} |