Skip to content

Commit 178fbf7

Browse files
authored
refactor: remove pro get client (#3128)
1 parent bb65575 commit 178fbf7

File tree

5 files changed

+10
-28
lines changed

5 files changed

+10
-28
lines changed

.github/workflows/e2e.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,6 @@ jobs:
273273
test-suite-path: "./test/e2e"
274274
exclude:
275275
- ha: "true"
276-
- distribution: "k3s"
277-
test-suite-path: "./test/e2e_generic"
278-
- distribution: "k8s"
279-
test-suite-path: "./test/e2e_generic"
280276
- distribution: "k3s"
281277
test-suite-path: "./test/e2e_certs"
282278

pkg/pro/controllers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import (
55
syncertypes "github.com/loft-sh/vcluster/pkg/syncer/types"
66
)
77

8+
var InitProControllerContext = func(_ *synccontext.ControllerContext) error {
9+
return nil
10+
}
11+
812
var RegisterProControllers = func(*synccontext.ControllerContext) error {
913
return nil
1014
}

pkg/pro/generic.go

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

pkg/setup/controller_context.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/loft-sh/vcluster/pkg/syncer/synccontext"
2020
"github.com/loft-sh/vcluster/pkg/telemetry"
2121
"github.com/loft-sh/vcluster/pkg/util/blockingcacheclient"
22+
"github.com/loft-sh/vcluster/pkg/util/pluginhookclient"
2223
"github.com/pkg/errors"
2324
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2425
"k8s.io/apimachinery/pkg/util/wait"
@@ -77,7 +78,7 @@ func NewControllerContext(ctx context.Context, options *config.VirtualClusterCon
7778
Metrics: metricsserver.Options{BindAddress: localManagerMetrics},
7879
LeaderElection: false,
7980
Cache: getLocalCacheOptions(options),
80-
NewClient: pro.NewPhysicalClient(options),
81+
NewClient: pluginhookclient.NewPhysicalPluginClientFactory(blockingcacheclient.NewCacheClient),
8182
})
8283
if err != nil {
8384
return nil, err
@@ -89,7 +90,7 @@ func NewControllerContext(ctx context.Context, options *config.VirtualClusterCon
8990
Scheme: scheme.Scheme,
9091
Metrics: metricsserver.Options{BindAddress: virtualManagerMetrics},
9192
LeaderElection: false,
92-
NewClient: pro.NewVirtualClient(options),
93+
NewClient: pluginhookclient.NewVirtualPluginClientFactory(blockingcacheclient.NewCacheClient),
9394
})
9495
if err != nil {
9596
return nil, err

pkg/syncer/from_host_syncer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"github.com/loft-sh/vcluster/pkg/syncer/synccontext"
1414
"github.com/loft-sh/vcluster/pkg/syncer/translator"
1515
syncertypes "github.com/loft-sh/vcluster/pkg/syncer/types"
16+
"github.com/loft-sh/vcluster/pkg/util/blockingcacheclient"
17+
"github.com/loft-sh/vcluster/pkg/util/pluginhookclient"
1618
"github.com/loft-sh/vcluster/pkg/util/translate"
1719
corev1 "k8s.io/api/core/v1"
1820
kerrors "k8s.io/apimachinery/pkg/api/errors"
@@ -193,7 +195,7 @@ func GetOptionsForMultiNamespaceManager(ctx *synccontext.RegisterContext, option
193195
},
194196
PprofBindAddress: "0",
195197
LeaderElection: false,
196-
NewClient: pro.NewVirtualClient(ctx.Config),
198+
NewClient: pluginhookclient.NewVirtualPluginClientFactory(blockingcacheclient.NewCacheClient),
197199
WebhookServer: nil,
198200
Cache: cache.Options{
199201
Mapper: ctx.HostManager.GetRESTMapper(),

0 commit comments

Comments
 (0)