From 28e95f73b6356767cc78046a7f439c67d6cca7c2 Mon Sep 17 00:00:00 2001 From: Bracken Dawson Date: Tue, 23 May 2023 12:38:10 +0100 Subject: [PATCH] OCI image-spec v1.1RC3 deprecated non-dist layers We need to keep supporting them, dismiss the linter. Signed-off-by: Bracken Dawson --- registry/storage/ocimanifesthandler.go | 2 +- registry/storage/ocimanifesthandler_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/storage/ocimanifesthandler.go b/registry/storage/ocimanifesthandler.go index 468e6cc50..04c59b3b4 100644 --- a/registry/storage/ocimanifesthandler.go +++ b/registry/storage/ocimanifesthandler.go @@ -98,7 +98,7 @@ func (ms *ocischemaManifestHandler) verifyManifest(ctx context.Context, mnfst oc } switch descriptor.MediaType { - case v1.MediaTypeImageLayer, v1.MediaTypeImageLayerGzip, v1.MediaTypeImageLayerNonDistributable, v1.MediaTypeImageLayerNonDistributableGzip: + case v1.MediaTypeImageLayer, v1.MediaTypeImageLayerGzip, v1.MediaTypeImageLayerNonDistributable, v1.MediaTypeImageLayerNonDistributableGzip: //nolint:staticcheck // Ignore SA1019 v1.MediaTypeImageLayerNonDistributable is deprecated, it is used for backwards compatibility allow := ms.manifestURLs.allow deny := ms.manifestURLs.deny for _, u := range descriptor.URLs { diff --git a/registry/storage/ocimanifesthandler_test.go b/registry/storage/ocimanifesthandler_test.go index 5eab9b9f6..53661f028 100644 --- a/registry/storage/ocimanifesthandler_test.go +++ b/registry/storage/ocimanifesthandler_test.go @@ -36,7 +36,7 @@ func TestVerifyOCIManifestNonDistributableLayer(t *testing.T) { nonDistributableLayer := distribution.Descriptor{ Digest: "sha256:463435349086340864309863409683460843608348608934092322395278926a", Size: 6323, - MediaType: v1.MediaTypeImageLayerNonDistributableGzip, + MediaType: v1.MediaTypeImageLayerNonDistributableGzip, //nolint:staticcheck // Ignore SA1019 v1.MediaTypeImageLayerNonDistributable is deprecated, it is used for backwards compatibility } emptyLayer := distribution.Descriptor{