File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ func TestComputeNoRetry(t *testing.T) {
5555 attemptCount := 0
5656 testServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
5757 fmt .Println ("hit custom endpoint" )
58- attemptCount += 1
58+ attemptCount ++
5959 // http code is a placeholder, error message is what's used by the retryer
6060 http .Error (w , nonRetryableError , http .StatusForbidden )
6161 }))
@@ -96,7 +96,7 @@ func TestComputeWithRetry(t *testing.T) {
9696 attemptCount := 0
9797 testServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
9898 fmt .Println ("hit custom endpoint" )
99- attemptCount += 1
99+ attemptCount ++
100100 // Request timeouts are generally retried (https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry)
101101 http .Error (w , "RequestTimeout" , 500 )
102102 }))
Original file line number Diff line number Diff line change @@ -229,6 +229,7 @@ func (cfg *CloudConfig) GetEC2EndpointOpts(region string) []func(*ec2.Options) {
229229 return opts
230230}
231231
232+ // GetCustomEC2Resolver returns an endpoint resolver for EC2 Clients
232233func (cfg * CloudConfig ) GetCustomEC2Resolver () ec2.EndpointResolverV2 {
233234 return & EC2Resolver {
234235 Resolver : ec2 .NewDefaultEndpointResolverV2 (),
@@ -244,6 +245,7 @@ type EC2Resolver struct {
244245 Cfg * CloudConfig
245246}
246247
248+ // ResolveEndpoint resolves the endpoint, overriding when custom configurations are set.
247249func (r * EC2Resolver ) ResolveEndpoint (
248250 ctx context.Context , params ec2.EndpointParameters ,
249251) (
You can’t perform that action at this time.
0 commit comments