Remove references to schema1 pacakge from notifications package

Schema1 package was deprecated a while ago but it's wildly referenced
thrhougout distribution codebase.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos 2023-08-13 12:44:21 +01:00
parent 69fe169013
commit 565dafa48c
No known key found for this signature in database
GPG key ID: 01300E5E6D417439
5 changed files with 123 additions and 97 deletions

View file

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/distribution/distribution/v3/manifest/schema1" //nolint:staticcheck // Ignore SA1019: "github.com/distribution/distribution/v3/manifest/schema1" is deprecated, as it's used for backward compatibility.
"github.com/distribution/distribution/v3/manifest/schema2"
)
// TestEventJSONFormat provides silly test to detect if the event format or
@ -21,7 +21,7 @@ func TestEventEnvelopeJSONFormat(t *testing.T) {
"timestamp": "2006-01-02T15:04:05Z",
"action": "push",
"target": {
"mediaType": "application/vnd.docker.distribution.manifest.v1+prettyjws",
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:0123456789abcdef0",
"size": 1,
"length": 1,
@ -116,7 +116,7 @@ func TestEventEnvelopeJSONFormat(t *testing.T) {
manifestPush := prototype
manifestPush.ID = "asdf-asdf-asdf-asdf-0"
manifestPush.Target.MediaType = schema1.MediaTypeSignedManifest //nolint:staticcheck // Ignore SA1019: "github.com/distribution/distribution/v3/manifest/schema1" is deprecated, as it's used for backward compatibility.
manifestPush.Target.MediaType = schema2.MediaTypeManifest
manifestPush.Target.Digest = "sha256:0123456789abcdef0"
manifestPush.Target.Size = 1
manifestPush.Target.Length = 1