Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: endpoint resolver for aws #1330

Merged
merged 3 commits into from
Jan 29, 2025
Merged

fix: endpoint resolver for aws #1330

merged 3 commits into from
Jan 29, 2025

Conversation

yashmehrotra
Copy link
Member

No description provided.

Comment on lines 85 to 122
return func(o *T) {
switch opts := any(o).(type) {
case *ec2.Options:
opts.BaseEndpoint = val
case *iam.Options:
opts.BaseEndpoint = val
case *ssm.Options:
opts.BaseEndpoint = val
case *sns.Options:
opts.BaseEndpoint = val
case *ecr.Options:
opts.BaseEndpoint = val
case *sqs.Options:
opts.BaseEndpoint = val
case *cloudformation.Options:
opts.BaseEndpoint = val
case *ecs.Options:
opts.BaseEndpoint = val
case *elasticache.Options:
opts.BaseEndpoint = val
case *lambda.Options:
opts.BaseEndpoint = val
case *eks.Options:
opts.BaseEndpoint = val
case *efs.Options:
opts.BaseEndpoint = val
case *rds.Options:
opts.BaseEndpoint = val
case *s3.Options:
opts.BaseEndpoint = val
case *route53.Options:
opts.BaseEndpoint = val
case *sts.Options:
opts.BaseEndpoint = val
default:
fmt.Println("Unsupported options type")
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type switch is missing support for *elasticloadbalancing.Options and *elasticloadbalancingv2.Options. This means custom endpoints won't be applied when making ELB and ELBv2 API calls, even if an endpoint is specified in the configuration. Consider adding these cases to maintain consistent endpoint handling across all AWS services.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Comment on lines 123 to 125
default:
fmt.Println("Unsupported options type")
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type switch is missing a case for cloudtrail.Options, which is used in cloudtrail.go. Adding this case would prevent the default branch from being hit during normal operation. Consider adding:

case *cloudtrail.Options:
    opts.BaseEndpoint = val

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@moshloop moshloop merged commit 01588fb into main Jan 29, 2025
10 checks passed
@moshloop moshloop deleted the fix-ep branch January 29, 2025 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants