Closed rmartine-ias closed 2 months ago
spotify/techdocs
is another good test case, ours has something weird for the mediaType
(warranting checking the Content-Type header, maybe?)
This issue has been closed due to the fact that the Janus community is being sunset.
For future plugin issues, please use https://github.com/backstage/community-plugins/issues
For future showcase issues, please use https://issues.redhat.com/browse/RHIDP
For more information on the sunset, see:
https://janus-idp.io/blog/2024/07/05/future-of-janus-community https://issues.redhat.com/browse/RHIDP-3690 https://issues.redhat.com/browse/RHIDP-1018
Describe the bug
In addition to the two types of manifests supported, a manifest list can be returned, even when the Accept header forbids this.
(Tested with
application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.v1+json;q=0.9
to ensure the*/*
wasn't causing issues) This behavior from Nexus is contra to what the Docker docs say should happen:This is not handled gracefully, and the plugin fails with
rawAsset.layers is undefined
.There are several wrinkles that make this not a quick enough fix for me to do right now. First, there needs to be a way to display multiple assets that differ only by architecture. Second, we don't get size info given to us for the underlying image or its layers, only its manifest, so the naive solution ends up looking like this:
Expected Behavior
Annotating a component with a docker image name, where certain versions have multiple architectures, will result in all architecture/OS pairings displayed in the table, with some way to tell them apart. The size column will reflect image size.
What are the steps to reproduce this bug?
nexus-repository-manager/docker.image-name: bitnami/postgresql
Versions of software used and environment
Latest plugins, Nexus 3.41.1-01
I probably can't pull the time to work on this soon, as we don't use many multi-arch images.
Very incomplete patch to build on
```patch diff --git a/plugins/nexus-repository-manager/src/api/nexus-repository-manager-api-client/nexus-repository-manager-api-client.ts b/plugins/nexus-repository-manager/src/api/nexus-repository-manager-api-client/nexus-repository-manager-api-client.ts index da98e89..3af0484 100644 --- a/plugins/nexus-repository-manager/src/api/nexus-repository-manager-api-client/nexus-repository-manager-api-client.ts +++ b/plugins/nexus-repository-manager/src/api/nexus-repository-manager-api-client/nexus-repository-manager-api-client.ts @@ -31,8 +31,9 @@ const NEXUS_REPOSITORY_MANAGER_CONFIG = { const DOCKER_MANIFEST_HEADERS = { Accept: [ 'application/vnd.docker.distribution.manifest.v2+json', - 'application/vnd.docker.distribution.manifest.v1+json;q=0.9', - '*/*;q=0.8', + 'application/vnd.docker.distribution.manifest.list.v2+json;q=0.9', + 'application/vnd.docker.distribution.manifest.v1+json;q=0.8', + '*/*;q=0.7', ].join(', '), } as const satisfies HeadersInit; @@ -143,7 +144,30 @@ export class NexusRepositoryManagerApiClient ) ?? [new Promise