mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
style(metadb): use type aliases for metadb types to be easier to read (#2043)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -208,7 +208,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
Convey("getProtoImageMeta errors", func() {
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"tag": {
|
||||
MediaType: ispec.MediaTypeImageManifest,
|
||||
Digest: imageMeta.Digest.String(),
|
||||
@@ -405,7 +405,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
Convey("getProtoImageMeta fails", func() {
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"tag": {
|
||||
MediaType: ispec.MediaTypeImageManifest,
|
||||
Digest: godigest.FromString("not-found").String(),
|
||||
@@ -424,7 +424,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
|
||||
err = dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"tag": {
|
||||
MediaType: ispec.MediaTypeImageIndex,
|
||||
Digest: multiarchImageMeta.Digest.String(),
|
||||
@@ -457,7 +457,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
badImageDigest := godigest.FromString("bad-image-manifest")
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"bad-image-manifest": {
|
||||
MediaType: ispec.MediaTypeImageManifest,
|
||||
Digest: badImageDigest.String(),
|
||||
@@ -476,7 +476,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
badIndexDigest := godigest.FromString("bad-image-manifest")
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"bad-image-index": {
|
||||
MediaType: ispec.MediaTypeImageIndex,
|
||||
Digest: badIndexDigest.String(),
|
||||
@@ -495,7 +495,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
goodIndexBadManifestDigest := godigest.FromString("good-index-bad-manifests")
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"good-index-bad-manifests": {
|
||||
MediaType: ispec.MediaTypeImageIndex,
|
||||
Digest: goodIndexBadManifestDigest.String(),
|
||||
@@ -528,7 +528,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
badImageDigest := godigest.FromString("bad-image-manifest")
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"bad-image-manifest": {
|
||||
MediaType: ispec.MediaTypeImageManifest,
|
||||
Digest: badImageDigest.String(),
|
||||
@@ -547,7 +547,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
badIndexDigest := godigest.FromString("bad-image-manifest")
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"bad-image-index": {
|
||||
MediaType: ispec.MediaTypeImageIndex,
|
||||
Digest: badIndexDigest.String(),
|
||||
@@ -566,7 +566,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
goodIndexBadManifestDigest := godigest.FromString("good-index-bad-manifests")
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"good-index-bad-manifests": {
|
||||
MediaType: ispec.MediaTypeImageIndex,
|
||||
Digest: goodIndexBadManifestDigest.String(),
|
||||
@@ -587,7 +587,7 @@ func TestWrapperErrors(t *testing.T) {
|
||||
Convey("bad media type", func() {
|
||||
err := dynamoWrapper.SetRepoMeta("repo", mTypes.RepoMeta{ //nolint: contextcheck
|
||||
Name: "repo",
|
||||
Tags: map[string]mTypes.Descriptor{
|
||||
Tags: map[mTypes.Tag]mTypes.Descriptor{
|
||||
"mad-media-type": {
|
||||
MediaType: "bad media type",
|
||||
Digest: godigest.FromString("dig").String(),
|
||||
|
||||
Reference in New Issue
Block a user