mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-29 04:06:58 +00:00
fix manifest lists?
This commit is contained in:
@@ -304,29 +304,37 @@ func (s *ManifestStore) notifyHoldAboutManifest(ctx context.Context, manifestRec
|
||||
serviceToken := s.ctx.ServiceToken
|
||||
|
||||
// Build notification request
|
||||
manifestData := map[string]any{
|
||||
"mediaType": manifestRecord.MediaType,
|
||||
}
|
||||
|
||||
// Add config if present (not present in manifest lists/indexes)
|
||||
if manifestRecord.Config != nil {
|
||||
manifestData["config"] = map[string]any{
|
||||
"digest": manifestRecord.Config.Digest,
|
||||
"size": manifestRecord.Config.Size,
|
||||
}
|
||||
}
|
||||
|
||||
// Add layers if present
|
||||
if len(manifestRecord.Layers) > 0 {
|
||||
layers := make([]map[string]any, len(manifestRecord.Layers))
|
||||
for i, layer := range manifestRecord.Layers {
|
||||
layers[i] = map[string]any{
|
||||
"digest": layer.Digest,
|
||||
"size": layer.Size,
|
||||
"mediaType": layer.MediaType,
|
||||
}
|
||||
}
|
||||
manifestData["layers"] = layers
|
||||
}
|
||||
|
||||
notifyReq := map[string]any{
|
||||
"repository": s.ctx.Repository,
|
||||
"tag": tag,
|
||||
"userDid": s.ctx.DID,
|
||||
"userHandle": s.ctx.Handle,
|
||||
"manifest": map[string]any{
|
||||
"mediaType": manifestRecord.MediaType,
|
||||
"config": map[string]any{
|
||||
"digest": manifestRecord.Config.Digest,
|
||||
"size": manifestRecord.Config.Size,
|
||||
},
|
||||
"layers": func() []map[string]any {
|
||||
layers := make([]map[string]any, len(manifestRecord.Layers))
|
||||
for i, layer := range manifestRecord.Layers {
|
||||
layers[i] = map[string]any{
|
||||
"digest": layer.Digest,
|
||||
"size": layer.Size,
|
||||
"mediaType": layer.MediaType,
|
||||
}
|
||||
}
|
||||
return layers
|
||||
}(),
|
||||
},
|
||||
"manifest": manifestData,
|
||||
}
|
||||
|
||||
// Marshal request
|
||||
|
||||
Reference in New Issue
Block a user