Skip to content

Commit 3f30e5b

Browse files
GGGitBoySTARRY-S
authored andcommitted
PANDARIA: Update CreateTKEHostedCluster
1 parent 0092258 commit 3f30e5b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

extensions/clusters/tke/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
)
77

88
// CreateTKEHostedCluster is a helper function that creates an TKE hosted cluster
9-
func CreateTKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) {
10-
tkeHostCluster := HostClusterConfig(displayName, cloudCredentialID)
9+
func CreateTKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, clusterConfig ClusterConfig, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) {
10+
tkeHostCluster := HostClusterConfig(displayName, cloudCredentialID, clusterConfig)
1111
cluster := &management.Cluster{
1212
DockerRootDir: "/var/lib/docker",
1313
TKEConfig: tkeHostCluster,

extensions/clusters/tke/tke_cluster_config.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package tke
22

33
import (
44
management "github.com/rancher/shepherd/clients/rancher/generated/management/v3"
5-
"github.com/rancher/shepherd/pkg/config"
65
)
76

87
const (
@@ -208,10 +207,7 @@ func nodePoolsConstructor(nodePoolsConfig []NodePoolDetail) []management.NodePoo
208207
return nodePoolList
209208
}
210209

211-
func HostClusterConfig(name, cloudCredentialID string) *management.TKEClusterConfigSpec {
212-
var tkeClusterConfig ClusterConfig
213-
config.LoadConfig(TKEClusterConfigConfigurationFileKey, &tkeClusterConfig)
214-
210+
func HostClusterConfig(name, cloudCredentialID string, tkeClusterConfig ClusterConfig) *management.TKEClusterConfigSpec {
215211
return &management.TKEClusterConfigSpec{
216212
Region: tkeClusterConfig.Region,
217213
TKECredentialSecret: cloudCredentialID,

0 commit comments

Comments
 (0)