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

oci/auth: Fix ImageRegistryProvider for repo root #434

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented Dec 14, 2022

When a repository root is provided, ImageRegistryProvider() fails to identify the registry host. The provided name.Reference for repository root is a Tag reference.
name.ParseReference(), assumes that that given string is the name and registry host being empty defaults to index.docker.io.

ImageRegistryProvider() now takes the full address, in addition to the name.Reference and uses the full address for analysis if there's no "/" in the address, which indicates that it's a repository root.

This fixes login with repository root for all the providers, not just AWS.

Fixes fluxcd/source-controller#951, #429 .

Tested it against EKS with OCI Helm Chart, which was failing before as reported in the above issues.

@darkowlzz darkowlzz added the area/oci OCI related issues and pull requests label Dec 14, 2022
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

Thanks @darkowlzz 🏅

When a repository root is provided, ImageRegistryProvider() fails to
identify the registry host. The provided name.Reference for repository
root is a Tag reference.
name.ParseReference(), assumes that that given string is the name and
registry host being empty defaults to index.docker.io.

ImageRegistryProvider() now takes the full address, in addition to the
name.Reference and uses the full address for analysis if there's no "/"
in the address, which indicates that it's a repository root.

This fixes login with repository root for all the providers, not just
AWS.

Signed-off-by: Sunny <[email protected]>
Copy link
Member

@souleb souleb left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oci OCI related issues and pull requests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ECR: helm charts do not pull if from the root of the repository
5 participants