Skip to content
Merged
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
8 changes: 7 additions & 1 deletion cache/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ func (md *cacheMetadata) queueMediaType(str string) error {
}

func (md *cacheMetadata) getSnapshotID() string {
return md.GetString(keySnapshot)
sid := md.GetString(keySnapshot)
// Note that historic buildkit releases did not always set the snapshot ID.
// Fallback to record ID is needed for old build cache compatibility.
if sid == "" {
return md.ID()
}
return sid
}

func (md *cacheMetadata) queueSnapshotID(str string) error {
Expand Down