Skip to content

Commit 27ae401

Browse files
authored
Allow using images from other accounts and regions (#2011)
1 parent 29296be commit 27ae401

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

pkg/types/spec/validations.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"strings"
2424
"time"
2525

26-
"github.com/aws/aws-sdk-go/aws/awserr"
2726
"github.com/cortexlabs/cortex/pkg/consts"
2827
"github.com/cortexlabs/cortex/pkg/lib/aws"
2928
"github.com/cortexlabs/cortex/pkg/lib/cast"
@@ -1494,31 +1493,8 @@ func validateDockerImagePath(
14941493
dockerAuthStr := docker.NoAuth
14951494

14961495
if regex.IsValidECRURL(image) {
1497-
ecrRegion := aws.GetRegionFromECRURL(image)
1498-
if ecrRegion != awsClient.Region {
1499-
return ErrorRegistryInDifferentRegion(ecrRegion, awsClient.Region)
1500-
}
1501-
1502-
operatorID, _, err := awsClient.GetCachedAccountID()
1503-
if err != nil {
1504-
return err
1505-
}
1506-
registryID := aws.GetAccountIDFromECRURL(image)
1507-
1508-
if operatorID != registryID {
1509-
return ErrorRegistryAccountIDMismatch(registryID, operatorID)
1510-
}
1511-
15121496
dockerAuthStr, err = docker.AWSAuthConfig(awsClient)
15131497
if err != nil {
1514-
if _, ok := errors.CauseOrSelf(err).(awserr.Error); ok {
1515-
// because the operator's IAM user != instances's IAM role (which is created by eksctl and
1516-
// has access to ECR), if the operator IAM doesn't include ECR access, then this will fail
1517-
// even though the instance IAM role may have access; instead, ignore this error because the
1518-
// instance will have access (this will result in missing the case where the image does not exist)
1519-
return nil
1520-
}
1521-
15221498
return err
15231499
}
15241500
} else if k8sClient != nil {

0 commit comments

Comments
 (0)