Skip to content

Commit

Permalink
fix: order of volumesnapshot syncers
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Jul 19, 2024
1 parent bbf75a4 commit bc00ca3
Show file tree
Hide file tree
Showing 17 changed files with 713 additions and 719 deletions.
11 changes: 0 additions & 11 deletions pkg/controllers/resources/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
syncertypes "github.com/loft-sh/vcluster/pkg/controllers/syncer/types"
"github.com/loft-sh/vcluster/pkg/util/loghelper"
"github.com/pkg/errors"
"k8s.io/klog/v2"
)

// ExtraControllers that will be started as well
Expand Down Expand Up @@ -91,16 +90,6 @@ func BuildSyncers(ctx *synccontext.RegisterContext) ([]syncertypes.Object, error

loghelper.Infof("Created %s syncer", name)

// execute initializer
initializer, ok := syncer.(syncertypes.Initializer)
if ok {
klog.FromContext(ctx).V(1).Info("Execute syncer init", "syncer", name)
err := initializer.Init(ctx)
if err != nil {
return nil, errors.Wrapf(err, "ensure prerequisites for %s syncer", name)
}
}

// execute register indices
indexRegisterer, ok := syncer.(syncertypes.IndicesRegisterer)
if ok {
Expand Down
122 changes: 0 additions & 122 deletions pkg/controllers/resources/volumesnapshots/volumesnapshotclasses/crd.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
syncer "github.com/loft-sh/vcluster/pkg/controllers/syncer/types"
"github.com/loft-sh/vcluster/pkg/mappings"
"github.com/loft-sh/vcluster/pkg/patcher"
"github.com/loft-sh/vcluster/pkg/util"
utilerrors "k8s.io/apimachinery/pkg/util/errors"

volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v4/apis/volumesnapshot/v1"
Expand All @@ -26,12 +25,6 @@ type volumeSnapshotClassSyncer struct {
syncer.Translator
}

var _ syncer.Initializer = &volumeSnapshotClassSyncer{}

func (s *volumeSnapshotClassSyncer) Init(registerContext *synccontext.RegisterContext) error {
return util.EnsureCRD(registerContext.Context, registerContext.VirtualManager.GetConfig(), []byte(volumeSnapshotClassesCRD), volumesnapshotv1.SchemeGroupVersion.WithKind("VolumeSnapshotClass"))
}

var _ syncer.ToVirtualSyncer = &volumeSnapshotClassSyncer{}

func (s *volumeSnapshotClassSyncer) SyncToVirtual(ctx *synccontext.SyncContext, pObj client.Object) (ctrl.Result, error) {
Expand Down
Loading

0 comments on commit bc00ca3

Please sign in to comment.