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

Potential Bug: Can't download from authenticated registry #94

Closed
neoakris opened this issue Dec 7, 2021 · 4 comments
Closed

Potential Bug: Can't download from authenticated registry #94

neoakris opened this issue Dec 7, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@neoakris
Copy link

neoakris commented Dec 7, 2021

Environmental Info:
RHEL7 x64, bash

Hauler Version:
hauler version

GitVersion:  0.2.1
GitCommit:   32d24b2
BuildDate:   2021-11-16T19:05:25Z
GoVersion:   go1.17.3
Compiler:    gc
Platform:    linux/amd64

System CPU architecture, OS, and Version:
uname -a

Linux master 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Describe the bug:
Can't seem to pull from authenticated repo using the declarative contents file

Steps To Reproduce:

curl -L https://github.com/rancherfederal/hauler/releases/download/v0.2.1/hauler_0.2.1_linux_amd64.tar.gz > hauler.tar.gz
tar -xzf hauler.tar.gz
sudo mv hauler /usr/bin/hauler

export REGISTRY1_USERNAME=<REPLACE_ME>
export REGISTRY1_PASSWORD=<REPLACE_ME>
echo $REGISTRY1_PASSWORD | docker login registry1.dso.mil --username $REGISTRY1_USERNAME --password-stdin

docker pull registry1.dso.mil/ironbank/elastic/eck-operator/eck-operator:1.7.1
# works

cat > debug-hauler-config.yaml <<EOF
apiVersion: content.hauler.cattle.io/v1alpha1
kind: Images
metadata:
  name: bigbang-images
spec:
  images:
    - ref: registry1.dso.mil/ironbank/elastic/eck-operator/eck-operator:1.7.1
EOF

hauler store sync -f debug-hauler-config.yaml
# Error: GET https://registry1.dso.mil/v2/ironbank/elastic/eck-operator/eck-operator/manifests/1.7.1: UNAUTHORIZED: unauthorized to access repository: ironbank/elastic/eck-operator/eck-operator, action: pull: unauthorized to access repository: ironbank/elastic/eck-operator/eck-operator, action: pull
# Usage:
#   hauler store add image [flags]
# 
# Flags:
#   -h, --help   help for image
# 
# Global Flags:
#       --cache string       Location of where to store cache data (defaults to $XDG_CACHE_DIR/hauler)
#   -l, --log-level string    (default "info")
#   -s, --store string       Location to create store at (defaults to $PWD/store)
# 
# 4:12AM ERR GET https://registry1.dso.mil/v2/ironbank/elastic/eck-operator/eck-operator/manifests/1.7.1: UNAUTHORIZED: unauthorized to access repository: ironbank/elastic/eck-operator/eck-operator, action: pull: unauthorized to access repository: ironbank/elastic/eck-operator/eck-operator, action: pull

Expected behavior:

  • Since docker pull works I expect hauler store to work
  • Note the following imperative hauler command gives the same error
    hauler store add image registry1.dso.mil/ironbank/elastic/eck-operator/eck-operator:1.7.1
  • Side note the time is off as well, system time says 11:11pm, hauler shows 4:11am

Actual behavior:
Error seen above

Additional context / logs:

  • @joshrwolf will be better able to debug as he has access to registry1.dso.mil
  • That being said registry1.dso.mil allows open self registration
@neoakris
Copy link
Author

neoakris commented Dec 7, 2021

ah this is a duplicate issue #35

@joshrwolf
Copy link
Contributor

this should be fixed in master with #87, and will be released with #93.

the default behavior will now use the same creds that docker uses, so docker login ... first, and then subsequent hauler commands will leverage the same keychain, but each command that interacts with a remote registry will also allow for a --username and --password entry.

@joshrwolf
Copy link
Contributor

will leave this open until #93 is closed and let you validate that it functions as you'd expect

@joshrwolf joshrwolf added the bug Something isn't working label Dec 8, 2021
@zackbradys
Copy link
Member

Closing as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Resolved
Development

No branches or pull requests

3 participants