@@ -1702,7 +1702,7 @@ func (gceCS *GCEControllerServer) createPDSnapshot(ctx context.Context, project
17021702 return nil , status .Errorf (codes .Internal , "Failed to covert creation timestamp: %v" , err .Error ())
17031703 }
17041704
1705- ready , err := isCSISnapshotReady (snapshot . Status )
1705+ ready , err := isCSISnapshotReady (snapshot )
17061706 if err != nil {
17071707 return nil , status .Errorf (codes .Internal , "Snapshot had error checking ready status: %v" , err .Error ())
17081708 }
@@ -1844,15 +1844,13 @@ func (gceCS *GCEControllerServer) validateExistingSnapshot(snapshot *compute.Sna
18441844 return nil
18451845}
18461846
1847- func isCSISnapshotReady (status string ) (bool , error ) {
1848- switch status {
1847+ func isCSISnapshotReady (snapshot * compute.Snapshot ) (bool , error ) {
1848+ klog .V (4 ).Infof ("snapshot %s is %s" , snapshot .SelfLink , snapshot .Status )
1849+ switch snapshot .Status {
18491850 case "READY" :
18501851 return true , nil
18511852 case "FAILED" :
1852- return false , fmt .Errorf ("snapshot status is FAILED" )
1853- case "DELETING" :
1854- klog .V (4 ).Infof ("snapshot is in DELETING" )
1855- fallthrough
1853+ return false , fmt .Errorf ("snapshot %s status is FAILED" , snapshot .SelfLink )
18561854 default :
18571855 return false , nil
18581856 }
@@ -2100,7 +2098,7 @@ func generateDiskSnapshotEntry(snapshot *compute.Snapshot) (*csi.ListSnapshotsRe
21002098 // We ignore the error intentionally here since we are just listing snapshots
21012099 // TODO: If the snapshot is in "FAILED" state we need to think through what this
21022100 // should actually look like.
2103- ready , _ := isCSISnapshotReady (snapshot . Status )
2101+ ready , _ := isCSISnapshotReady (snapshot )
21042102
21052103 entry := & csi.ListSnapshotsResponse_Entry {
21062104 Snapshot : & csi.Snapshot {
0 commit comments