Skip to content

Commit 581f1ea

Browse files
committed
fix: * improve logic in syncer and snapshot reconciliation to handle e2e tests failures
* Improve logging and assertion in snapshot e2e test
1 parent c368b21 commit 581f1ea

File tree

3 files changed

+184
-56
lines changed

3 files changed

+184
-56
lines changed

pkg/controllers/resources/ingresses/syncer.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,8 @@ func (s *ingressSyncer) Syncer() syncertypes.Sync[client.Object] {
6262

6363
func (s *ingressSyncer) SyncToHost(ctx *synccontext.SyncContext, event *synccontext.SyncToHostEvent[*networkingv1.Ingress]) (ctrl.Result, error) {
6464
if s.applyLimitByClass(ctx, event.Virtual) {
65-
s.EventRecorder().Eventf(
66-
event.Virtual,
67-
nil,
68-
"Warning",
69-
"SyncWarning",
70-
"IngressSyncWarning",
71-
"did not sync ingress %q to host because it does not match the selector under 'sync.fromHost.ingressClasses.selector'",
72-
event.Virtual.GetName(),
73-
)
65+
// applyLimitByClass already logs the appropriate error message with details
66+
// (including ingress class name), so we don't need to log another message here
7467
return ctrl.Result{}, nil
7568
}
7669

pkg/snapshot/volumes/csi/snapshothandler.go

Lines changed: 102 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -142,48 +142,68 @@ func (h *snapshotHandler) deleteVolumeSnapshot(ctx context.Context, requestLabel
142142
}
143143
volumeSnapshot, volumeSnapshotContent, err := h.getVolumeSnapshotResources(ctx, volumeSnapshotNamespace, volumeSnapshotName, volumeSnapshotContentName)
144144
if err != nil {
145-
return false, fmt.Errorf("failed to get volume snapshot resources for VolumeSnapshot %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
145+
return cleanupInProgress, fmt.Errorf("failed to get volume snapshot resources for VolumeSnapshot %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
146146
}
147147

148148
resourceRecreated := false
149149
if volumeSnapshotContent == nil && recreateResourceIfNotFound {
150150
h.logger.Debugf("VolumeSnapshotContent %s not found, recreate it", volumeSnapshotContentName)
151151
_, err = h.createVolumeSnapshotContentResource(ctx, requestLabel, requestName, volumeSnapshotRequest, snapshotHandle, snapshotsv1api.VolumeSnapshotContentDelete)
152152
if err != nil {
153-
return false, fmt.Errorf("failed to recreate VolumeSnapshotContent %s: %w", volumeSnapshotContentName, err)
153+
return cleanupInProgress, fmt.Errorf("failed to recreate VolumeSnapshotContent %s: %w", volumeSnapshotContentName, err)
154154
}
155155
resourceRecreated = true
156156
}
157157
if volumeSnapshot == nil && recreateResourceIfNotFound {
158158
h.logger.Debugf("VolumeSnapshot %s/%s not found, recreate it", volumeSnapshotNamespace, volumeSnapshotName)
159159
_, err = h.createPreProvisionedVolumeSnapshot(ctx, requestLabel, requestName, volumeSnapshotRequest)
160160
if err != nil {
161-
return false, fmt.Errorf("failed to recreate VolumeSnapshot %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
161+
return cleanupInProgress, fmt.Errorf("failed to recreate VolumeSnapshot %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
162162
}
163163
resourceRecreated = true
164164
}
165165
if resourceRecreated {
166-
return false, nil
166+
return cleanupInProgress, nil
167167
}
168168

169169
if volumeSnapshot == nil && volumeSnapshotContent == nil {
170170
// both the VolumeSnapshot and the VolumeSnapshotContent have been deleted
171-
return true, nil
171+
return cleanupComplete, nil
172172
}
173173
if volumeSnapshot != nil {
174-
volumeSnapshotJSON, _ := json.Marshal(volumeSnapshot)
175-
h.logger.Debugf("VolumeSnapshot %s/%s still not deleted: %s", volumeSnapshot.Namespace, volumeSnapshot.Name, volumeSnapshotJSON)
174+
h.logger.Debugf("VolumeSnapshot %s/%s deletion pending (deletionTimestamp=%v)", volumeSnapshot.Namespace, volumeSnapshot.Name, volumeSnapshot.DeletionTimestamp)
176175
}
177176
if volumeSnapshotContent != nil {
178-
volumeSnapshotContentJSON, _ := json.Marshal(volumeSnapshotContent)
179-
h.logger.Debugf("VolumeSnapshotContent %s still not deleted: %s", volumeSnapshotContent.Name, volumeSnapshotContentJSON)
177+
h.logger.Debugf("VolumeSnapshotContent %s deletion pending (policy=%s, deletionTimestamp=%v)", volumeSnapshotContent.Name, volumeSnapshotContent.Spec.DeletionPolicy, volumeSnapshotContent.DeletionTimestamp)
180178
}
181179

182-
err = h.updateAndDeleteVolumeSnapshotResource(ctx, volumeSnapshot, volumeSnapshotContent, snapshotsv1api.VolumeSnapshotContentDelete)
180+
result, err := h.updateAndDeleteVolumeSnapshotResource(ctx, volumeSnapshot, volumeSnapshotContent, snapshotsv1api.VolumeSnapshotContentDelete)
183181
if err != nil {
184-
return false, fmt.Errorf("failed to delete volume snapshot: %w", err)
182+
if kerrors.IsConflict(err) {
183+
h.logger.Debugf("Conflict deleting %s/%s (likely processed by controller), will retry: %v", volumeSnapshotNamespace, volumeSnapshotName, err)
184+
return cleanupInProgress, nil
185+
}
186+
return cleanupInProgress, fmt.Errorf("failed to delete volume snapshot: %w", err)
187+
}
188+
if result.policyUpdated {
189+
h.logger.Debugf("DeletionPolicy updated for %s/%s, waiting for controller reconciliation", volumeSnapshotNamespace, volumeSnapshotName)
190+
return cleanupInProgress, nil
191+
}
192+
return cleanupInProgress, nil
193+
}
194+
195+
const (
196+
cleanupComplete = true
197+
cleanupInProgress = false
198+
)
199+
200+
func isCleanupComplete(volumeSnapshot *snapshotsv1api.VolumeSnapshot, volumeSnapshotContent *snapshotsv1api.VolumeSnapshotContent) bool {
201+
if volumeSnapshot == nil && volumeSnapshotContent == nil {
202+
return true
185203
}
186-
return false, nil
204+
snapshotDeleting := volumeSnapshot == nil || !volumeSnapshot.DeletionTimestamp.IsZero()
205+
contentDeleting := volumeSnapshotContent == nil || !volumeSnapshotContent.DeletionTimestamp.IsZero()
206+
return snapshotDeleting && contentDeleting
187207
}
188208

189209
// cleanupVolumeSnapshotResource deletes the VolumeSnapshot and the VolumeSnapshotContent with the deletion policy set
@@ -192,23 +212,58 @@ func (h *snapshotHandler) deleteVolumeSnapshot(ctx context.Context, requestLabel
192212
func (h *snapshotHandler) cleanupVolumeSnapshotResource(ctx context.Context, volumeSnapshotNamespace, volumeSnapshotName string) (bool, error) {
193213
volumeSnapshot, volumeSnapshotContent, err := h.getVolumeSnapshotResources(ctx, volumeSnapshotNamespace, volumeSnapshotName, "")
194214
if err != nil {
195-
return false, fmt.Errorf("failed to get volume snapshot resources for VolumeSnapshot %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
215+
return cleanupInProgress, fmt.Errorf("failed to get volume snapshot resources for VolumeSnapshot %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
196216
}
217+
// If resources are gone, cleanup is done
197218
if volumeSnapshot == nil && volumeSnapshotContent == nil {
198-
return true, nil
219+
return cleanupComplete, nil
220+
}
221+
222+
// Check if resources are already being deleted (have DeletionTimestamp set)
223+
// If they are, we consider them as effectively cleaned up
224+
if isCleanupComplete(volumeSnapshot, volumeSnapshotContent) {
225+
h.logger.Debugf("Volume snapshot resources for%s/%s are marked for deletion, cleanup considered complete", volumeSnapshotNamespace, volumeSnapshotName)
226+
return cleanupComplete, nil
199227
}
200-
err = h.updateAndDeleteVolumeSnapshotResource(ctx, volumeSnapshot, volumeSnapshotContent, snapshotsv1api.VolumeSnapshotContentRetain)
228+
229+
result, err := h.updateAndDeleteVolumeSnapshotResource(ctx, volumeSnapshot, volumeSnapshotContent, snapshotsv1api.VolumeSnapshotContentRetain)
201230
if err != nil {
202-
return false, fmt.Errorf("failed to cleanup volume snapshot resources: %w", err)
231+
if kerrors.IsConflict(err) {
232+
h.logger.Debugf("Conflict cleaning up volume snapshot resources for %s/%s (likely being processed), will retry: %v", volumeSnapshotNamespace, volumeSnapshotName, err)
233+
return cleanupInProgress, nil
234+
}
235+
return cleanupInProgress, fmt.Errorf("failed to cleanup volume snapshot resources for %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
236+
}
237+
238+
if result.policyUpdated {
239+
h.logger.Debugf("DeletionPolicy updated for %s/%s, waiting for controller reconciliation", volumeSnapshotNamespace, volumeSnapshotName)
240+
return cleanupInProgress, nil
241+
}
242+
243+
// Re-check to confirm deletion has started (DeletionTimestamp set) or resources are gone.
244+
volumeSnapshot, volumeSnapshotContent, err = h.getVolumeSnapshotResources(ctx, volumeSnapshotNamespace, volumeSnapshotName, "")
245+
if err != nil {
246+
return cleanupInProgress, fmt.Errorf("failed to recheck volume snapshot resources for VolumeSnapshot %s/%s: %w", volumeSnapshotNamespace, volumeSnapshotName, err)
247+
}
248+
249+
if isCleanupComplete(volumeSnapshot, volumeSnapshotContent) {
250+
return cleanupComplete, nil
203251
}
204-
return false, nil
252+
253+
h.logger.Debugf("Cleanup initiated for %s/%s but deletion timestamp not yet set. Will retry.", volumeSnapshotNamespace, volumeSnapshotName)
254+
return cleanupInProgress, nil
255+
}
256+
257+
type updateDeleteResult struct {
258+
policyUpdated bool
259+
deleteIssued bool
205260
}
206261

207262
func (h *snapshotHandler) updateAndDeleteVolumeSnapshotResource(
208263
ctx context.Context,
209264
volumeSnapshot *snapshotsv1api.VolumeSnapshot,
210265
volumeSnapshotContent *snapshotsv1api.VolumeSnapshotContent,
211-
requiredVolumeSnapshotContentDeletionPolicy snapshotsv1api.DeletionPolicy) error {
266+
requiredVolumeSnapshotContentDeletionPolicy snapshotsv1api.DeletionPolicy) (updateDeleteResult, error) {
212267
if volumeSnapshotContent != nil &&
213268
volumeSnapshotContent.DeletionTimestamp.IsZero() &&
214269
volumeSnapshotContent.Spec.DeletionPolicy != requiredVolumeSnapshotContentDeletionPolicy {
@@ -217,16 +272,22 @@ func (h *snapshotHandler) updateAndDeleteVolumeSnapshotResource(
217272
// 2. DeletionPolicy=Delete when deleting the volume snapshots
218273
err := h.setVolumeSnapshotContentDeletionPolicy(ctx, volumeSnapshotContent.Name, requiredVolumeSnapshotContentDeletionPolicy)
219274
if err != nil {
220-
return fmt.Errorf("failed to set VolumeSnapshotContent %s DeletionPolicy to %s: %w", volumeSnapshotContent.Name, requiredVolumeSnapshotContentDeletionPolicy, err)
275+
return updateDeleteResult{}, fmt.Errorf("failed to set VolumeSnapshotContent %s DeletionPolicy to %s: %w", volumeSnapshotContent.Name, requiredVolumeSnapshotContentDeletionPolicy, err)
221276
}
222-
return nil
277+
return updateDeleteResult{policyUpdated: true}, nil
223278
}
224279

225-
err := h.deleteVolumeSnapshotResources(ctx, volumeSnapshot, volumeSnapshotContent)
280+
err := h.deleteVolumeSnapshotObj(ctx, volumeSnapshot)
226281
if err != nil {
227-
return fmt.Errorf("failed to delete VolumeSnapshot and/or VolumeSnapshotContent: %w", err)
282+
return updateDeleteResult{}, fmt.Errorf("failed to delete VolumeSnapshot: %w", err)
228283
}
229-
return nil
284+
285+
err = h.deleteVolumeSnapshotContentObj(ctx, volumeSnapshot, volumeSnapshotContent)
286+
if err != nil {
287+
return updateDeleteResult{}, fmt.Errorf("failed to delete VolumeSnapshotContent: %w", err)
288+
}
289+
290+
return updateDeleteResult{deleteIssued: true}, nil
230291
}
231292

232293
func (h *snapshotHandler) setVolumeSnapshotContentDeletionPolicy(ctx context.Context, volumeSnapshotContentName string, deletionPolicy snapshotsv1api.DeletionPolicy) error {
@@ -246,37 +307,42 @@ func (h *snapshotHandler) setVolumeSnapshotContentDeletionPolicy(ctx context.Con
246307
return nil
247308
}
248309

249-
func (h *snapshotHandler) deleteVolumeSnapshotResources(
310+
// deleteVolumeSnapshotObj deletes the VolumeSnapshot resource.
311+
func (h *snapshotHandler) deleteVolumeSnapshotObj(
250312
ctx context.Context,
251-
volumeSnapshot *snapshotsv1api.VolumeSnapshot,
252-
volumeSnapshotContent *snapshotsv1api.VolumeSnapshotContent) error {
313+
volumeSnapshot *snapshotsv1api.VolumeSnapshot) error {
253314
if volumeSnapshot != nil &&
254315
volumeSnapshot.DeletionTimestamp.IsZero() {
255316
h.logger.Debugf("Delete VolumeSnapshot %s/%s", volumeSnapshot.Namespace, volumeSnapshot.Name)
256317
err := h.snapshotsClient.SnapshotV1().VolumeSnapshots(volumeSnapshot.Namespace).Delete(ctx, volumeSnapshot.Name, metav1.DeleteOptions{})
257318
if err != nil && !kerrors.IsNotFound(err) {
258-
// If the error is a conflict (e.g., controller is adding finalizers),
259-
// it means the snapshot is being processed
319+
// If the error is a conflict, we return it to allow the reconciler to retry with backoff.
260320
if kerrors.IsConflict(err) {
261321
h.logger.Debugf("VolumeSnapshot %s/%s deletion conflicted (likely being processed by controller), will retry", volumeSnapshot.Namespace, volumeSnapshot.Name)
262-
} else {
263-
return fmt.Errorf("failed to delete VolumeSnapshot %s/%s: %w", volumeSnapshot.Namespace, volumeSnapshot.Name, err)
264322
}
323+
return fmt.Errorf("failed to delete VolumeSnapshot %s/%s: %w", volumeSnapshot.Namespace, volumeSnapshot.Name, err)
265324
}
266325
}
326+
return nil
327+
}
328+
329+
// deleteVolumeSnapshotContentObj deletes the VolumeSnapshotContent resource.
330+
func (h *snapshotHandler) deleteVolumeSnapshotContentObj(
331+
ctx context.Context,
332+
volumeSnapshot *snapshotsv1api.VolumeSnapshot,
333+
volumeSnapshotContent *snapshotsv1api.VolumeSnapshotContent) error {
267334
if volumeSnapshotContent != nil &&
268335
volumeSnapshotContent.DeletionTimestamp.IsZero() &&
269-
volumeSnapshotContent.Spec.DeletionPolicy == snapshotsv1api.VolumeSnapshotContentRetain {
336+
(volumeSnapshotContent.Spec.DeletionPolicy == snapshotsv1api.VolumeSnapshotContentRetain || volumeSnapshot == nil) {
270337
// Delete the VolumeSnapshotContent manually in case it has the Retain deletion policy.
271338
// Otherwise, the VolumeSnapshotContent resource will be deleted automatically by the snapshot-controller.
272-
// Here we have 2 cases:
273-
// 1. DeletionPolicy=Retain when cleaning up volume snapshot resources, where only the VolumeSnapshotContent is
274-
// deleted, and the volume snapshot remains saved in the storage backend.
275-
// 2. DeletionPolicy=Delete when deleting the volume snapshots, where both the VolumeSnapshotContent and the
276-
// volume snapshot from the storage backend are deleted.
277339
h.logger.Debugf("Delete VolumeSnapshotContent %s", volumeSnapshotContent.Name)
278340
err := h.snapshotsClient.SnapshotV1().VolumeSnapshotContents().Delete(ctx, volumeSnapshotContent.Name, metav1.DeleteOptions{})
279341
if err != nil && !kerrors.IsNotFound(err) {
342+
// If the error is a conflict, we return it to allow the reconciler to retry with backoff.
343+
if kerrors.IsConflict(err) {
344+
h.logger.Debugf("VolumeSnapshotContent %s deletion conflicted (likely being processed by controller), will retry", volumeSnapshotContent.Name)
345+
}
280346
return fmt.Errorf("failed to delete VolumeSnapshotContent %s: %w", volumeSnapshotContent.Name, err)
281347
}
282348
}

test/e2e/snapshot/snapshot.go

Lines changed: 80 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"time"
1010

1111
"github.com/ghodss/yaml"
12+
snapshotsv1api "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
1213
snapshotsv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned"
1314
vclusterconfig "github.com/loft-sh/vcluster/pkg/config"
1415
"github.com/loft-sh/vcluster/pkg/constants"
@@ -558,13 +559,58 @@ var _ = Describe("snapshot and restore", Ordered, func() {
558559
Expect(err).NotTo(HaveOccurred())
559560
Expect(snapshotClient).NotTo(BeNil())
560561

561-
volumeSnapshots, err := snapshotClient.SnapshotV1().VolumeSnapshots(volumeSnapshotsNamespace).List(ctx, metav1.ListOptions{})
562-
Expect(err).NotTo(HaveOccurred())
563-
Expect(volumeSnapshots.Items).To(BeEmpty())
562+
// Wait for VolumeSnapshots to be cleaned up. The cleanup process may take time because:
563+
// 1. Resources may have finalizers that prevent immediate deletion
564+
// 2. The snapshot controller needs to remove finalizers before deletion completes
565+
// 3. Cleanup is initiated asynchronously after restore completes
566+
// We wait for resources to either be gone or marked for deletion (which means cleanup was initiated)
567+
Eventually(func(g Gomega, ctx context.Context) {
568+
volumeSnapshots, err := snapshotClient.SnapshotV1().VolumeSnapshots(volumeSnapshotsNamespace).List(ctx, metav1.ListOptions{})
569+
g.Expect(err).NotTo(HaveOccurred())
564570

565-
volumeSnapshotContents, err := snapshotClient.SnapshotV1().VolumeSnapshotContents().List(ctx, metav1.ListOptions{})
566-
Expect(err).NotTo(HaveOccurred())
567-
Expect(volumeSnapshotContents.Items).To(BeEmpty())
571+
// Filter out VolumeSnapshots that are being deleted (have DeletionTimestamp set)
572+
// These are in the process of being cleaned up and will be removed once finalizers are cleared
573+
activeVolumeSnapshots := []snapshotsv1api.VolumeSnapshot{}
574+
for _, vs := range volumeSnapshots.Items {
575+
if vs.DeletionTimestamp == nil {
576+
activeVolumeSnapshots = append(activeVolumeSnapshots, vs)
577+
}
578+
}
579+
580+
g.Expect(activeVolumeSnapshots).To(BeEmpty(),
581+
"Expected all VolumeSnapshots to be deleted or marked for deletion, but found %d active VolumeSnapshots. "+
582+
"VolumeSnapshots marked for deletion (with finalizers) are acceptable and will be removed by Kubernetes. "+
583+
"Active VolumeSnapshots (not marked for deletion): %v",
584+
len(activeVolumeSnapshots),
585+
activeVolumeSnapshots)
586+
}).WithContext(ctx).
587+
WithPolling(framework.PollInterval).
588+
WithTimeout(framework.PollTimeout).
589+
Should(Succeed())
590+
591+
// Wait for VolumeSnapshotContents to be cleaned up
592+
Eventually(func(g Gomega, ctx context.Context) {
593+
volumeSnapshotContents, err := snapshotClient.SnapshotV1().VolumeSnapshotContents().List(ctx, metav1.ListOptions{})
594+
g.Expect(err).NotTo(HaveOccurred())
595+
596+
// Filter out VolumeSnapshotContents that are being deleted
597+
activeVolumeSnapshotContents := []snapshotsv1api.VolumeSnapshotContent{}
598+
for _, vsc := range volumeSnapshotContents.Items {
599+
if vsc.DeletionTimestamp == nil {
600+
activeVolumeSnapshotContents = append(activeVolumeSnapshotContents, vsc)
601+
}
602+
}
603+
604+
g.Expect(activeVolumeSnapshotContents).To(BeEmpty(),
605+
"Expected all VolumeSnapshotContents to be deleted or marked for deletion, but found %d active VolumeSnapshotContents. "+
606+
"VolumeSnapshotContents marked for deletion are acceptable and will be removed by Kubernetes. "+
607+
"Active VolumeSnapshotContents (not marked for deletion): %v",
608+
len(activeVolumeSnapshotContents),
609+
activeVolumeSnapshotContents)
610+
}).WithContext(ctx).
611+
WithPolling(framework.PollInterval).
612+
WithTimeout(framework.PollTimeout).
613+
Should(Succeed())
568614
})
569615

570616
It("Deletes the PVC with test data", func(ctx context.Context) {
@@ -720,17 +766,40 @@ var _ = Describe("snapshot and restore", Ordered, func() {
720766
Should(Succeed())
721767
})
722768

723-
It("completed new new snapshot request", func(ctx context.Context) {
769+
It("completed new snapshot request", func(ctx context.Context) {
724770
Eventually(func(g Gomega, ctx context.Context) {
725771
_, newerSnapshotRequest := getTwoSnapshotRequests(g, ctx, f)
726-
g.Expect(newerSnapshotRequest.Status.Phase).Should(
727-
Equal(snapshot.RequestPhaseCompleted),
728-
fmt.Sprintf("Newer snapshot request %s is not completed, got: %s", newerSnapshotRequest.Name, toJSON(newerSnapshotRequest)))
772+
773+
// First check individual volume snapshot phases for better diagnostics
774+
// This helps identify which specific snapshots are stuck
729775
for pvcName, volumeSnapshot := range newerSnapshotRequest.Status.VolumeSnapshots.Snapshots {
730776
g.Expect(volumeSnapshot.Phase).To(
731777
Equal(volumes.RequestPhaseCompleted),
732-
fmt.Sprintf("New volume snapshot request for PVC %s should be completed, got: %s", pvcName, toJSON(volumeSnapshot)))
778+
fmt.Sprintf("Volume snapshot for PVC %s is not completed. Phase: %s, SnapshotHandle: %s, Error: %s. Full snapshot request: %s",
779+
pvcName,
780+
volumeSnapshot.Phase,
781+
volumeSnapshot.SnapshotHandle,
782+
toJSON(volumeSnapshot.Error),
783+
toJSON(newerSnapshotRequest)))
733784
}
785+
786+
// Then check the overall volumeSnapshots phase
787+
g.Expect(newerSnapshotRequest.Status.VolumeSnapshots.Phase).To(
788+
Equal(volumes.RequestPhaseCompleted),
789+
fmt.Sprintf("VolumeSnapshots phase is not completed for snapshot request %s. Phase: %s, Overall phase: %s, VolumeSnapshots: %s",
790+
newerSnapshotRequest.Name,
791+
newerSnapshotRequest.Status.VolumeSnapshots.Phase,
792+
newerSnapshotRequest.Status.Phase,
793+
toJSON(newerSnapshotRequest.Status.VolumeSnapshots)))
794+
795+
// Finally check the overall snapshot request phase
796+
g.Expect(newerSnapshotRequest.Status.Phase).Should(
797+
Equal(snapshot.RequestPhaseCompleted),
798+
fmt.Sprintf("Newer snapshot request %s is not completed. Overall phase: %s, VolumeSnapshots phase: %s, Full request: %s",
799+
newerSnapshotRequest.Name,
800+
newerSnapshotRequest.Status.Phase,
801+
newerSnapshotRequest.Status.VolumeSnapshots.Phase,
802+
toJSON(newerSnapshotRequest)))
734803
}).WithContext(ctx).
735804
WithPolling(framework.PollInterval).
736805
WithTimeout(framework.PollTimeoutLong).

0 commit comments

Comments
 (0)