Skip to content

Commit

Permalink
Revive progress and warning logs (ko-build#203)
Browse files Browse the repository at this point in the history
These got dropped when we pulled in:
google/go-containerregistry#481

Which doesn't log by default, and requires opting in.
  • Loading branch information
jonjohnsonjr authored Sep 25, 2020
1 parent d487673 commit 4a4d1b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/ko/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ package main

import (
"log"
"os"

"github.com/google/go-containerregistry/pkg/logs"
"github.com/google/ko/pkg/commands"

"github.com/spf13/cobra"
)

func main() {
logs.Warn.SetOutput(os.Stderr)
logs.Progress.SetOutput(os.Stderr)

// Parent command to which all subcommands are added.
cmds := &cobra.Command{
Use: "ko",
Expand Down
3 changes: 2 additions & 1 deletion pkg/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ func getBaseImage(platform string) build.GetBase {
}

return func(s string) (build.Result, error) {
s = strings.TrimPrefix(s, build.StrictScheme)
// Viper configuration file keys are case insensitive, and are
// returned as all lowercase. This means that import paths with
// uppercase must be normalized for matching here, e.g.
// github.com/GoogleCloudPlatform/foo/cmd/bar
// comes through as:
// github.com/googlecloudplatform/foo/cmd/bar
ref, ok := baseImageOverrides[strings.ToLower(strings.TrimPrefix(s, build.StrictScheme))]
ref, ok := baseImageOverrides[strings.ToLower(s)]
if !ok {
ref = defaultBaseImage
}
Expand Down

0 comments on commit 4a4d1b0

Please sign in to comment.