diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index b5f02385..a4fc00a7 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true env: - VCLUSTER_VERSION: v0.19.0-alpha.3 + VCLUSTER_VERSION: v0.19.0-alpha.4 VCLUSTER_SUFFIX: vcluster VCLUSTER_NAME: vcluster VCLUSTER_NAMESPACE: vcluster diff --git a/e2e/e2e_suite_test.go b/e2e/e2e_suite_test.go index d3d7d55d..5bea9fc3 100644 --- a/e2e/e2e_suite_test.go +++ b/e2e/e2e_suite_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/loft-sh/log" + examplev1 "github.com/loft-sh/vcluster-sdk/e2e/test_plugin/apis/v1" "github.com/loft-sh/vcluster/pkg/scheme" "github.com/loft-sh/vcluster/test/framework" ginkgo "github.com/onsi/ginkgo/v2" @@ -23,6 +24,8 @@ import ( // generated in this directory, and cluster logs will also be saved. // This function is called on each Ginkgo node in parallel mode. func TestRunE2ETests(t *testing.T) { + _ = examplev1.AddToScheme(scheme.Scheme) + gomega.RegisterFailHandler(ginkgo.Fail) err := framework.CreateFramework(context.Background(), scheme.Scheme) if err != nil { diff --git a/e2e/plugin/plugin.go b/e2e/plugin/plugin.go index 7906bd77..a3a5de44 100644 --- a/e2e/plugin/plugin.go +++ b/e2e/plugin/plugin.go @@ -3,12 +3,15 @@ package plugin import ( "time" + examplev1 "github.com/loft-sh/vcluster-sdk/e2e/test_plugin/apis/v1" + "github.com/loft-sh/vcluster/pkg/util/translate" "github.com/loft-sh/vcluster/test/framework" "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ) const ( @@ -33,13 +36,97 @@ var _ = ginkgo.Describe("Plugin test", func() { Should(gomega.Equal(1)) // wait for pod to become ready + var podList *corev1.PodList gomega.Eventually(func() bool { - podList, err := f.VclusterClient.CoreV1().Pods("default").List(f.Context, metav1.ListOptions{}) + podList, err = f.VclusterClient.CoreV1().Pods("default").List(f.Context, metav1.ListOptions{}) framework.ExpectNoError(err) return len(podList.Items) == 1 && podList.Items[0].Status.Phase == corev1.PodRunning }). WithPolling(pollingInterval). WithTimeout(pollingDurationLong). Should(gomega.BeTrue()) + + // get pod in host cluster + pod := &podList.Items[0] + hostPod := &corev1.Pod{} + err = f.HostCRClient.Get(f.Context, types.NamespacedName{Name: translate.Default.PhysicalName(pod.Name, pod.Namespace), Namespace: translate.Default.PhysicalNamespace(pod.Namespace)}, hostPod) + framework.ExpectNoError(err) + + // check if hook worked + framework.ExpectEqual(hostPod.Labels["created-by-plugin"], "pod-hook") + }) + + ginkgo.It("check crd sync", func() { + car := &examplev1.Car{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + Namespace: "kube-system", + }, + Spec: examplev1.CarSpec{ + Type: "Audi", + Seats: 4, + }, + } + + // create car in vcluster + gomega.Eventually(func() bool { + err := f.VclusterCRClient.Create(f.Context, car) + return err == nil + }). + WithPolling(pollingInterval). + WithTimeout(pollingDurationLong). + Should(gomega.BeTrue()) + + // wait for car to become synced + var hostCar *examplev1.Car + gomega.Eventually(func() bool { + err := f.HostCRClient.Get(f.Context, types.NamespacedName{Name: translate.Default.PhysicalName(car.Name, car.Namespace), Namespace: f.VclusterNamespace}, hostCar) + return err == nil + }). + WithPolling(pollingInterval). + WithTimeout(pollingDurationLong). + Should(gomega.BeTrue()) + + // check if car is synced correctly + framework.ExpectEqual(car.Spec.Seats, hostCar.Spec.Seats) + framework.ExpectEqual(car.Spec.Type, hostCar.Spec.Type) + }) + + ginkgo.It("check hooks work correctly", func() { + // create a new service + service := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test123", + Namespace: "default", + }, + Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, + Ports: []corev1.ServicePort{ + { + Name: "test", + Port: int32(1000), + }, + }, + }, + } + + // create car in vcluster + err := f.VclusterCRClient.Create(f.Context, service) + framework.ExpectNoError(err) + + // wait for car to become synced + var hostService *corev1.Service + gomega.Eventually(func() bool { + err := f.HostCRClient.Get(f.Context, types.NamespacedName{Name: translate.Default.PhysicalName(service.Name, service.Namespace), Namespace: f.VclusterNamespace}, hostService) + return err == nil + }). + WithPolling(pollingInterval). + WithTimeout(pollingDurationLong). + Should(gomega.BeTrue()) + + // check if car is synced correctly + framework.ExpectEqual(len(hostService.Spec.Ports), 2) + framework.ExpectEqual(hostService.Spec.Ports[1].Name, "plugin") + framework.ExpectEqual(hostService.Spec.Ports[1].Port, int32(19000)) }) }) diff --git a/e2e/test_plugin/main.go b/e2e/test_plugin/main.go index 8f4bb76b..62861922 100644 --- a/e2e/test_plugin/main.go +++ b/e2e/test_plugin/main.go @@ -11,10 +11,10 @@ func main() { _ = examplev1.AddToScheme(scheme.Scheme) ctx := plugin.MustInit() - plugin.MustRegister(syncers.NewMyDeploymentSyncer(ctx)) - plugin.MustRegister(syncers.NewCarSyncer(ctx)) plugin.MustRegister(syncers.NewServiceHook()) plugin.MustRegister(syncers.NewPodHook()) plugin.MustRegister(syncers.NewSecretHook()) + plugin.MustRegister(syncers.NewMyDeploymentSyncer(ctx)) + plugin.MustRegister(syncers.NewCarSyncer(ctx)) plugin.MustStart() } diff --git a/e2e/test_plugin/plugin.yaml b/e2e/test_plugin/plugin.yaml index 441714a7..347c2d56 100644 --- a/e2e/test_plugin/plugin.yaml +++ b/e2e/test_plugin/plugin.yaml @@ -15,7 +15,7 @@ plugin: extraRules: - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] - verbs: ["get", "list", "watch"] + verbs: ["create", "update", "get", "list", "watch"] # Make sure the cluster role is enabled or otherwise the plugin won't be able to watch custom # resource definitions. diff --git a/examples/bootstrap-with-deployment/devspace.yaml b/examples/bootstrap-with-deployment/devspace.yaml index fb9494ef..fa5e029a 100644 --- a/examples/bootstrap-with-deployment/devspace.yaml +++ b/examples/bootstrap-with-deployment/devspace.yaml @@ -17,7 +17,7 @@ deployments: chart: name: vcluster repo: https://charts.loft.sh - version: v0.19.0-alpha.3 + version: v0.19.0-alpha.4 values: serviceAccount: create: false diff --git a/examples/bootstrap-with-deployment/devspace_start.sh b/examples/bootstrap-with-deployment/devspace_start.sh index 34f8c736..4f4e6072 100755 --- a/examples/bootstrap-with-deployment/devspace_start.sh +++ b/examples/bootstrap-with-deployment/devspace_start.sh @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m" if [ ! -f "/vcluster/syncer" ]; then echo "Downloading vCluster syncer..." mkdir -p /vcluster - curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.3/syncer-linux-$(go env GOARCH)" + curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)" chmod +x /vcluster/syncer echo "Successfully downloaded syncer" fi diff --git a/examples/bootstrap-with-deployment/go.mod b/examples/bootstrap-with-deployment/go.mod index 4c709a2d..8ce189a7 100644 --- a/examples/bootstrap-with-deployment/go.mod +++ b/examples/bootstrap-with-deployment/go.mod @@ -3,7 +3,7 @@ module github.com/loft-sh/vcluster-mydeployment-example go 1.21.5 require ( - github.com/loft-sh/vcluster v0.19.0-alpha.3 + github.com/loft-sh/vcluster v0.19.0-alpha.4 github.com/loft-sh/vcluster-sdk v0.3.2 k8s.io/klog/v2 v2.120.1 ) @@ -89,7 +89,7 @@ require ( github.com/loft-sh/loftctl/v3 v3.4.0-beta.11 // indirect github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a // indirect github.com/loft-sh/utils v0.0.29 // indirect - github.com/loft-sh/vcluster-values v0.0.0-20240111090139-51fcf51d7ba9 // indirect + github.com/loft-sh/vcluster-values v0.0.0-20240126141411-ad63b49fe451 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/examples/bootstrap-with-deployment/go.sum b/examples/bootstrap-with-deployment/go.sum index 27511de0..d2cacf54 100644 --- a/examples/bootstrap-with-deployment/go.sum +++ b/examples/bootstrap-with-deployment/go.sum @@ -631,8 +631,10 @@ github.com/loft-sh/utils v0.0.29/go.mod h1:9hlX9cGpWHg3mNi/oBlv3X4ePGDMK66k8MbOZ github.com/loft-sh/vcluster v0.19.0-alpha.2.0.20240126093253-c406db52b881 h1:Q5iqcMUbCTCVaaSEQsBStciGdJzdPvL+fL8NGHraPKU= github.com/loft-sh/vcluster v0.19.0-alpha.2.0.20240126093253-c406db52b881/go.mod h1:4/gf6+uo39qRRHBXPcYnSCI2tzF/ArmN0/lMHgBLXcM= github.com/loft-sh/vcluster v0.19.0-alpha.3/go.mod h1:4/gf6+uo39qRRHBXPcYnSCI2tzF/ArmN0/lMHgBLXcM= +github.com/loft-sh/vcluster v0.19.0-alpha.4/go.mod h1:HnsTJRLBqinDlcv+amD21NmlSexnd/yXY5B8dadbIcc= github.com/loft-sh/vcluster-values v0.0.0-20240111090139-51fcf51d7ba9 h1:DP4b3RQkAjYG4S3FiPmCCSEKj24hBabyFaXncal/yU0= github.com/loft-sh/vcluster-values v0.0.0-20240111090139-51fcf51d7ba9/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M= +github.com/loft-sh/vcluster-values v0.0.0-20240126141411-ad63b49fe451/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= diff --git a/examples/crd-sync/devspace.yaml b/examples/crd-sync/devspace.yaml index 7303f6e6..7d1dba1a 100644 --- a/examples/crd-sync/devspace.yaml +++ b/examples/crd-sync/devspace.yaml @@ -17,7 +17,7 @@ deployments: chart: name: vcluster repo: https://charts.loft.sh - version: v0.19.0-alpha.3 + version: v0.19.0-alpha.4 values: plugin: crd-sync: diff --git a/examples/crd-sync/devspace_start.sh b/examples/crd-sync/devspace_start.sh index 34f8c736..4f4e6072 100755 --- a/examples/crd-sync/devspace_start.sh +++ b/examples/crd-sync/devspace_start.sh @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m" if [ ! -f "/vcluster/syncer" ]; then echo "Downloading vCluster syncer..." mkdir -p /vcluster - curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.3/syncer-linux-$(go env GOARCH)" + curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)" chmod +x /vcluster/syncer echo "Successfully downloaded syncer" fi diff --git a/examples/hooks/devspace.yaml b/examples/hooks/devspace.yaml index d504e52c..d62b4d1d 100644 --- a/examples/hooks/devspace.yaml +++ b/examples/hooks/devspace.yaml @@ -17,7 +17,7 @@ deployments: chart: name: vcluster repo: https://charts.loft.sh - version: v0.19.0-alpha.3 + version: v0.19.0-alpha.4 values: serviceAccount: create: false diff --git a/examples/hooks/devspace_start.sh b/examples/hooks/devspace_start.sh index 34f8c736..4f4e6072 100755 --- a/examples/hooks/devspace_start.sh +++ b/examples/hooks/devspace_start.sh @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m" if [ ! -f "/vcluster/syncer" ]; then echo "Downloading vCluster syncer..." mkdir -p /vcluster - curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.3/syncer-linux-$(go env GOARCH)" + curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)" chmod +x /vcluster/syncer echo "Successfully downloaded syncer" fi diff --git a/examples/pull-secret-sync/devspace.yaml b/examples/pull-secret-sync/devspace.yaml index bfe2b3b9..c2382218 100644 --- a/examples/pull-secret-sync/devspace.yaml +++ b/examples/pull-secret-sync/devspace.yaml @@ -17,7 +17,7 @@ deployments: chart: name: vcluster repo: https://charts.loft.sh - version: v0.19.0-alpha.3 + version: v0.19.0-alpha.4 values: plugin: pull-secret-sync: diff --git a/examples/pull-secret-sync/devspace_start.sh b/examples/pull-secret-sync/devspace_start.sh index 34f8c736..4f4e6072 100755 --- a/examples/pull-secret-sync/devspace_start.sh +++ b/examples/pull-secret-sync/devspace_start.sh @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m" if [ ! -f "/vcluster/syncer" ]; then echo "Downloading vCluster syncer..." mkdir -p /vcluster - curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.3/syncer-linux-$(go env GOARCH)" + curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)" chmod +x /vcluster/syncer echo "Successfully downloaded syncer" fi diff --git a/go.mod b/go.mod index 46b263cf..b7cf3075 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/hashicorp/go-plugin v1.6.0 github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a - github.com/loft-sh/vcluster v0.19.0-alpha.3 + github.com/loft-sh/vcluster v0.19.0-alpha.4 github.com/onsi/ginkgo/v2 v2.14.0 github.com/onsi/gomega v1.30.0 github.com/pkg/errors v0.9.1 @@ -98,7 +98,7 @@ require ( github.com/loft-sh/jspolicy v0.2.2 // indirect github.com/loft-sh/loftctl/v3 v3.4.0-beta.11 // indirect github.com/loft-sh/utils v0.0.29 // indirect - github.com/loft-sh/vcluster-values v0.0.0-20240111090139-51fcf51d7ba9 // indirect + github.com/loft-sh/vcluster-values v0.0.0-20240126141411-ad63b49fe451 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/go.sum b/go.sum index bde0bed6..7407abcc 100644 --- a/go.sum +++ b/go.sum @@ -628,10 +628,10 @@ github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a h1:/gqqjKpcHEdFXIX41lx github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a/go.mod h1:YImeRjXH34Yf5E79T7UHBQpDZl9fIaaFRgyZ/bkY+UQ= github.com/loft-sh/utils v0.0.29 h1:P/MObccXToAZy2QoJSQDJ+OJx1qHitpFHEVj3QBSNJs= github.com/loft-sh/utils v0.0.29/go.mod h1:9hlX9cGpWHg3mNi/oBlv3X4ePGDMK66k8MbOZGFMDTI= -github.com/loft-sh/vcluster v0.19.0-alpha.3 h1:lfJJyPXXzXolwMVtoLXUl613HqvUEp7DiDFBNmbJF6c= -github.com/loft-sh/vcluster v0.19.0-alpha.3/go.mod h1:4/gf6+uo39qRRHBXPcYnSCI2tzF/ArmN0/lMHgBLXcM= -github.com/loft-sh/vcluster-values v0.0.0-20240111090139-51fcf51d7ba9 h1:DP4b3RQkAjYG4S3FiPmCCSEKj24hBabyFaXncal/yU0= -github.com/loft-sh/vcluster-values v0.0.0-20240111090139-51fcf51d7ba9/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M= +github.com/loft-sh/vcluster v0.19.0-alpha.4 h1:QGmByu+zntfEchqdrIKxwjNCyz/qRqfmrUJWkRbRl7A= +github.com/loft-sh/vcluster v0.19.0-alpha.4/go.mod h1:HnsTJRLBqinDlcv+amD21NmlSexnd/yXY5B8dadbIcc= +github.com/loft-sh/vcluster-values v0.0.0-20240126141411-ad63b49fe451 h1:HGjzE73ZU5oogI4F/ssp2y+SyPiHKpMNulNSWaWY0pU= +github.com/loft-sh/vcluster-values v0.0.0-20240126141411-ad63b49fe451/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= diff --git a/vendor/github.com/loft-sh/vcluster/pkg/controllers/servicesync/servicesync.go b/vendor/github.com/loft-sh/vcluster/pkg/controllers/servicesync/servicesync.go index 4b2cdd63..ed3fad33 100644 --- a/vendor/github.com/loft-sh/vcluster/pkg/controllers/servicesync/servicesync.go +++ b/vendor/github.com/loft-sh/vcluster/pkg/controllers/servicesync/servicesync.go @@ -62,6 +62,20 @@ func (e *ServiceSyncer) Register() error { return []reconcile.Request{{NamespacedName: from}} })). + WatchesRawSource(source.Kind(e.From.GetCache(), &corev1.Endpoints{}), handler.EnqueueRequestsFromMapFunc(func(_ context.Context, object client.Object) []reconcile.Request { + if object == nil { + return nil + } + + _, ok := e.SyncServices[object.GetNamespace()+"/"+object.GetName()] + if !ok { + return nil + } + + return []reconcile.Request{{ + NamespacedName: types.NamespacedName{Namespace: object.GetNamespace(), Name: object.GetName()}, + }} + })). Complete(e) } @@ -81,7 +95,7 @@ func (e *ServiceSyncer) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R } // make sure the to service is deleted - e.Log.Infof("Delete target service %s/%s because from service is missing", to.Name, to.Namespace) + e.Log.Infof("Delete target service %s/%s because from service is missing", to.Namespace, to.Name) err = e.To.GetClient().Delete(ctx, &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: to.Name, @@ -281,16 +295,32 @@ func (e *ServiceSyncer) syncServiceAndEndpoints(ctx context.Context, fromService } // check if update is needed - expectedSubsets := []corev1.EndpointSubset{ - { - Addresses: []corev1.EndpointAddress{ - { - IP: fromService.Spec.ClusterIP, + var expectedSubsets []corev1.EndpointSubset + if fromService.Spec.ClusterIP == corev1.ClusterIPNone { + // fetch the corresponding endpoint and assign address from there to here + fromEndpoint := &corev1.Endpoints{} + err = e.From.GetClient().Get(ctx, types.NamespacedName{ + Name: fromService.GetName(), + Namespace: fromService.GetNamespace(), + }, fromEndpoint) + if err != nil { + return ctrl.Result{}, err + } + + expectedSubsets = fromEndpoint.Subsets + } else { + expectedSubsets = []corev1.EndpointSubset{ + { + Addresses: []corev1.EndpointAddress{ + { + IP: fromService.Spec.ClusterIP, + }, }, + Ports: convertPorts(toService.Spec.Ports), }, - Ports: convertPorts(toService.Spec.Ports), - }, + } } + if !apiequality.Semantic.DeepEqual(toEndpoints.Subsets, expectedSubsets) { e.Log.Infof("Update target endpoints %s/%s because subsets are different", to.Namespace, to.Name) toEndpoints.Subsets = expectedSubsets diff --git a/vendor/github.com/loft-sh/vcluster/pkg/plugin/v2/plugin.go b/vendor/github.com/loft-sh/vcluster/pkg/plugin/v2/plugin.go index 6fb7d357..a0b566e2 100644 --- a/vendor/github.com/loft-sh/vcluster/pkg/plugin/v2/plugin.go +++ b/vendor/github.com/loft-sh/vcluster/pkg/plugin/v2/plugin.go @@ -116,6 +116,8 @@ func (m *Manager) Start( if err != nil { return fmt.Errorf("error adding client hook for plugin %s: %w", vClusterPlugin.Path, err) } + + klog.FromContext(ctx).Info("Successfully loaded plugin", "plugin", vClusterPlugin.Path) } return nil diff --git a/vendor/github.com/loft-sh/vcluster/pkg/util/pluginhookclient/client.go b/vendor/github.com/loft-sh/vcluster/pkg/util/pluginhookclient/client.go index 02936e00..41412233 100644 --- a/vendor/github.com/loft-sh/vcluster/pkg/util/pluginhookclient/client.go +++ b/vendor/github.com/loft-sh/vcluster/pkg/util/pluginhookclient/client.go @@ -30,11 +30,11 @@ func NewVirtualPluginClientFactory(delegate client.NewClientFunc) client.NewClie } func NewPluginClient(virtual bool, delegate client.NewClientFunc) client.NewClientFunc { - if !plugin.DefaultManager.HasPlugins() { - return delegate - } - return func(config *rest.Config, options client.Options) (client.Client, error) { + if !plugin.DefaultManager.HasPlugins() { + return delegate(config, options) + } + innerClient, err := delegate(config, options) if err != nil { return nil, err diff --git a/vendor/modules.txt b/vendor/modules.txt index 2e830ce0..72ef2bc8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -407,7 +407,7 @@ github.com/loft-sh/utils/pkg/command github.com/loft-sh/utils/pkg/downloader github.com/loft-sh/utils/pkg/downloader/commands github.com/loft-sh/utils/pkg/extract -# github.com/loft-sh/vcluster v0.19.0-alpha.3 +# github.com/loft-sh/vcluster v0.19.0-alpha.4 ## explicit; go 1.21.5 github.com/loft-sh/vcluster/cmd/vclusterctl/cmd github.com/loft-sh/vcluster/cmd/vclusterctl/cmd/app/create @@ -523,7 +523,7 @@ github.com/loft-sh/vcluster/pkg/util/toleration github.com/loft-sh/vcluster/pkg/util/translate github.com/loft-sh/vcluster/pkg/util/websocketproxy github.com/loft-sh/vcluster/test/framework -# github.com/loft-sh/vcluster-values v0.0.0-20240111090139-51fcf51d7ba9 +# github.com/loft-sh/vcluster-values v0.0.0-20240126141411-ad63b49fe451 ## explicit; go 1.21.5 github.com/loft-sh/vcluster-values/values # github.com/mailru/easyjson v0.7.7