-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
scrapers/aws/aws.go
Outdated
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") | ||
} | ||
} |
There was a problem hiding this comment.
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.
scrapers/aws/aws.go
Outdated
default: | ||
fmt.Println("Unsupported options type") | ||
} |
There was a problem hiding this comment.
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.
No description provided.