Skip to content

Commit

Permalink
Log base image@digest when building (#592)
Browse files Browse the repository at this point in the history
* Log base image@digest when building

* Only log full digest if the original base wasn't already specified by digest

* Remove redundant image ref
  • Loading branch information
imjasonh committed Feb 11, 2022
1 parent 89ede91 commit f8d0aca
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,21 @@ func getBaseImage(bo *options.BuildOptions) build.GetBase {
return ref, cached, nil
}

log.Printf("Using base %s for %s", ref, s)
result, err := fetch(ctx, ref)
if err != nil {
return ref, result, err
}

if _, ok := ref.(name.Digest); ok {
log.Printf("Using base %s for %s", ref, s)
} else {
dig, err := result.Digest()
if err != nil {
return ref, result, err
}
log.Printf("Using base %s@%s for %s", ref, dig, s)
}

cache[ref.String()] = result
return ref, result, nil
}
Expand Down

0 comments on commit f8d0aca

Please sign in to comment.