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:
LaurentiuNiculae
2024-02-14 19:08:08 +02:00
committed by GitHub
parent 36e04a40c2
commit de90abd5dc
14 changed files with 90 additions and 73 deletions
+10 -10
View File
@@ -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(),