-
Notifications
You must be signed in to change notification settings - Fork 206
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 reference manifest also contains Subject
field?
#467
Comments
It's not a great example, but we don't have any good examples for adding a subject to the Index manifest to work from, so this seems good enough to verify registries support a subject on both the Index manifest and Image manifests.
This example doesn't violate the DAG since it's still directed and acyclic. However, if you treat referrers to an image as child objects of that image, then the addition of the subject to the index introduces the possibility of a logical loop. E.g. you can have in Index with: manifests: [
{ digest: "sha256:12345..." }
],
subject: {
digest: "sha256:12345..."
} And traversing from the index to 12345 as the child manifest, you would query the referrers to 12345 and return back to the index. For an example of that, see |
Actually, we are currently seeking clarification on the meaning of the "subject" field in the image index. From my understanding, the image index serves as a collection of multiple image manifests rather than an image manifest itself, so it may not have a specific meaning in this context. Consequently, it raises the question of whether the subject of an image index should imply that all the references within the image index point to the same subject manifest. If so, it would not be necessary to define the subject for each reference within the image index. From the perspective of registry rendering, the structure of the image index(with subject)is not strictly hierarchical like a tree; it resembles more of a diagram. When making a call to the Referrers API to list the referrers, both the image index and its references will be displayed, meanwhile all the references are pointing the same image index. |
The index is a manifest of it's own, pushed to the manifest API with its own digest and media type. It happens to contain a list of manifest descriptors instead of a list of blob descriptors.
An image can be listed in multiple index manifests, and single platform image manifests may be copied to a different repository without copying the index. I worry this would create more problems for both clients and servers.
Different people have suggested different interpretations of the DAG structure. Some suggest that the index with a subject field would be the top level of the DAG, and the subject image is a child. I tend to agree with you on the path users take to read it, following the Referrers API, which means the index gets added as a child of the subject manifest. The complication with the index having a subject is that the index's own children could be parents to the subject manifest, resulting in a loop in that concept of the DAG. So depending on how you build the DAG structure in your own tooling, that may require a change to the existing logic. |
After running the "test03ContentDiscovery()" test case against Harbor registry, the "Teardown > References teardown" case failed.
The request sent out is:
cat the content of
sha256:be25
:cat the content of
sha256:a77a
:cat the content of
sha256:f2a0
:We noticed that the index manifest
sha256:be25
, and reference manifestsha256:a77a
&sha256:f2a0
all contain aSubject
field. My questions are:sha256:a77a
&sha256:f2a0
also contain aSubject
field? Or there should not be aSubject
field within the reference manifestsha256:a77a
&sha256:f2a0
.sha256:be25
, and reference manifestsha256:a77a
&sha256:f2a0
all contain the sameSubject
identified by hash digestsha256:ab43
. This seems violates the DAG (directed acyclic graph) rule.Thanks for your help!
The text was updated successfully, but these errors were encountered: