From 68c8f7ab6815af93a2ebb8d89ab425d4d101a435 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Fri, 3 May 2024 15:56:20 +0200 Subject: [PATCH] fix: Updated ConnectToPlatform function signature --- cmd/vcluster/cmd/start.go | 2 +- devspace.yaml | 46 +++++++++++++++++++-------------------- pkg/pro/platform.go | 4 ++-- pkg/scheme/scheme.go | 6 ++--- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cmd/vcluster/cmd/start.go b/cmd/vcluster/cmd/start.go index 5d7a3feea..d0fc650db 100644 --- a/cmd/vcluster/cmd/start.go +++ b/cmd/vcluster/cmd/start.go @@ -122,7 +122,7 @@ func ExecuteStart(ctx context.Context, options *StartOptions) error { if err := pro.ConnectToPlatform( ctx, vConfig, - controllerCtx.VirtualManager.GetHTTPClient().Transport, + controllerCtx.VirtualManager, ); err != nil { return fmt.Errorf("connect to platform: %w", err) } diff --git a/devspace.yaml b/devspace.yaml index 0494e297d..7246f577e 100644 --- a/devspace.yaml +++ b/devspace.yaml @@ -6,8 +6,8 @@ vars: # Make sure vcluster is the default namespace DEVSPACE_FLAGS: "-n vcluster" SYNCER_IMAGE: ghcr.io/loft-sh/loft-enterprise/dev-vcluster - COMMON_VALUES: ./test/commonValues.yaml - PRO_VALUES: ./test/proValues.yaml + COMMON_VALUES: ./test/commonValues.yaml + PRO_VALUES: ./test/proValues.yaml VALUES_FILE: ./test/e2e/values.yaml # Images DevSpace will build for vcluster @@ -37,7 +37,7 @@ deployments: tag: tag(${SYNCER_IMAGE}) scheduling: tolerations: - - operator: "Exists" + - operator: "Exists" service: spec: type: NodePort @@ -115,21 +115,21 @@ dev: terminal: command: "./devspace_start.sh" ports: - - port: 2346:2345 + - port: 2346:2345 sync: - - excludePaths: - - '**' - - '!/pkg' - - 'cmd/vclusterctl/cmd/charts' - - '!/cmd' - - '!/vendor' - - '!/config' - - '!/hack' - - '!/go.mod' - - '!/go.sum' - - '!/devspace_start.sh' - - '!/manifests' - - '/manifests/coredns' # shouldn't sync to this path because it is mounted from a ConfigMap as ReadOnly + - excludePaths: + - "**" + - "!/pkg" + - "cmd/vclusterctl/cmd/charts" + - "!/cmd" + - "!/vendor" + - "!/config" + - "!/hack" + - "!/go.mod" + - "!/go.sum" + - "!/devspace_start.sh" + - "!/manifests" + - "/manifests/coredns" # shouldn't sync to this path because it is mounted from a ConfigMap as ReadOnly # Pipelines used for vcluster pipelines: @@ -183,8 +183,8 @@ profiles: path: deployments.vcluster-k3s.helm value: valuesFiles: - - ${COMMON_VALUES} - - ${VALUES_FILE} + - ${COMMON_VALUES} + - ${VALUES_FILE} - name: test-k8s patches: @@ -192,8 +192,8 @@ profiles: path: deployments.vcluster-k8s.helm value: valuesFiles: - - ${COMMON_VALUES} - - ${VALUES_FILE} + - ${COMMON_VALUES} + - ${VALUES_FILE} - name: test-k0s patches: @@ -201,8 +201,8 @@ profiles: path: deployments.vcluster-k0s.helm value: valuesFiles: - - ${COMMON_VALUES} - - ${VALUES_FILE} + - ${COMMON_VALUES} + - ${VALUES_FILE} - name: test-pro patches: - op: add diff --git a/pkg/pro/platform.go b/pkg/pro/platform.go index 60f64608a..11407313a 100644 --- a/pkg/pro/platform.go +++ b/pkg/pro/platform.go @@ -2,11 +2,11 @@ package pro import ( "context" - "net/http" "github.com/loft-sh/vcluster/pkg/config" + "sigs.k8s.io/controller-runtime/pkg/manager" ) -var ConnectToPlatform = func(context.Context, *config.VirtualClusterConfig, http.RoundTripper) error { +var ConnectToPlatform = func(context.Context, *config.VirtualClusterConfig, manager.Manager) error { return nil } diff --git a/pkg/scheme/scheme.go b/pkg/scheme/scheme.go index fcb130345..afdde836f 100644 --- a/pkg/scheme/scheme.go +++ b/pkg/scheme/scheme.go @@ -4,6 +4,7 @@ import ( volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v4/apis/volumesnapshot/v1" agentclusterv1 "github.com/loft-sh/agentapi/v3/pkg/apis/loft/cluster/v1" agentstoragev1 "github.com/loft-sh/agentapi/v3/pkg/apis/loft/storage/v1" + managementv1 "github.com/loft-sh/api/v3/pkg/apis/management/v1" "github.com/loft-sh/vcluster/pkg/apis" apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" @@ -14,9 +15,7 @@ import ( metricsv1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1" ) -var ( - Scheme = runtime.NewScheme() -) +var Scheme = runtime.NewScheme() func init() { _ = clientgoscheme.AddToScheme(Scheme) @@ -37,4 +36,5 @@ func init() { // Register Loft CRDs _ = agentstoragev1.AddToScheme(Scheme) _ = agentclusterv1.AddToScheme(Scheme) + _ = managementv1.AddToScheme(Scheme) }