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

add login command #177

Merged
merged 1 commit into from
Feb 16, 2024
Merged

add login command #177

merged 1 commit into from
Feb 16, 2024

Conversation

amartin120
Copy link
Contributor

@amartin120 amartin120 commented Feb 15, 2024

Please check below, if the PR fulfills these requirements:

  • The commit message follows the guidelines.
  • Tests for the changes have been added (for bug fixes / features).
  • Docs have been added / updated (for bug fixes / features).

What kind of change does this PR introduce?

  • adds login command.

What is the current behavior?

  • Currently, before dealing with authenticated registries via hauler store add/sync you need to do a docker/cosign login prior to issuing those commands.

What is the new behavior (if this is a feature change)?

  • hauler login has been added meaning you still have to run a login command, but now it's just part of the hauler toolset.
❯ hauler login harbor.amartin.cloud -u <user> -p <password>                                                                                                                                                                                                                                                    
4:03PM INF logged in via /Users/amartin/.docker/config.json

image

Does this PR introduce a breaking change?

  • Shouldn't.

Other information:

Signed-off-by: Adam Martin <[email protected]>
@zackbradys zackbradys linked an issue Feb 16, 2024 that may be closed by this pull request
@zackbradys zackbradys added this to the Hauler v1.0.0 milestone Feb 16, 2024
@zackbradys
Copy link
Member

Hey @amartin120. What is the error message when trying to hauler store add image or hauler store copy when users don't or forget to authenticate with the registry?

@amartin120
Copy link
Contributor Author

@zackbradys

❯ ./bin/hauler store copy registry://harbor.test.cloud                                                                                                                                                                                                                                                   
8:10AM INF hauler/rancher:2.8.2
8:10AM ERR Error: remote write: HEAD https://harbor.test.cloud/v2/hauler/rancher/manifests/2.8.2: unexpected status code 401 Unauthorized (HEAD responses have no body, use GET for details)
8:10AM ERR main.go:74: error during command execution: remote write: HEAD https://harbor.test.cloud/v2/hauler/rancher/manifests/2.8.2: unexpected status code 401 Unauthorized (HEAD responses have no body, use GET for details)
Error: exit status 1

Copy link
Member

@zackbradys zackbradys left a comment

Choose a reason for hiding this comment

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

LGTM!!

@amartin120 amartin120 merged commit e825437 into hauler-dev:main Feb 16, 2024
1 check passed
@amartin120 amartin120 deleted the add-login branch February 16, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFE] Allow hauler to pull content from authenticated registries
2 participants