diff --git a/pkg/appview/storage/manifest_store.go b/pkg/appview/storage/manifest_store.go index a452d4e..44ec3d2 100644 --- a/pkg/appview/storage/manifest_store.go +++ b/pkg/appview/storage/manifest_store.go @@ -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