From 0427aed99b437b32cc399fa50bcaef488bf4c1fd Mon Sep 17 00:00:00 2001 From: jonjohnsonjr Date: Tue, 22 Dec 2020 09:12:27 -0800 Subject: [PATCH] Add ko login (#277) This was previously `ko auth login`, which I've hidden, and perhaps we can alias to `ko login` in the future, but in theory folks could have been using `ko auth get`, and I don't want to break that for no reason. --- README.md | 2 +- cmd/ko/main.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 596a443e8f..f7dff2741e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ container registry is via `docker login`, and `ko` does not require users to install `docker` locally. To facilitate logging in without `docker` we expose: ```shell -ko auth login my.registry.io -u username --password-stdin +ko login my.registry.io -u username --password-stdin ``` ## The `ko` Model diff --git a/cmd/ko/main.go b/cmd/ko/main.go index 2e85db545a..99fd837728 100644 --- a/cmd/ko/main.go +++ b/cmd/ko/main.go @@ -41,7 +41,13 @@ func main() { // Also add the auth group from crane to facilitate logging into a // registry. - cmds.AddCommand(cranecmd.NewCmdAuth()) + authCmd := cranecmd.NewCmdAuth("ko", "auth") + // That was a mistake, but just set it to Hidden so we don't break people. + authCmd.Hidden = true + cmds.AddCommand(authCmd) + + // Just add a `ko login` command: + cmds.AddCommand(cranecmd.NewCmdAuthLogin()) if err := cmds.Execute(); err != nil { log.Fatalf("error during command execution: %v", err)