mirror of https://github.com/kubernetes/kops.git
Rename accessKeyId to accessKeyID
This commit is contained in:
parent
1e30bbe8f9
commit
98c35cd220
|
@ -47,8 +47,8 @@ type ALIVolumes struct {
|
||||||
var _ Volumes = &ALIVolumes{}
|
var _ Volumes = &ALIVolumes{}
|
||||||
|
|
||||||
func NewALIVolumes() (*ALIVolumes, error) {
|
func NewALIVolumes() (*ALIVolumes, error) {
|
||||||
accessKeyId := os.Getenv("ALIYUN_ACCESS_KEY_ID")
|
accessKeyID := os.Getenv("ALIYUN_ACCESS_KEY_ID")
|
||||||
if accessKeyId == "" {
|
if accessKeyID == "" {
|
||||||
return nil, fmt.Errorf("error initialing ALIVolumes: ALIYUN_ACCESS_KEY_ID cannot be empty")
|
return nil, fmt.Errorf("error initialing ALIVolumes: ALIYUN_ACCESS_KEY_ID cannot be empty")
|
||||||
}
|
}
|
||||||
accessKeySecret := os.Getenv("ALIYUN_ACCESS_KEY_SECRET")
|
accessKeySecret := os.Getenv("ALIYUN_ACCESS_KEY_SECRET")
|
||||||
|
@ -61,7 +61,7 @@ func NewALIVolumes() (*ALIVolumes, error) {
|
||||||
ecsEndpoint = ecs.ECSDefaultEndpoint
|
ecsEndpoint = ecs.ECSDefaultEndpoint
|
||||||
}
|
}
|
||||||
|
|
||||||
client := ecs.NewClientWithEndpoint(ecsEndpoint, accessKeyId, accessKeySecret)
|
client := ecs.NewClientWithEndpoint(ecsEndpoint, accessKeyID, accessKeySecret)
|
||||||
a := &ALIVolumes{
|
a := &ALIVolumes{
|
||||||
client: client,
|
client: client,
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,8 +84,8 @@ func NewALICloud(region string, tags map[string]string) (ALICloud, error) {
|
||||||
|
|
||||||
c := &aliCloudImplementation{region: region}
|
c := &aliCloudImplementation{region: region}
|
||||||
|
|
||||||
accessKeyId := os.Getenv("ALIYUN_ACCESS_KEY_ID")
|
accessKeyID := os.Getenv("ALIYUN_ACCESS_KEY_ID")
|
||||||
if accessKeyId == "" {
|
if accessKeyID == "" {
|
||||||
return nil, errors.New("ALIYUN_ACCESS_KEY_ID is required")
|
return nil, errors.New("ALIYUN_ACCESS_KEY_ID is required")
|
||||||
}
|
}
|
||||||
accessKeySecret := os.Getenv("ALIYUN_ACCESS_KEY_SECRET")
|
accessKeySecret := os.Getenv("ALIYUN_ACCESS_KEY_SECRET")
|
||||||
|
@ -93,13 +93,13 @@ func NewALICloud(region string, tags map[string]string) (ALICloud, error) {
|
||||||
return nil, errors.New("ALIYUN_ACCESS_KEY_SECRET is required")
|
return nil, errors.New("ALIYUN_ACCESS_KEY_SECRET is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
c.ecsClient = ecs.NewClient(accessKeyId, accessKeySecret)
|
c.ecsClient = ecs.NewClient(accessKeyID, accessKeySecret)
|
||||||
c.ecsClient.SetUserAgent(KubernetesKopsIdentity)
|
c.ecsClient.SetUserAgent(KubernetesKopsIdentity)
|
||||||
c.slbClient = slb.NewClient(accessKeyId, accessKeySecret)
|
c.slbClient = slb.NewClient(accessKeyID, accessKeySecret)
|
||||||
ramclient := ram.NewClient(accessKeyId, accessKeySecret)
|
ramclient := ram.NewClient(accessKeyID, accessKeySecret)
|
||||||
c.ramClient = ramclient.(*ram.RamClient)
|
c.ramClient = ramclient.(*ram.RamClient)
|
||||||
c.essClient = ess.NewClient(accessKeyId, accessKeySecret)
|
c.essClient = ess.NewClient(accessKeyID, accessKeySecret)
|
||||||
c.vpcClient = ecs.NewVPCClient(accessKeyId, accessKeySecret, common.Region(region))
|
c.vpcClient = ecs.NewVPCClient(accessKeyID, accessKeySecret, common.Region(region))
|
||||||
|
|
||||||
c.tags = tags
|
c.tags = tags
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import (
|
||||||
type aliyunOSSConfig struct {
|
type aliyunOSSConfig struct {
|
||||||
region oss.Region
|
region oss.Region
|
||||||
internal bool
|
internal bool
|
||||||
accessKeyId string
|
accessKeyID string
|
||||||
accessKeySecret string
|
accessKeySecret string
|
||||||
securityToken string
|
securityToken string
|
||||||
secure bool
|
secure bool
|
||||||
|
@ -53,10 +53,10 @@ func NewAliOSSClient() (*oss.Client, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.securityToken != "" {
|
if c.securityToken != "" {
|
||||||
return oss.NewOSSClientForAssumeRole(c.region, c.internal, c.accessKeyId, c.accessKeySecret, c.securityToken, c.secure), nil
|
return oss.NewOSSClientForAssumeRole(c.region, c.internal, c.accessKeyID, c.accessKeySecret, c.securityToken, c.secure), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return oss.NewOSSClient(c.region, c.internal, c.accessKeyId, c.accessKeySecret, c.secure), nil
|
return oss.NewOSSClient(c.region, c.internal, c.accessKeyID, c.accessKeySecret, c.secure), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *aliyunOSSConfig) loadConfig() error {
|
func (c *aliyunOSSConfig) loadConfig() error {
|
||||||
|
@ -71,8 +71,8 @@ func (c *aliyunOSSConfig) loadConfig() error {
|
||||||
c.region = oss.Region(fmt.Sprintf("oss-%s", region))
|
c.region = oss.Region(fmt.Sprintf("oss-%s", region))
|
||||||
}
|
}
|
||||||
|
|
||||||
c.accessKeyId = os.Getenv("ALIYUN_ACCESS_KEY_ID")
|
c.accessKeyID = os.Getenv("ALIYUN_ACCESS_KEY_ID")
|
||||||
if c.accessKeyId != "" {
|
if c.accessKeyID != "" {
|
||||||
c.accessKeySecret = os.Getenv("ALIYUN_ACCESS_KEY_SECRET")
|
c.accessKeySecret = os.Getenv("ALIYUN_ACCESS_KEY_SECRET")
|
||||||
if c.accessKeySecret == "" {
|
if c.accessKeySecret == "" {
|
||||||
return fmt.Errorf("ALIYUN_ACCESS_KEY_SECRET cannot be empty")
|
return fmt.Errorf("ALIYUN_ACCESS_KEY_SECRET cannot be empty")
|
||||||
|
@ -87,7 +87,7 @@ func (c *aliyunOSSConfig) loadConfig() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Can't get role token: %s", err)
|
return fmt.Errorf("Can't get role token: %s", err)
|
||||||
}
|
}
|
||||||
c.accessKeyId = roleAuth.AccessKeyId
|
c.accessKeyID = roleAuth.AccessKeyId
|
||||||
c.accessKeySecret = roleAuth.AccessKeySecret
|
c.accessKeySecret = roleAuth.AccessKeySecret
|
||||||
c.securityToken = roleAuth.SecurityToken
|
c.securityToken = roleAuth.SecurityToken
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue