fix waiters that weren't applying env defaults

This commit is contained in:
Megan Marsh 2018-08-31 13:27:44 -07:00
parent 87bf7e780c
commit 4472ecccb0
1 changed files with 9 additions and 3 deletions

View File

@ -169,6 +169,8 @@ func WaitForVolumeToBeAttached(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeV
return req, nil return req, nil
}, },
} }
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx) return w.WaitWithContext(ctx)
} }
@ -198,6 +200,8 @@ func WaitForVolumeToBeDetached(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeV
return req, nil return req, nil
}, },
} }
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx) return w.WaitWithContext(ctx)
} }
@ -227,6 +231,8 @@ func WaitForImageToBeImported(c *ec2.EC2, ctx aws.Context, input *ec2.DescribeIm
return req, nil return req, nil
}, },
} }
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx) return w.WaitWithContext(ctx)
} }
@ -281,11 +287,11 @@ func getOverride(varInfo envInfo) envInfo {
return varInfo return varInfo
} }
func getEnvOverrides() overridableWaitVars { func getEnvOverrides() overridableWaitVars {
// Load env vars from environment, and use them to override defaults // Load env vars from environment.
envValues := overridableWaitVars{ envValues := overridableWaitVars{
envInfo{"AWS_POLL_DELAY_SECONDS", 2, false}, envInfo{"AWS_POLL_DELAY_SECONDS", 0, false},
envInfo{"AWS_MAX_ATTEMPTS", 0, false}, envInfo{"AWS_MAX_ATTEMPTS", 0, false},
envInfo{"AWS_TIMEOUT_SECONDS", 300, false}, envInfo{"AWS_TIMEOUT_SECONDS", 0, false},
} }
envValues.awsMaxAttempts = getOverride(envValues.awsMaxAttempts) envValues.awsMaxAttempts = getOverride(envValues.awsMaxAttempts)