You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
manifest: add zstd:chunked sentinel annotation support and instance selection
Add annotation constants for identifying zstd:chunked sentinel layers
in OCI manifests. Extend instance candidate selection to prefer
manifests with sentinel annotations when available.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
funcinstanceSortScore(d imgspecv1.Descriptor) int {
235
+
ifinstanceHasSentinel(d) {
236
+
return2
237
+
}
238
+
ifinstanceIsZstd(d) {
239
+
return1
240
+
}
241
+
return0
242
+
}
243
+
221
244
typeinstanceCandidatestruct {
222
245
platformIndexint// Index of the candidate in platform.WantedPlatforms: lower numbers are preferred; or math.maxInt if the candidate doesn’t have a platform
223
246
isZstdbool// tells if particular instance if zstd instance
247
+
hasSentinelbool// tells if particular instance has the zstd:chunked sentinel layer
224
248
manifestPositionint// A zero-based index of the instance in the manifest list
logrus.Debugf("Selected instance %s with zstd:chunked sentinel (position %d in index)", bestMatch.digest, bestMatch.manifestPosition)
295
+
}
267
296
returnbestMatch.digest, nil
268
297
}
269
298
return"", fmt.Errorf("no image found in image index for architecture %q, variant %q, OS %q", wantedPlatforms[0].Architecture, wantedPlatforms[0].Variant, wantedPlatforms[0].OS)
0 commit comments