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 crane's auth command to facilitate logging into a registry #243

Merged
merged 2 commits into from
Nov 9, 2020

Conversation

tcnghia
Copy link
Contributor

@tcnghia tcnghia commented Nov 7, 2020

Fixes #155

/assign @jonjohnsonjr @mattmoor

@codecov-io
Copy link

Codecov Report

Merging #243 (f5ec346) into master (36a921f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #243   +/-   ##
=======================================
  Coverage   37.19%   37.19%           
=======================================
  Files          33       33           
  Lines        1460     1460           
=======================================
  Hits          543      543           
  Misses        828      828           
  Partials       89       89           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36a921f...f5ec346. Read the comment docs.

@mattmoor mattmoor merged commit 715c03e into ko-build:master Nov 9, 2020
@jonjohnsonjr
Copy link
Collaborator

I would have just snagged the login command, not both, but the cobra doc is currently hardcoded to crane:

$ ko auth login --help
Log in to a registry

Usage:
  ko auth login [OPTIONS] [SERVER] [flags]

Examples:
  # Log in to reg.example.com
  crane auth login reg.example.com -u AzureDiamond -p hunter2

Flags:
  -h, --help              help for login
  -p, --password string   Password
      --password-stdin    Take the password from stdin
  -u, --username string   Username

Easy, hacky solution would be to just replace logincmd.Example with your own hard-coded string.

More involved solution would be to rework NewCmdAuthLogin to figure out what command group it's in and print the right thing. I'm not sure if that's possible.

@mattmoor
Copy link
Collaborator

mattmoor commented Nov 9, 2020

@jonjohnsonjr We could make the function use os.Args[0] 😉

@jonjohnsonjr
Copy link
Collaborator

jonjohnsonjr commented Nov 9, 2020

That's not sufficient because for crane that would just be crane login but in reality we need crane auth login, which makes me regret this command group entirely, and I think they should have just been top level.

@jonjohnsonjr jonjohnsonjr mentioned this pull request Nov 10, 2020
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.

Support ko login
4 participants