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

Fall back to non fips endpoint per availability #1897

Merged
merged 1 commit into from
Jul 24, 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
8 changes: 5 additions & 3 deletions nodeadm/internal/aws/ecr/ecr.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ecr
import (
"context"
"fmt"
"go.uber.org/zap"
"net"
"strings"
"time"
Expand Down Expand Up @@ -49,10 +50,11 @@ func GetEKSRegistry(region string) (ECRRegistry, error) {
}
if fipsInstalled && fipsEnabled {
fipsRegistry := getRegistry(account, "ecr-fips", region, servicesDomain)
if addresses, err := net.LookupHost(fipsRegistry); err != nil {
return "", err
} else if len(addresses) > 0 {
addresses, err := net.LookupHost(fipsRegistry)
if err == nil && len(addresses) > 0 {
Issacwww marked this conversation as resolved.
Show resolved Hide resolved
return ECRRegistry(fipsRegistry), nil
} else {
zap.L().Info("Fail to look up Fips registry for requested region, fall back to default", zap.String("fipsRegistry", fipsRegistry))
}
}
return ECRRegistry(getRegistry(account, "ecr", region, servicesDomain)), nil
Expand Down
Loading