-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should oras.Copy()
follow manifests specified in the layers
or the blobs
field?
#401
Comments
oras.Copy()
should not follow manifests specified in the layers
or the blobs
fieldoras.Copy()
follow manifests specified in the layers
or the blobs
field?
Scenario 1: RepositorySuppose there is such a DAG, where manifest B references manifest A as one of its layers, and manifest list C references A* (identical to A) as one of its manifests. Doubtlessly, manifest A* should be treated as a non-leaf node and should be pushed to the repository via the manifest endpoint.
graph TD
A[Manifest A]
AS[Manifest A*]
B[Manifest B]
C[Manifest List C]
D[Manifest List D]
E[Blob E]
A -.-> E
AS --> E
B -- layers --> A
C -- manifests --> AS
D --> B
D --> C
|
Scenario 2: OCI LayoutSuppose there is such a DAG, where manifest A is referenced by manifest B as a layer and is referenced by manifest list C as a manifest. graph TD
A[Manifest A]
B[Manifest B]
C[Manifest List C]
D[Manifest List D]
E[Blob E]
A --> E
B -- layers --> A
C -- manifests --> A
D --> B
D --> C
|
Scenario 3: Repository Double CASsSuppose the below DAG is being copied to a remote repository, should manifest A be pushed via the manifest endpoint or via the blob endpoint? Or should it be pushed twice via both endpoints? graph TD
A[Manifest A]
B[Manifest B]
B -- layers --> A
B -- subject --> A
|
Interestingly, the {
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1",
"size": 32,
"annotations": {
"buildkit/createdat": "2023-01-13T07:49:09.921545067Z",
"containerd.io/uncompressed": "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
}
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:d74d7d17ce90514c5eed8068791ab9b1d58f355a367c6a87bd3e0e1dc8113500",
"size": 105,
"annotations": {
"buildkit/createdat": "2023-01-13T07:49:09.864832789Z",
"containerd.io/uncompressed": "sha256:601bb128dc20e9b8a296510b1c840d58dfd7d596ae1396d52e886753423c052c"
}
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:df9b9388f04ad6279a7410b85cedfdcb2208c0a003da7ab5613af71079148139",
"size": 2814559,
"annotations": {
"buildkit/createdat": "2023-01-13T07:48:28.219213701Z",
"containerd.io/uncompressed": "sha256:4fc242d58285699eca05db3cc7c7122a2b8e014d9481f323bd9277baacfa0628"
}
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:eb630b592770ba0b3982595e566c1027966cf6b9733c5fc1bf0794bf6bc2c9cd",
"size": 3578366,
"annotations": {
"buildkit/createdat": "2023-01-13T07:49:09.693226029Z",
"containerd.io/uncompressed": "sha256:3cb741a610a6253327467f4bb4e3de9397c36846b2407dc56992c04475ced968"
}
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:ed0f0d4a18721d4dc5d5d8ffb7eaeb0df00ab5d1001bfa594419a1b8dd5ffc09",
"size": 2581904,
"annotations": {
"buildkit/createdat": "2023-01-13T07:48:34.097896893Z",
"containerd.io/uncompressed": "sha256:6d69e1b372ea8a2e13783b213f4cf108be422a05740625a209a054b48c9a76cd"
}
},
{
"mediaType": "application/vnd.buildkit.cacheconfig.v0",
"digest": "sha256:f06f3ad8ce85bcc973c15a11f419e7601e74db8db0e7af8d05587d24d77ffc83",
"size": 2407
}
]
} |
We may need to introduce a new method to return leaf successors and non-leaf successors separately, as a complement to Lines 47 to 106 in 76382aa
|
Currently,
oras.Copy()
follows all the successors of a node to copy all the sub-DAGs.For manifests specified in the
layers
field of OCI Image manifests or theblobs
field of OCI Artifact manifests, shouldoras.Copy()
treat them as leaf nodes or follow them to copy the sub-DAGs?The text was updated successfully, but these errors were encountered: