Skip to content

oci/auth: Fix ImageRegistryProvider for repo root#434

Merged
darkowlzz merged 1 commit intomainfrom
fix-oci-repo-root-login
Dec 14, 2022
Merged

oci/auth: Fix ImageRegistryProvider for repo root#434
darkowlzz merged 1 commit intomainfrom
fix-oci-repo-root-login

Conversation

@darkowlzz
Copy link
Copy Markdown
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
@darkowlzz darkowlzz force-pushed the fix-oci-repo-root-login branch from ab7013d to faac385 Compare December 14, 2022 16:34
Copy link
Copy Markdown
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 🏅

@darkowlzz darkowlzz force-pushed the fix-oci-repo-root-login branch from faac385 to 3228dd6 Compare December 14, 2022 16:45
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 <darkowlzz@protonmail.com>
Copy link
Copy Markdown
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
Copy Markdown
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

None yet

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