forked from Joxit/docker-registry-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: buildx multiarch image date and history not shown (Joxit#309)
Support images created with buildx and `--provenance true` fixes Joxit#309
- Loading branch information
Showing
5 changed files
with
1,305 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { supportListManifest, filterWrongManifests } from '../src/scripts/docker-image.js'; | ||
import { dockerManifestList } from './fixtures/docker-manifest-list.js'; | ||
import { ociImageIndexLayer } from './fixtures/oci-image-index-layer.js'; | ||
import { ociImageIndexManifest } from './fixtures/oci-image-index-manifest.js'; | ||
import assert from 'assert'; | ||
|
||
describe('docker-image', () => { | ||
describe('supportListManifest', () => { | ||
/** | ||
* Manifest of an image created with: | ||
* docker buildx build --platform amd64,arm -t joxit/docker-registry-ui:buildx --push --provenance false . | ||
*/ | ||
it('should support mediaType `application/vnd.docker.distribution.manifest.list.v2+json`', () => { | ||
assert.ok(supportListManifest(dockerManifestList['application/vnd.docker.distribution.manifest.list.v2+json'])); | ||
}); | ||
/** | ||
* Index of an image created with: | ||
* docker buildx build --platform amd64,arm -t joxit/docker-registry-ui:buildx --push --provenance true . | ||
*/ | ||
it('should support mediaType `application/vnd.oci.image.index.v1+json`', () => { | ||
assert.ok(supportListManifest(ociImageIndexManifest['application/vnd.oci.image.index.v1+json'])); | ||
}); | ||
/** | ||
* Index of an image created with: | ||
* buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --export-cache type=registry,ref=joxit/docker-registry-ui:buildkit | ||
*/ | ||
it('should not support mediaType `application/vnd.oci.image.index.v1+json` with layers (`application/vnd.oci.image.layer.v1.tar+gzip`)', () => { | ||
assert.ok(!supportListManifest(ociImageIndexLayer['application/vnd.oci.image.index.v1+json'])); | ||
}); | ||
}); | ||
describe('supportListManifest', () => { | ||
it('should return all manifests for `application/vnd.docker.distribution.manifest.list.v2+json`', () => { | ||
assert.equal( | ||
filterWrongManifests(dockerManifestList['application/vnd.docker.distribution.manifest.list.v2+json']).length, | ||
2 | ||
); | ||
}); | ||
it('should return all manifests for `application/vnd.oci.image.index.v1+json`', () => { | ||
assert.equal( | ||
filterWrongManifests(ociImageIndexManifest['application/vnd.oci.image.index.v1+json']).length, | ||
2 | ||
); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.