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
WIP: Sketch PutBlob... digest choice in c/image/copy + transports
This is:
- UNUSABLE (no external API)
- INCOMPLETE (manifest digests, TryReusingBlob, ...)
- BROKEN (various code assumes that digest returned from upload matches input)
- INCONSISTENT (PutBlobOptions.Digests is only implemented in one transport,
and silently ignored elsewhere)
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
returnerrors.New("writing sigstore attachments is disabled by configuration")
706
707
}
707
708
709
+
digestOptions, err:=digests.CanonicalDefault().WithDefault(digest.Canonical) // FIXME: This is bad and redundant, but we ultimately want the choice to be provided by the caller; and this way it shows up on audit searches for digest.Canonical.
// Check that the returned digest is compatible with options.Digests. If it isn’t, there’s nothing we can do, but at least the callers of PutBlobWithOptions
// if they use internal/imagedestination/impl.Compat;
112
113
// in that case, they will all be consistently zero-valued.
113
114
114
-
EmptyLayerbool// True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
115
-
LayerIndex*int// If the blob is a layer, a zero-based index of the layer within the image; nil otherwise.
115
+
EmptyLayerbool// True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
116
+
LayerIndex*int// If the blob is a layer, a zero-based index of the layer within the image; nil otherwise.
117
+
Digests digests.Options// Unlike other private fields, this is always initialized, and mandatory requests are enforced by the compatibility wrapper.
118
+
CannotChangeDigestReasonstring// The reason why PutBlobWithOptions is provided with a digest and the destination must use precisely that one (in particular, use that algorithm).
116
119
}
117
120
118
121
// PutBlobPartialOptions are used in PutBlobPartial.
@@ -268,6 +269,10 @@ func (d *blobCacheDestination) TryReusingBlobWithOptions(ctx context.Context, in
268
269
returnpresent, reusedInfo, err
269
270
}
270
271
272
+
digestOptions, err:=digests.CanonicalDefault().WithDefault(digest.Canonical) // FIXME: This is bad and redundant, but we ultimately want the choice to be provided by the caller; and this way it shows up on audit searches for digest.Canonical.
0 commit comments