Skip to content

Commit

Permalink
Hide cache log info
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjohnsonjr committed Dec 6, 2021
1 parent 1d0c79b commit f6da708
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/build/gobuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import (

const (
defaultAppFilename = "ko-app"
debug = false
)

type diffIDToDescriptor map[v1.Hash]v1.Descriptor
Expand Down Expand Up @@ -701,11 +702,13 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, base v1.Image, pl
if os.Getenv("KOCACHE") != "" {
binaryLayer, err = g.cache.get(ctx, appPath, file, platform)
if err != nil {
log.Printf("Cache miss: %s for %s: %v", ref.Path(), platformToString(*platform), err)
if debug {
log.Printf("Cache miss: %s for %s: %v", ref.Path(), platformToString(*platform), err)
}

// Make typecheck below fail
binaryLayer = nil
} else {
} else if debug {
log.Printf("Cache hit: %s for %s", ref.Path(), platformToString(*platform))
}
}
Expand All @@ -730,7 +733,7 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, base v1.Image, pl
if os.Getenv("KOCACHE") != "" {
if err := g.cache.put(ctx, file, binaryLayer); err != nil {
log.Printf("failed to cache metadata for %s: %v", ref.Path(), err)
} else {
} else if debug {
log.Printf("Cached %s for %s under %s", ref.Path(), platformToString(*platform), filepath.Dir(file))
}
}
Expand Down

0 comments on commit f6da708

Please sign in to comment.