aws/config: Shortened conditions [cleanup]
This commit is contained in:
parent
b98e5f2073
commit
2073e80c66
|
@ -111,10 +111,10 @@ func GetCredentials(c *Config) *awsCredentials.Credentials {
|
||||||
}
|
}
|
||||||
usedEndpoint := setOptionalEndpoint(cfg)
|
usedEndpoint := setOptionalEndpoint(cfg)
|
||||||
|
|
||||||
|
if !c.SkipMetadataApiCheck {
|
||||||
// Real AWS should reply to a simple metadata request.
|
// Real AWS should reply to a simple metadata request.
|
||||||
// We check it actually does to ensure something else didn't just
|
// We check it actually does to ensure something else didn't just
|
||||||
// happen to be listening on the same IP:Port
|
// happen to be listening on the same IP:Port
|
||||||
if c.SkipMetadataApiCheck == false {
|
|
||||||
metadataClient := ec2metadata.New(session.New(cfg))
|
metadataClient := ec2metadata.New(session.New(cfg))
|
||||||
if metadataClient.Available() {
|
if metadataClient.Available() {
|
||||||
providers = append(providers, &ec2rolecreds.EC2RoleProvider{
|
providers = append(providers, &ec2rolecreds.EC2RoleProvider{
|
||||||
|
|
|
@ -203,7 +203,7 @@ func (c *Config) Client() (interface{}, error) {
|
||||||
client.iamconn = iam.New(awsIamSess)
|
client.iamconn = iam.New(awsIamSess)
|
||||||
client.stsconn = sts.New(sess)
|
client.stsconn = sts.New(sess)
|
||||||
|
|
||||||
if c.SkipIamCredsValidation == false {
|
if !c.SkipIamCredsValidation {
|
||||||
err = c.ValidateCredentials(client.stsconn)
|
err = c.ValidateCredentials(client.stsconn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errs = append(errs, err)
|
errs = append(errs, err)
|
||||||
|
@ -211,7 +211,7 @@ func (c *Config) Client() (interface{}, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.SkipIamAccountId == false {
|
if !c.SkipIamAccountId {
|
||||||
accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName)
|
accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
client.accountid = accountId
|
client.accountid = accountId
|
||||||
|
|
Loading…
Reference in New Issue