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

Handle EKS Service for the Beta Endpoint. #3143

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
sushrk marked this conversation as resolved.
Show resolved Hide resolved
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
Loading