Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/clusters/tke/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

// CreateTKEHostedCluster is a helper function that creates an TKE hosted cluster
func CreateTKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) {
tkeHostCluster := HostClusterConfig(displayName, cloudCredentialID)
func CreateTKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, clusterConfig ClusterConfig, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) {
tkeHostCluster := HostClusterConfig(displayName, cloudCredentialID, clusterConfig)
cluster := &management.Cluster{
DockerRootDir: "/var/lib/docker",
TKEConfig: tkeHostCluster,
Expand Down
6 changes: 1 addition & 5 deletions extensions/clusters/tke/tke_cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package tke

import (
management "github.com/rancher/shepherd/clients/rancher/generated/management/v3"
"github.com/rancher/shepherd/pkg/config"
)

const (
Expand Down Expand Up @@ -208,10 +207,7 @@ func nodePoolsConstructor(nodePoolsConfig []NodePoolDetail) []management.NodePoo
return nodePoolList
}

func HostClusterConfig(name, cloudCredentialID string) *management.TKEClusterConfigSpec {
var tkeClusterConfig ClusterConfig
config.LoadConfig(TKEClusterConfigConfigurationFileKey, &tkeClusterConfig)

func HostClusterConfig(name, cloudCredentialID string, tkeClusterConfig ClusterConfig) *management.TKEClusterConfigSpec {
return &management.TKEClusterConfigSpec{
Region: tkeClusterConfig.Region,
TKECredentialSecret: cloudCredentialID,
Expand Down
Loading