Skip to content

Commit 5ca6303

Browse files
committed
Use annotation to mark where image came from
1 parent e1f14aa commit 5ca6303

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/compass/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ func freeze(src, path string) {
100100
if err != nil {
101101
log.Fatalf("reading image %q: %v", ref, err)
102102
}
103-
// TODO: WithAnnotation -- put source in there.
104-
if _, err := layout.AppendImage(path, img); err != nil {
103+
104+
annotations := map[string]string{
105+
"org.opencontainers.image.ref.name": t,
106+
}
107+
if _, err := layout.AppendImage(path, img, layout.WithAnnotations(annotations)); err != nil {
105108
log.Fatalf("writing image %q: %v", path, err)
106109
}
107110
}

0 commit comments

Comments
 (0)