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)
|
||||
|
||||
// Real AWS should reply to a simple metadata request.
|
||||
// We check it actually does to ensure something else didn't just
|
||||
// happen to be listening on the same IP:Port
|
||||
if c.SkipMetadataApiCheck == false {
|
||||
if !c.SkipMetadataApiCheck {
|
||||
// Real AWS should reply to a simple metadata request.
|
||||
// We check it actually does to ensure something else didn't just
|
||||
// happen to be listening on the same IP:Port
|
||||
metadataClient := ec2metadata.New(session.New(cfg))
|
||||
if metadataClient.Available() {
|
||||
providers = append(providers, &ec2rolecreds.EC2RoleProvider{
|
||||
|
|
|
@ -203,7 +203,7 @@ func (c *Config) Client() (interface{}, error) {
|
|||
client.iamconn = iam.New(awsIamSess)
|
||||
client.stsconn = sts.New(sess)
|
||||
|
||||
if c.SkipIamCredsValidation == false {
|
||||
if !c.SkipIamCredsValidation {
|
||||
err = c.ValidateCredentials(client.stsconn)
|
||||
if err != nil {
|
||||
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)
|
||||
if err == nil {
|
||||
client.accountid = accountId
|
||||
|
|
Loading…
Reference in New Issue