mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
fix(repodb): GQL request for ExpandedRepoInfo errors when artifacts with tags are present (#1265)
If we push an artifact and give it a tag, repodb would crash because of the null pointer dereferencing Now when iterating over the tags of a repo and stumbling upon a unsupported media type, it's being ignored Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -1091,6 +1091,8 @@ func (bdw *DBWrapper) SearchRepos(ctx context.Context, searchText string, filter
|
||||
indexDataMap[indexDigest] = indexData
|
||||
default:
|
||||
bdw.Log.Error().Msgf("Unsupported type: %s", descriptor.MediaType)
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1416,6 +1418,8 @@ func (bdw *DBWrapper) FilterTags(ctx context.Context, filter repodb.FilterFunc,
|
||||
indexDataMap[indexDigest] = indexData
|
||||
default:
|
||||
bdw.Log.Error().Msgf("Unsupported type: %s", descriptor.MediaType)
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1603,6 +1607,8 @@ func (bdw *DBWrapper) SearchTags(ctx context.Context, searchText string, filter
|
||||
indexDataMap[indexDigest] = indexData
|
||||
default:
|
||||
bdw.Log.Error().Msgf("Unsupported type: %s", descriptor.MediaType)
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -972,6 +972,8 @@ func (dwr *DBWrapper) SearchRepos(ctx context.Context, searchText string, filter
|
||||
indexDataMap[indexDigest] = indexData
|
||||
default:
|
||||
dwr.Log.Error().Msgf("Unsupported type: %s", descriptor.MediaType)
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1245,6 +1247,8 @@ func (dwr *DBWrapper) FilterTags(ctx context.Context, filter repodb.FilterFunc,
|
||||
indexDataMap[indexDigest] = indexData
|
||||
default:
|
||||
dwr.Log.Error().Msgf("Unsupported type: %s", descriptor.MediaType)
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1409,6 +1413,8 @@ func (dwr *DBWrapper) SearchTags(ctx context.Context, searchText string, filter
|
||||
indexDataMap[indexDigest] = indexData
|
||||
default:
|
||||
dwr.Log.Error().Msgf("Unsupported type: %s", descriptor.MediaType)
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user