Skip to content

Commit

Permalink
Handle EKS Service for the Beta Endpoint. (#3143)
Browse files Browse the repository at this point in the history
  • Loading branch information
orsenthil authored Dec 10, 2024
1 parent 8dd2a5a commit 5bcc561
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/framework/resources/aws/services/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,20 @@ type AddonInput struct {

func NewEKS(cfg aws.Config, endpoint string) (EKS, error) {
var err error

var customResolver aws.EndpointResolverWithOptions
if endpoint != "" {
customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
return aws.Endpoint{
URL: endpoint,
}, nil
// EKS Custom endpoint resolver needs PartitionID, SingingRegion and URL for handling STS requests.
// TODO: default to "aws" partition for now as it handled only tests. Provide option to pass partitionID.
customResolver = aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
if service == eks.ServiceID {
return aws.Endpoint{
PartitionID: "aws",
URL: endpoint,
SigningRegion: region,
}, nil
}
// Fallback to default endpoint resolution for non EKS Services.
return aws.Endpoint{}, &aws.EndpointNotFoundError{}
})
cfg, err = config.LoadDefaultConfig(context.Background(),
config.WithEndpointResolverWithOptions(customResolver),
Expand Down

0 comments on commit 5bcc561

Please sign in to comment.