Skip to content

Commit

Permalink
PANDARIA: Add aliyun credential
Browse files Browse the repository at this point in the history
  • Loading branch information
smallteeths authored and JacieChao committed Oct 10, 2024
1 parent cfc559b commit eb1218f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 9 additions & 1 deletion extensions/cloudcredentials/cloudcredentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func LoadCloudCredential(provider string) CloudCredential {
cloudCredential.HuaweiCredentialConfig = &huaweiCredentialConfig

return cloudCredential

case provider == providers.Tencent:
var tkeCredentialConfig TencentCredentialConfig

Expand All @@ -112,6 +112,14 @@ func LoadCloudCredential(provider string) CloudCredential {

return cloudCredential

case provider == providers.Aliyun:
var aliyunECSCredentialConfig AliyunECSCredentialConfig

config.LoadConfig(AliyunECSCredentialConfigurationFileKey, &aliyunECSCredentialConfig)
cloudCredential.AliyunECSCredentialConfig = &aliyunECSCredentialConfig

return cloudCredential

default:
panic(fmt.Sprintf("Provider:%v not found", provider))
}
Expand Down
5 changes: 1 addition & 4 deletions extensions/clusters/ack/ack_cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package ack

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

const (
Expand Down Expand Up @@ -118,9 +117,7 @@ func ackNodePoolConstructor(ackNodePoolConfigs *[]NodePoolInfo) []management.Nod
return ackNodePools
}

func HostClusterConfig(displayName, cloudCredentialID string) *management.ACKClusterConfigSpec {
var ackClusterConfig ClusterConfig
config.LoadConfig(ACKClusterConfigConfigurationFileKey, &ackClusterConfig)
func HostClusterConfig(displayName, cloudCredentialID string, ackClusterConfig ClusterConfig) *management.ACKClusterConfigSpec {

return &management.ACKClusterConfigSpec{
Name: displayName,
Expand Down
4 changes: 2 additions & 2 deletions extensions/clusters/ack/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

// CreateACKHostedCluster is a helper function that creates an ACK hosted cluster.
func CreateACKHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) {
ackHostCluster := HostClusterConfig(displayName, cloudCredentialID)
func CreateACKHostedCluster(client *rancher.Client, displayName, cloudCredentialID string, ackClusterConfig ClusterConfig, enableClusterAlerting, enableClusterMonitoring, enableNetworkPolicy, windowsPreferedCluster bool, labels map[string]string) (*management.Cluster, error) {
ackHostCluster := HostClusterConfig(displayName, cloudCredentialID, ackClusterConfig)
cluster := &management.Cluster{
ACKConfig: ackHostCluster,
DockerRootDir: "/var/lib/docker",
Expand Down

0 comments on commit eb1218f

Please sign in to comment.