Skip to content

Commit

Permalink
Merge pull request #1922 from tylarb/silence_using_cache
Browse files Browse the repository at this point in the history
Silence "using cache" to ensure -q is fully quiet
  • Loading branch information
rhatdan authored Oct 21, 2019
2 parents 120c37f + 83b881e commit 588edb8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion imagebuildah/stage_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,12 @@ func (s *StageExecutor) Execute(ctx context.Context, stage imagebuilder.Stage, b
s.executor.log(commitMessage)
}
}
logCacheHit := func(cacheID string) {
if !s.executor.quiet {
cacheHitMessage := "--> Using cache"
fmt.Fprintf(s.executor.out, "%s %s\n", cacheHitMessage, cacheID)
}
}
logImageID := func(imgID string) {
if s.executor.iidfile == "" {
fmt.Fprintf(s.executor.out, "%s\n", imgID)
Expand Down Expand Up @@ -909,7 +915,7 @@ func (s *StageExecutor) Execute(ctx context.Context, stage imagebuilder.Stage, b
}
if cacheID != "" {
// Note the cache hit.
fmt.Fprintf(s.executor.out, "--> Using cache %s\n", cacheID)
logCacheHit(cacheID)
} else {
// We're not going to find any more cache hits.
checkForLayers = false
Expand Down

0 comments on commit 588edb8

Please sign in to comment.