From 1b4c452e0136dcb7d1d78c352967e85167ff4179 Mon Sep 17 00:00:00 2001 From: wangyelei Date: Wed, 25 Oct 2023 15:40:17 +0800 Subject: [PATCH] fix: create snapshot failed if the k8s not support v1 api --- pkg/dataprotection/action/action_create_vs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dataprotection/action/action_create_vs.go b/pkg/dataprotection/action/action_create_vs.go index 56bf626d47ef..36fc3202a19a 100644 --- a/pkg/dataprotection/action/action_create_vs.go +++ b/pkg/dataprotection/action/action_create_vs.go @@ -185,7 +185,7 @@ func (c *CreateVolumeSnapshotAction) createVolumeSnapshotIfNotExist(ctx Context, msg := fmt.Sprintf("creating volume snapshot %s/%s", snap.Namespace, snap.Name) ctx.Recorder.Event(c.Owner, corev1.EventTypeNormal, "CreatingVolumeSnapshot", msg) - if err = ctx.Client.Create(ctx.Ctx, snap); err != nil { + if err = vsCli.Create(snap); err != nil { return err } return nil