Skip to content

Commit 99d082c

Browse files
committed
Rename Ready to ReadyToUse
This PR renames Ready to ReadyToUse in VolumeSnapshot Status to be consistent with the name in CSI spec.
1 parent dffc152 commit 99d082c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pkg/apis/volumesnapshot/v1alpha1/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ type VolumeSnapshotStatus struct {
9696
// +optional
9797
RestoreSize *resource.Quantity `json:"restoreSize" protobuf:"bytes,2,opt,name=restoreSize"`
9898

99-
// Ready is set to true only if the snapshot is ready to use (e.g., finish uploading if
99+
// ReadyToUse is set to true only if the snapshot is ready to use (e.g., finish uploading if
100100
// there is an uploading phase) and also VolumeSnapshot and its VolumeSnapshotContent
101-
// bind correctly with each other. If any of the above condition is not true, Ready is
101+
// bind correctly with each other. If any of the above condition is not true, ReadyToUse is
102102
// set to false
103103
// +optional
104-
Ready bool `json:"ready" protobuf:"varint,3,opt,name=ready"`
104+
ReadyToUse bool `json:"readyToUse" protobuf:"varint,3,opt,name=readyToUse"`
105105

106106
// The last error encountered during create snapshot operation, if any.
107107
// This field must only be set by the entity completing the create snapshot

pkg/controller/framework_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ func newSnapshot(name, className, boundToContent, snapshotUID, claimName string,
815815
},
816816
Status: crdv1.VolumeSnapshotStatus{
817817
CreationTime: creationTime,
818-
Ready: ready,
818+
ReadyToUse: ready,
819819
Error: err,
820820
RestoreSize: size,
821821
},

pkg/controller/snapshot_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (ctrl *csiSnapshotController) syncContent(content *crdv1.VolumeSnapshotCont
154154
func (ctrl *csiSnapshotController) syncSnapshot(snapshot *crdv1.VolumeSnapshot) error {
155155
glog.V(5).Infof("synchonizing VolumeSnapshot[%s]: %s", snapshotKey(snapshot), getSnapshotStatusForLogging(snapshot))
156156

157-
if !snapshot.Status.Ready {
157+
if !snapshot.Status.ReadyToUse {
158158
return ctrl.syncUnreadySnapshot(snapshot)
159159
} else {
160160
return ctrl.syncReadySnapshot(snapshot)
@@ -379,7 +379,7 @@ func (ctrl *csiSnapshotController) updateSnapshotErrorStatusWithEvent(snapshot *
379379
}
380380
snapshotClone.Status.Error = statusError
381381

382-
snapshotClone.Status.Ready = false
382+
snapshotClone.Status.ReadyToUse = false
383383
newSnapshot, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone)
384384
if err != nil {
385385
glog.V(4).Infof("updating VolumeSnapshot[%s] error status failed %v", snapshotKey(snapshot), err)
@@ -399,7 +399,7 @@ func (ctrl *csiSnapshotController) updateSnapshotErrorStatusWithEvent(snapshot *
399399

400400
// Stateless functions
401401
func getSnapshotStatusForLogging(snapshot *crdv1.VolumeSnapshot) string {
402-
return fmt.Sprintf("bound to: %q, Completed: %v", snapshot.Spec.SnapshotContentName, snapshot.Status.Ready)
402+
return fmt.Sprintf("bound to: %q, Completed: %v", snapshot.Spec.SnapshotContentName, snapshot.Status.ReadyToUse)
403403
}
404404

405405
func IsSnapshotBound(snapshot *crdv1.VolumeSnapshot, content *crdv1.VolumeSnapshotContent) bool {
@@ -721,7 +721,7 @@ func (ctrl *csiSnapshotController) updateSnapshotStatus(snapshot *crdv1.VolumeSn
721721
snapshotClone := snapshot.DeepCopy()
722722
if readyToUse {
723723
if bound {
724-
status.Ready = true
724+
status.ReadyToUse = true
725725
// Remove the error if checking snapshot is already bound and ready
726726
status.Error = nil
727727
change = true

0 commit comments

Comments
 (0)