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

AWS Provider for OCI Does not account for disconnected AWS partitions #832

Open
ngearhart opened this issue Dec 6, 2024 · 2 comments · May be fixed by #835
Open

AWS Provider for OCI Does not account for disconnected AWS partitions #832

ngearhart opened this issue Dec 6, 2024 · 2 comments · May be fixed by #835

Comments

@ngearhart
Copy link

ngearhart commented Dec 6, 2024

oci/auth/aws/auth.go::40

var registryPartRe = regexp.MustCompile(`([0-9+]*).dkr.ecr(?:-fips)?\.([^/.]*)\.(amazonaws\.com[.cn]*)`)

This regular expression is used to determine if flux should try to authenticate to the AWS API when pulling an OCI resource. However, this regex does not support some other AWS regions, notably disconnected AWS partitions.
Thus, flux does not detect that it is in AWS and fails due to missing username/password.

Why is this implemented as such? If the user is already forced to specify provider: aws on helmrepositories for example, why does flux still parse the URL instead of de-facto authenticating?

I recommend removing this check and assuming the OCI endpoint requires AWS authentication if the user specifies provider: aws regardless of the URL. If the user in error specifies provider: aws for a non-AWS-backed OCI repo, then flux should fail.

@ngearhart
Copy link
Author

ngearhart commented Dec 6, 2024

I understand that an alternative path to implementing this would be to expand the regex to include these disconnected partitions, but it seems like there is a bigger discussion that should happen around this.

@ngearhart
Copy link
Author

After further investigation, it looks like this happens because the regex tries to pull the region out of the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment