Skip to content

Commit

Permalink
fix: install join nil point
Browse files Browse the repository at this point in the history
Signed-off-by: renxiangyu <[email protected]>
  • Loading branch information
renxiangyu committed Nov 24, 2023
1 parent 2aa0100 commit c920ce5
Showing 1 changed file with 41 additions and 38 deletions.
79 changes: 41 additions & 38 deletions pkg/kosmosctl/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c920ce5

Please sign in to comment.