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
# (doing these in the same run means the manifest from above should be cached and exercise more codepaths for better coverage)
51
+
52
+
--type manifest 'tianon/test@sha256:347290ddd775c1b85a3e381b09edde95242478eb65153e9b17225356f4c072ac'# same manifest again, but without SynthesizeIndex
53
+
--type blob 'tianon/test@sha256:d2c94e258dcb3c5ac2798d32e1249e42ef01cba4841c2234249495f87264ac5a'# first config blob from the above
mu sync.Mutex// TODO some kind of per-object/name/digest mutex so we don't request the same object from the upstream registry concurrently (on *top* of our maps mutex)?
36
-
hasmap[string]bool// "repo/name@digest" => true (whether a given repo has the given digest)
typesmap[ociregistry.Digest]string// digest => "mediaType" (most recent *storing* / "cache-miss" lookup wins, in the case of upstream/cross-repo ambiguity)
39
-
datamap[ociregistry.Digest][]byte// digest => data
34
+
mu sync.Mutex// TODO some kind of per-object/name/digest mutex so we don't request the same object from the upstream registry concurrently (on *top* of our maps mutex)?
35
+
hasmap[string]bool// "repo/name@digest" => true (whether a given repo has the given digest)
datamap[ociregistry.Digest]ociregistry.Descriptor// digest => mediaType+size(+data) (most recent *storing* / "cache-miss" lookup wins, in the case of upstream/cross-repo ambiguity)
digest=desc.Digest// if this isn't a no-op, we've got a naughty registry
151
+
152
+
rc.has[cacheKeyDigest(repo, digest)] =true
153
+
154
+
// carefully copy only valid Resolve* fields such that any other existing fields are kept (this matters more if we ever make our mutexes better/less aggressive 👀)
// carefully copy only valid Resolve* fields such that any other existing fields are kept (this matters more if we ever make our mutexes better/less aggressive 👀)
195
+
ifd, ok:=rc.data[desc.Digest]; ok {
196
+
d.MediaType=desc.MediaType
197
+
d.Digest=desc.Digest
198
+
d.Size=desc.Size
199
+
desc=d
141
200
}
201
+
rc.data[desc.Digest] =desc
142
202
143
-
returnocimem.NewBytesReader(b, desc), nil
203
+
returndesc, nil
144
204
}
145
205
146
206
// TODO more methods (currently only implements what's actually necessary for SynthesizeIndex)
0 commit comments