Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PANDARIA: Add aliyun credential #3

Merged
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
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
Loading