Skip to content

Commit

Permalink
fix: check if UseStaticEndpoints option enabled and add WithNoOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gacevicljubisa committed Mar 31, 2024
1 parent 68daf42 commit 26fcae3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/beekeeper/cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,11 @@ func setupNodes(ctx context.Context, clusterConfig config.Cluster, cfg *config.C
}

func getBeeOption(clusterConfig config.Cluster, v config.ClusterNodeGroup, nodeName string) orchestration.BeeClientOption {
var beeOpt orchestration.BeeClientOption
if *clusterConfig.UseStaticEndpoints {
if clusterConfig.UseStaticEndpoints != nil && *clusterConfig.UseStaticEndpoints {
endpoints := v.GetEndpoints()
beeOpt = orchestration.WithURLs(endpoints[nodeName].APIURL, endpoints[nodeName].DebugAPIURL)
return orchestration.WithURLs(endpoints[nodeName].APIURL, endpoints[nodeName].DebugAPIURL)
}
return beeOpt
return orchestration.WithNoOptions()
}

func setupOrAddNode(ctx context.Context, startCluster bool, ng orchestration.NodeGroup, nName string, nodeOpts orchestration.NodeOptions, ch chan<- nodeResult, beeOpt orchestration.BeeClientOption) {
Expand Down
7 changes: 7 additions & 0 deletions pkg/orchestration/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@ func WithURLs(apiURL, debugAPIURL string) BeeClientOption {
return nil
}
}

// WithNoOptions represents no BeeClientOption
func WithNoOptions() BeeClientOption {
return func(o *bee.ClientOptions) error {
return nil
}
}

0 comments on commit 26fcae3

Please sign in to comment.