Skip to content

Commit

Permalink
update function 'UpdateStatus' to 'Update'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhucan committed May 8, 2019
1 parent dd61cbe commit f0d5f3e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ func (ctrl *csiSnapshotController) updateSnapshotErrorStatusWithEvent(snapshot *
}
snapshotClone.Status.Error = statusError
snapshotClone.Status.ReadyToUse = false
newSnapshot, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).UpdateStatus(snapshotClone)

newSnapshot, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone)
if err != nil {
klog.V(4).Infof("updating VolumeSnapshot[%s] error status failed %v", snapshotKey(snapshot), err)
return err
Expand Down Expand Up @@ -831,7 +830,7 @@ func (ctrl *csiSnapshotController) updateSnapshotStatus(snapshot *crdv1.VolumeSn
status.RestoreSize = resource.NewQuantity(size, resource.BinarySI)
}
snapshotClone.Status = status
newSnapshotObj, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).UpdateStatus(snapshotClone)
newSnapshotObj, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone)
if err != nil {
return nil, newControllerUpdateError(snapshotKey(snapshot), err.Error())
}
Expand Down

0 comments on commit f0d5f3e

Please sign in to comment.