Skip to content

Commit

Permalink
Fail VolumeSnapshotBeta fast when pvc not found (kanisterio#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdmanv authored May 5, 2021
1 parent a1bdcbb commit ff6fc2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/kube/snapshot/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,14 @@ func (s *SnapshotTestSuite) testVolumeSnapshot(c *C, snapshotter snapshot.Snapsh
}
pvc, err = s.cli.CoreV1().PersistentVolumeClaims(s.sourceNamespace).Create(ctx, pvc, metav1.CreateOptions{})
c.Assert(err, IsNil)
_ = poll.Wait(ctx, func(ctx context.Context) (bool, error) {
err = poll.Wait(ctx, func(ctx context.Context) (bool, error) {
pvc, err = s.cli.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(ctx, pvc.Name, metav1.GetOptions{})
if err != nil {
return false, err
}
return pvc.Status.Phase == corev1.ClaimBound, nil
})
c.Assert(err, IsNil)

snapshotName := snapshotNamePrefix + strconv.Itoa(int(time.Now().UnixNano()))
wait := true
Expand Down

0 comments on commit ff6fc2d

Please sign in to comment.