From c920ce56bec1bd05ce83716a2d9f9ab65342188a Mon Sep 17 00:00:00 2001 From: renxiangyu Date: Fri, 24 Nov 2023 15:52:09 +0800 Subject: [PATCH] fix: install join nil point Signed-off-by: renxiangyu --- pkg/kosmosctl/install/install.go | 79 +++++++++++++++++--------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/pkg/kosmosctl/install/install.go b/pkg/kosmosctl/install/install.go index 8fe6f535c..609e66853 100644 --- a/pkg/kosmosctl/install/install.go +++ b/pkg/kosmosctl/install/install.go @@ -565,20 +565,21 @@ func (o *CommandInstallOptions) createControlCluster() error { if apierrors.IsNotFound(err) { clusterArgs := []string{"cluster"} joinOptions := join.CommandJoinOptions{ - Name: utils.DefaultClusterName, - Namespace: o.Namespace, - ImageRegistry: o.ImageRegistry, - KubeConfigStream: o.HostKubeConfigStream, - WaitTime: o.WaitTime, - KosmosClient: o.KosmosClient, - K8sClient: o.K8sClient, - RootFlag: true, - EnableLink: true, - CNI: o.CNI, - DefaultNICName: o.DefaultNICName, - NetworkType: o.NetworkType, - IpFamily: o.IpFamily, - UseProxy: o.UseProxy, + Name: utils.DefaultClusterName, + Namespace: o.Namespace, + ImageRegistry: o.ImageRegistry, + KubeConfigStream: o.HostKubeConfigStream, + WaitTime: o.WaitTime, + KosmosClient: o.KosmosClient, + K8sClient: o.K8sClient, + K8sExtensionsClient: o.K8sExtensionsClient, + RootFlag: true, + EnableLink: true, + CNI: o.CNI, + DefaultNICName: o.DefaultNICName, + NetworkType: o.NetworkType, + IpFamily: o.IpFamily, + UseProxy: o.UseProxy, } err = joinOptions.Run(clusterArgs) @@ -621,15 +622,16 @@ func (o *CommandInstallOptions) createControlCluster() error { if apierrors.IsNotFound(err) { clusterArgs := []string{"cluster"} joinOptions := join.CommandJoinOptions{ - Name: utils.DefaultClusterName, - Namespace: o.Namespace, - ImageRegistry: o.ImageRegistry, - KubeConfigStream: o.HostKubeConfigStream, - WaitTime: o.WaitTime, - KosmosClient: o.KosmosClient, - K8sClient: o.K8sClient, - RootFlag: true, - EnableTree: true, + Name: utils.DefaultClusterName, + Namespace: o.Namespace, + ImageRegistry: o.ImageRegistry, + KubeConfigStream: o.HostKubeConfigStream, + K8sExtensionsClient: o.K8sExtensionsClient, + WaitTime: o.WaitTime, + KosmosClient: o.KosmosClient, + K8sClient: o.K8sClient, + RootFlag: true, + EnableTree: true, } err = joinOptions.Run(clusterArgs) @@ -657,21 +659,22 @@ func (o *CommandInstallOptions) createControlCluster() error { if apierrors.IsNotFound(err) { clusterArgs := []string{"cluster"} joinOptions := join.CommandJoinOptions{ - Name: utils.DefaultClusterName, - Namespace: o.Namespace, - ImageRegistry: o.ImageRegistry, - KubeConfigStream: o.HostKubeConfigStream, - WaitTime: o.WaitTime, - KosmosClient: o.KosmosClient, - K8sClient: o.K8sClient, - RootFlag: true, - EnableLink: true, - CNI: o.CNI, - DefaultNICName: o.DefaultNICName, - NetworkType: o.NetworkType, - IpFamily: o.IpFamily, - UseProxy: o.UseProxy, - EnableTree: true, + Name: utils.DefaultClusterName, + Namespace: o.Namespace, + ImageRegistry: o.ImageRegistry, + KubeConfigStream: o.HostKubeConfigStream, + K8sExtensionsClient: o.K8sExtensionsClient, + WaitTime: o.WaitTime, + KosmosClient: o.KosmosClient, + K8sClient: o.K8sClient, + RootFlag: true, + EnableLink: true, + CNI: o.CNI, + DefaultNICName: o.DefaultNICName, + NetworkType: o.NetworkType, + IpFamily: o.IpFamily, + UseProxy: o.UseProxy, + EnableTree: true, } err = joinOptions.Run(clusterArgs)