mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
chore: fix dependabot alerts (#1501)
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
GitHub
parent
d9e5f33e7e
commit
4d6ca493f2
@@ -876,9 +876,9 @@ func TestGetReferrersGQL(t *testing.T) {
|
||||
Subject: subjectDescriptor,
|
||||
ArtifactType: artifactType,
|
||||
Config: ispec.Descriptor{
|
||||
MediaType: ispec.MediaTypeScratch,
|
||||
Digest: ispec.ScratchDescriptor.Digest,
|
||||
Data: ispec.ScratchDescriptor.Data,
|
||||
MediaType: ispec.MediaTypeEmptyJSON,
|
||||
Digest: ispec.DescriptorEmptyJSON.Digest,
|
||||
Data: ispec.DescriptorEmptyJSON.Data,
|
||||
},
|
||||
MediaType: ispec.MediaTypeImageManifest,
|
||||
Annotations: map[string]string{
|
||||
@@ -6394,7 +6394,7 @@ func TestImageSummary(t *testing.T) {
|
||||
|
||||
img1, err := GetRandomImage("art1")
|
||||
So(err, ShouldBeNil)
|
||||
img1.Manifest.Config = ispec.ScratchDescriptor
|
||||
img1.Manifest.Config = ispec.DescriptorEmptyJSON
|
||||
img1.Manifest.ArtifactType = artType1
|
||||
digest1, err := img1.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
@@ -405,7 +405,7 @@ func TestORAS(t *testing.T) {
|
||||
blobDigest := pushBlob(srcBaseURL, repoName, layer)
|
||||
|
||||
// config
|
||||
_ = pushBlob(srcBaseURL, repoName, ispec.ScratchDescriptor.Data)
|
||||
_ = pushBlob(srcBaseURL, repoName, ispec.DescriptorEmptyJSON.Data)
|
||||
|
||||
artifactManifest := ispec.Manifest{
|
||||
MediaType: artifactspec.MediaTypeArtifactManifest,
|
||||
@@ -417,7 +417,7 @@ func TestORAS(t *testing.T) {
|
||||
Size: int64(len(layer)),
|
||||
},
|
||||
},
|
||||
Config: ispec.ScratchDescriptor,
|
||||
Config: ispec.DescriptorEmptyJSON,
|
||||
Subject: &ispec.Descriptor{
|
||||
MediaType: "application/vnd.oci.image.manifest.v1+json",
|
||||
Digest: digest,
|
||||
@@ -737,7 +737,7 @@ func TestOnDemand(t *testing.T) {
|
||||
attachSBOM(rootDir, port, "remote-repo", manifestDigest)
|
||||
|
||||
// add OCI Ref
|
||||
_ = pushBlob(srcBaseURL, "remote-repo", ispec.ScratchDescriptor.Data)
|
||||
_ = pushBlob(srcBaseURL, "remote-repo", ispec.DescriptorEmptyJSON.Data)
|
||||
|
||||
OCIRefManifest := ispec.Manifest{
|
||||
Subject: &ispec.Descriptor{
|
||||
@@ -745,14 +745,14 @@ func TestOnDemand(t *testing.T) {
|
||||
Digest: manifestDigest,
|
||||
},
|
||||
Config: ispec.Descriptor{
|
||||
MediaType: ispec.MediaTypeScratch,
|
||||
Digest: ispec.ScratchDescriptor.Digest,
|
||||
MediaType: ispec.MediaTypeEmptyJSON,
|
||||
Digest: ispec.DescriptorEmptyJSON.Digest,
|
||||
Size: 2,
|
||||
},
|
||||
Layers: []ispec.Descriptor{
|
||||
{
|
||||
MediaType: ispec.MediaTypeScratch,
|
||||
Digest: ispec.ScratchDescriptor.Digest,
|
||||
MediaType: ispec.MediaTypeEmptyJSON,
|
||||
Digest: ispec.DescriptorEmptyJSON.Digest,
|
||||
Size: 2,
|
||||
},
|
||||
},
|
||||
@@ -5713,7 +5713,7 @@ func pushRepo(url, repoName string) godigest.Digest {
|
||||
}
|
||||
|
||||
loc = test.Location(url, resp)
|
||||
cblob, cdigest := ispec.ScratchDescriptor.Data, ispec.ScratchDescriptor.Digest
|
||||
cblob, cdigest := ispec.DescriptorEmptyJSON.Data, ispec.DescriptorEmptyJSON.Digest
|
||||
|
||||
resp, err = resty.R().
|
||||
SetContentLength(true).
|
||||
@@ -5824,8 +5824,8 @@ func pushRepo(url, repoName string) godigest.Digest {
|
||||
MediaType: ispec.MediaTypeImageManifest,
|
||||
ArtifactType: "application/vnd.cncf.icecream",
|
||||
Config: ispec.Descriptor{
|
||||
MediaType: ispec.MediaTypeScratch,
|
||||
Digest: ispec.ScratchDescriptor.Digest,
|
||||
MediaType: ispec.MediaTypeEmptyJSON,
|
||||
Digest: ispec.DescriptorEmptyJSON.Digest,
|
||||
Size: 2,
|
||||
},
|
||||
Layers: []ispec.Descriptor{
|
||||
|
||||
+6
-6
@@ -850,9 +850,9 @@ func UploadImage(img Image, baseURL, repo string) error {
|
||||
|
||||
cdigest := godigest.FromBytes(cblob)
|
||||
|
||||
if img.Manifest.Config.MediaType == ispec.MediaTypeScratch {
|
||||
cblob = ispec.ScratchDescriptor.Data
|
||||
cdigest = ispec.ScratchDescriptor.Digest
|
||||
if img.Manifest.Config.MediaType == ispec.MediaTypeEmptyJSON {
|
||||
cblob = ispec.DescriptorEmptyJSON.Data
|
||||
cdigest = ispec.DescriptorEmptyJSON.Digest
|
||||
}
|
||||
|
||||
resp, err := resty.R().
|
||||
@@ -1519,9 +1519,9 @@ func UploadImageWithBasicAuth(img Image, baseURL, repo, user, password string) e
|
||||
|
||||
cdigest := godigest.FromBytes(cblob)
|
||||
|
||||
if img.Manifest.Config.MediaType == ispec.MediaTypeScratch {
|
||||
cblob = ispec.ScratchDescriptor.Data
|
||||
cdigest = ispec.ScratchDescriptor.Digest
|
||||
if img.Manifest.Config.MediaType == ispec.MediaTypeEmptyJSON {
|
||||
cblob = ispec.DescriptorEmptyJSON.Data
|
||||
cdigest = ispec.DescriptorEmptyJSON.Digest
|
||||
}
|
||||
|
||||
resp, err := resty.R().
|
||||
|
||||
Reference in New Issue
Block a user