Inform user to use Registry Environment variables #337
Labels
carvel accepted
This issue should be considered for future work and that the triage process has been completed
enhancement
This issue is a feature request
Hi,
When copying from a public registry to a registry that requires authentication and setting IMGPKG_USERNAME and IMGPKG_PASSWORD env vars, imgpkg also uses the credentials to authenticate with the public registry, which causes it to respond with 401 Unauthorized.
One way to solve the problem would be for me to use IMGPKG_REGISTRY_HOSTNAME_0, IMGPKG_REGISTRY_USERNAME_0, and IMGPKG_REGISTRY_PASSWORD_0 env vars for the registry that requires authentication instead.
The other solution would be to use docker login (provided I have docker installed) without setting those two env vars. In the latter approach, I don't run into the described problem when copying between two registries,
since ~/.docker/config lists the registry which requires authentication. Whereas IMGPKG_USERNAME and IMGPKG_PASSWORD appear to be used both with a source and destination registry.
So, in a scenario, when I copy between two registries, and I execute imgpkg copy --help to find out how to do it, it would be great to see a recommendation to use IMGPKG_REGISTRY_HOSTNAME_<#>, IMGPKG_REGISTRY_USERNAME_<#>, and IMGPKG_REGISTRY_PASSWORD_<#> env vars
right under the line # Copy image dkalinin/app1-image to another registry (or repository) in the examples section.
Thanks.
The text was updated successfully, but these errors were encountered: