Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Add AWS China region domain to recognized ECR hosts #2982

Merged
merged 2 commits into from
Apr 7, 2020

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Apr 7, 2020

Fixes #2964.

@hiddeco hiddeco force-pushed the aws-partition-domains branch 2 times, most recently from 138a98f to d316e04 Compare April 7, 2020 07:57
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

AWS has regions and services in different partitions, all partitions
seem to use a .com hostname except for the "aws-cn" region that uses
.com.cn. This hostname was not taken into account, resulting in Flux
being unable to pull image metadata in the China region.

https://github.com/aws/aws-sdk-go/blob/d232400/aws/endpoints/defaults.go
@hiddeco hiddeco changed the title Add AWS China region domain to recognize ECR hosts Add AWS China region domain to recognized ECR hosts Apr 7, 2020
@hiddeco hiddeco added the bug label Apr 7, 2020
@hiddeco hiddeco merged commit 32b88c5 into master Apr 7, 2020
@hiddeco hiddeco deleted the aws-partition-domains branch April 7, 2020 12:47
@@ -51,6 +54,15 @@ func contains(strs []string, str string) bool {
return false
}

func validECRHost(domain string) bool {
switch {
case strings.HasSuffix(domain, awsPartitionSuffix):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No implicit fallthrough in Go!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error of fetching image metadata from AWS ECR(China region)
4 participants