File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,18 @@ type CloneSource struct {
81
81
Snapshot string `json:"snapshot"`
82
82
}
83
83
84
+ // CloneProgressReport contains the progress report of a subvolume clone.
85
+ type CloneProgressReport struct {
86
+ PercentageCloned string `json:"percentage cloned"`
87
+ AmountCloned string `json:"amount cloned"`
88
+ FilesCloned string `json:"files cloned"`
89
+ }
90
+
84
91
// CloneStatus reports on the status of a subvolume clone.
85
92
type CloneStatus struct {
86
- State CloneState `json:"state"`
87
- Source CloneSource `json:"source"`
93
+ State CloneState `json:"state"`
94
+ Source CloneSource `json:"source"`
95
+ ProgressReport CloneProgressReport `json:"progress_report"`
88
96
89
97
// failure can be obtained through .GetFailure()
90
98
failure * CloneFailure
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ var sampleCloneStatusInProg = []byte(`{
27
27
"volume": "cephfs",
28
28
"subvolume": "subvol1",
29
29
"snapshot": "snap1"
30
+ },
31
+ "progress_report": {
32
+ "percentage cloned": "25%",
33
+ "amount cloned": "55/202",
34
+ "files cloned": "1/3"
30
35
}
31
36
}
32
37
}` )
@@ -66,6 +71,9 @@ func TestParseCloneStatus(t *testing.T) {
66
71
assert .EqualValues (t , "subvol1" , status .Source .SubVolume )
67
72
assert .EqualValues (t , "snap1" , status .Source .Snapshot )
68
73
assert .EqualValues (t , "" , status .Source .Group )
74
+ assert .EqualValues (t , "25%" , status .ProgressReport .PercentageCloned )
75
+ assert .EqualValues (t , "55/202" , status .ProgressReport .AmountCloned )
76
+ assert .EqualValues (t , "1/3" , status .ProgressReport .FilesCloned )
69
77
}
70
78
})
71
79
}
You can’t perform that action at this time.
0 commit comments