Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions go/pkg/layer/append.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ func AppendLayers(ctx context.Context, store content.Store, baseManifestDesc oci
manifest.Annotations = annotations
imageConfig.Created = &created

// If we have a base ref, use it to construct and add the OCI base image annotations for the image we're building.
if baseRef != "" {
baseRefParsed, err := ociutil.NamedRef(baseRef)
if err != nil {
return ocispec.Descriptor{}, ocispec.Descriptor{}, fmt.Errorf("could not parse base ref as named reference: %w", err)
}
annotations[ocispec.AnnotationBaseImageName] = baseRefParsed.Name()
annotations[ocispec.AnnotationBaseImageDigest] = baseManifestDesc.Digest.String()
}

diffIDs := make([]digest.Digest, 0, len(layers))
history := make([]ocispec.History, 0, len(layers))
for _, layer := range layers {
Expand Down