Skip to content

Commit

Permalink
use function UpdateStatus and modify snapshot yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
zhucan committed May 14, 2019
1 parent c3f5d24 commit 896cd52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/kubernetes/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ spec:
source:
name: hpvc
kind: PersistentVolumeClaim
subresources:
status: {}
2 changes: 1 addition & 1 deletion pkg/controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,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).Update(snapshotClone)
newSnapshotObj, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).UpdateStatus(snapshotClone)
if err != nil {
return nil, newControllerUpdateError(snapshotKey(snapshot), err.Error())
}
Expand Down

0 comments on commit 896cd52

Please sign in to comment.