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

Docker Hub default namespace is removed on write back #1012

Open
AlessandroZanatta opened this issue Jan 14, 2025 · 2 comments · May be fixed by #1014
Open

Docker Hub default namespace is removed on write back #1012

AlessandroZanatta opened this issue Jan 14, 2025 · 2 comments · May be fixed by #1014
Labels
enhancement New feature or request

Comments

@AlessandroZanatta
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I would like to be able to specify every image name as a fully qualified name, that is, registry.url/namespace/imagename:tag.

However, this is not possible for docker.io/library/<...>, as the library/ part gets removed here (I think).

When using git write-back-method and the kustomization write-back-target, that is:

    argocd-image-updater.argoproj.io/write-back-method: git
    argocd-image-updater.argoproj.io/write-back-target: kustomization

it results in the following kustomization update:

images:
  - name: docker.io/postgres
    newTag: 16.6-alpine

which does not match the image tag in the pod, such as docker.io/library/postgres:16-alpine, hence the pod is not rolled to the new image by argocd.

Describe the solution you'd like
Would it be possible to avoid removing the default namespace? The comment here does not specify why this gets removed, could you please clarify? If it's something that can be fixed, I'd be happy to send a PR for it!

I've also tried specifying the Docker Hub registry in the configuration with a blank defaultNs, but that resulted in errors from the registry:

time="2025-01-14T08:42:37+01:00" level=error msg="Could not get tags from registry: errors:\ndenied: requested access to the resource is denied\nunauthorized: authentication required\n" alias=postgres application=anime image_name=postgres image_tag=16-alpine registry=docker.io

I do not see a way to enforce retaining the library part in the image name in the docs (unless I missed it, that is).

Describe alternatives you've considered
The alternative is leaving the library/ part out of the image names, which I do not particularly like given that all the other images are fully qualified.

Additional context
I think it's a pretty niche feature, but also a slight improvement that could be added to this amazing project!

@AlessandroZanatta AlessandroZanatta added the enhancement New feature or request label Jan 14, 2025
@chengfang
Copy link
Collaborator

I guess library/ is removed for the sake of brevity, since this is a default namespace value that users don't have to specify. And also the removal is conditional. Maybe we can improve the condition to cover your case, e.g., when library/ is in the middle of the string not as a prefix.

@jannfis
Copy link
Contributor

jannfis commented Jan 16, 2025

For some more context, #275 was the PR that introduced it and it had some discussions around exactly that piece of logic.

AlessandroZanatta added a commit to AlessandroZanatta/argocd-image-updater that referenced this issue Jan 17, 2025
AlessandroZanatta added a commit to AlessandroZanatta/argocd-image-updater that referenced this issue Jan 17, 2025
AlessandroZanatta added a commit to AlessandroZanatta/argocd-image-updater that referenced this issue Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants