@@ -2,8 +2,6 @@ package persistentvolumeclaims
2
2
3
3
import (
4
4
"fmt"
5
- "github.com/loft-sh/vcluster/pkg/snapshot"
6
- snapshotMeta "github.com/loft-sh/vcluster/pkg/snapshot/meta"
7
5
"time"
8
6
9
7
storagev1 "k8s.io/api/storage/v1"
@@ -22,6 +20,8 @@ import (
22
20
syncertypes "github.com/loft-sh/vcluster/pkg/syncer/types"
23
21
"github.com/loft-sh/vcluster/pkg/util/translate"
24
22
23
+ "github.com/loft-sh/vcluster/pkg/snapshot"
24
+ snapshotMeta "github.com/loft-sh/vcluster/pkg/snapshot/meta"
25
25
corev1 "k8s.io/api/core/v1"
26
26
kerrors "k8s.io/apimachinery/pkg/api/errors"
27
27
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -108,7 +108,7 @@ func (s *persistentVolumeClaimSyncer) SyncToHost(ctx *synccontext.SyncContext, e
108
108
// check if host PVC is currently being restored
109
109
restoreInProgress , err := s .isHostVolumeRestoreInProgress (ctx , pObj )
110
110
if err != nil {
111
- return ctrl.Result {}, fmt .Errorf ("failed to check if host volume restore is in progress: %v " , err )
111
+ return ctrl.Result {}, fmt .Errorf ("failed to check if host volume restore is in progress: %w " , err )
112
112
}
113
113
if restoreInProgress {
114
114
return ctrl.Result {
@@ -132,7 +132,7 @@ func (s *persistentVolumeClaimSyncer) Sync(ctx *synccontext.SyncContext, event *
132
132
// check if host PVC is currently being restored
133
133
restoreInProgress , err := s .isHostVolumeRestoreInProgress (ctx , event .Host )
134
134
if err != nil {
135
- return ctrl.Result {}, fmt .Errorf ("failed to check if host volume restore is in progress: %v " , err )
135
+ return ctrl.Result {}, fmt .Errorf ("failed to check if host volume restore is in progress: %w " , err )
136
136
}
137
137
if restoreInProgress {
138
138
return ctrl.Result {
@@ -276,7 +276,7 @@ func (s *persistentVolumeClaimSyncer) isHostVolumeRestoreInProgress(ctx *synccon
276
276
for _ , configMap := range configMaps .Items {
277
277
restoreRequest , err := snapshot .UnmarshalRestoreRequest (& configMap )
278
278
if err != nil {
279
- return false , fmt .Errorf ("unmarshal restore request: %v " , err )
279
+ return false , fmt .Errorf ("unmarshal restore request: %w " , err )
280
280
}
281
281
restore , ok := restoreRequest .Spec .VolumeSnapshots .Status .Snapshots [pvcName ]
282
282
if ! ok {
0 commit comments