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
// let the "fallback" ref keep a tag when it's the tag we're copying and there's no known digest (this allows our normalized objects to still be completely valid "raw" inputs)
235
+
continue
236
+
}
220
237
ref.Tag=""
221
238
ref.Digest=""
222
239
normal.Lookup[d] =ref
223
240
}
224
241
242
+
// front-load some validation / data extraction for "normal.do" to work
returnnormal, fmt.Errorf("%s: blobs are always by-digest, and thus need a digest: %s", debugId, normal.CopyFrom)
267
+
}
268
+
269
+
default:
270
+
panic("unknown type: "+string(normal.Type))
271
+
// panic instead of error because this should've already been handled/normalized above (so this is a coding error, not a runtime error)
272
+
}
273
+
274
+
returnnormal, nil
275
+
}
276
+
277
+
// WARNING: many of these codepaths will end up writing to "normal.Lookup", which because it's a map is passed by reference, so this method is *not* safe for concurrent invocation on a single "normal" object! see "normal.clone" (above)
// if we don't have a digest here, it must be because we're copying from tag to tag, so we'll just assume normal.CopyFrom is non-nil and let the runtime panic for us if the normalization above doesn't have our back
// if we don't have an explicit destination tag, this is considered a request to copy-manifest-from-tag-but-push-by-digest, which is weird, but valid, so we need to copy up that digest into what we look for on the destination side
327
+
dstRef.Digest=targetDigest
263
328
}
264
329
}
265
-
330
+
casetypeBlob:
331
+
lookupType=registry.LookupTypeBlob
332
+
iftargetDigest=="" {
333
+
// see validation above in normalization
334
+
panic("blob ref missing digest, this should never happen: "+dstRef.String())
335
+
}
266
336
default:
267
337
panic("unknown type: "+string(normal.Type))
268
338
// panic instead of error because this should've already been handled/normalized above (so this is a coding error, not a runtime error)
0 commit comments