Skip to content

Commit 24e6890

Browse files
committed
Fix linter issues
1 parent 682b683 commit 24e6890

File tree

6 files changed

+17
-173
lines changed

6 files changed

+17
-173
lines changed

pkg/snapshot/controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ func (c *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ct
218218
snapshotRequest.Status.Phase = RequestPhaseCreatingEtcdBackup
219219
case volumes.RequestPhaseFailed:
220220
snapshotRequest.Status.Phase = RequestPhaseFailed
221+
default:
222+
return ctrl.Result{}, fmt.Errorf("unexpected volume snapshots request phase %s", volumeSnapshotsRequest.Status.Phase)
221223
}
222224
case RequestPhaseCreatingEtcdBackup:
223225
requeue, err := c.reconcileCreatingEtcdBackup(ctx, &configMap, snapshotRequest)

pkg/snapshot/volumes/csi/reconcileinprogress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (s *VolumeSnapshotter) reconcileInProgressPVC(ctx context.Context, snapshot
9595
volumeSnapshot, err := s.snapshotsClient.SnapshotV1().VolumeSnapshots(pvcName.Namespace).Get(ctx, volumeSnapshotName, metav1.GetOptions{})
9696
if kerrors.IsNotFound(err) {
9797
// create new VolumeSnapshot
98-
volumeSnapshot, err = s.createVolumeSnapshotResource(ctx, snapshotRequestName, volumeSnapshotName, pvcName, config.VolumeSnapshotClassName)
98+
_, err = s.createVolumeSnapshotResource(ctx, snapshotRequestName, volumeSnapshotName, pvcName, config.VolumeSnapshotClassName)
9999
if err != nil {
100100
return volumes.SnapshotStatus{}, fmt.Errorf("failed to create VolumeSnapshot for the PersistentVolumeClaim %s: %w", pvcName, err)
101101
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package csi
2+
3+
import (
4+
snapshotsv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/clientset/versioned"
5+
"github.com/loft-sh/vcluster/pkg/util/loghelper"
6+
"k8s.io/client-go/kubernetes"
7+
)
8+
9+
type snapshotHandler struct {
10+
kubeClient *kubernetes.Clientset
11+
snapshotsClient *snapshotsv1.Clientset
12+
logger loghelper.Logger
13+
}

pkg/snapshot/volumes/csi/volumesnapshotclasses.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

pkg/snapshot/volumes/csi/wait.go

Lines changed: 0 additions & 146 deletions
This file was deleted.

pkg/snapshot/volumes/snapshotter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package volumes
33
import (
44
"context"
55
"errors"
6+
67
corev1 "k8s.io/api/core/v1"
78
"k8s.io/apimachinery/pkg/types"
89
)

0 commit comments

Comments
 (0)