diff --git a/Makefile b/Makefile index 4d2efcd54b..77555b7600 100644 --- a/Makefile +++ b/Makefile @@ -104,41 +104,14 @@ gen-protobuf: $(PROTOC) $(PROTOC) --experimental_allow_proto3_optional \ --proto_path=$(TOP_LEVEL)/pkg/meta/proto \ --go_out=$(TOP_LEVEL)/pkg/meta/ \ - --go_opt='Mdescriptor.proto=./proto_go' \ - $(TOP_LEVEL)/pkg/meta/proto/descriptor.proto + --go_opt='Moci.proto=./proto_go' \ + --go_opt='Mmeta.proto=./proto_go' \ + $(TOP_LEVEL)/pkg/meta/proto/meta.proto $(PROTOC) --experimental_allow_proto3_optional \ --proto_path=$(TOP_LEVEL)/pkg/meta/proto \ --go_out=$(TOP_LEVEL)/pkg/meta/ \ - --go_opt='Mconfig.proto=./proto_go' \ - --go_opt='Mdescriptor.proto=./proto_go' \ - $(TOP_LEVEL)/pkg/meta/proto/config.proto - $(PROTOC) --experimental_allow_proto3_optional \ - --proto_path=$(TOP_LEVEL)/pkg/meta/proto \ - --go_out=$(TOP_LEVEL)/pkg/meta/ \ - --go_opt='Mversioned.proto=./proto_go' \ - $(TOP_LEVEL)/pkg/meta/proto/versioned.proto - $(PROTOC) --experimental_allow_proto3_optional \ - --proto_path=$(TOP_LEVEL)/pkg/meta/proto \ - --go_out=$(TOP_LEVEL)/pkg/meta/ \ - --go_opt='Mmanifest.proto=./proto_go' \ - --go_opt='Mdescriptor.proto=./proto_go' \ - --go_opt='Mversioned.proto=./proto_go' \ - $(TOP_LEVEL)/pkg/meta/proto/manifest.proto - $(PROTOC) --experimental_allow_proto3_optional \ - --proto_path=$(TOP_LEVEL)/pkg/meta/proto \ - --go_out=$(TOP_LEVEL)/pkg/meta/ \ - --go_opt='Mindex.proto=./proto_go' \ - --go_opt='Mdescriptor.proto=./proto_go' \ - --go_opt='Mversioned.proto=./proto_go' \ - $(TOP_LEVEL)/pkg/meta/proto/index.proto - $(PROTOC) --experimental_allow_proto3_optional \ - --proto_path=$(TOP_LEVEL)/pkg/meta/proto \ - --go_out=$(TOP_LEVEL)/pkg/meta/ \ - --go_opt='MimageData.proto=./proto_go' \ - --go_opt='Mdescriptor.proto=./proto_go' \ - --go_opt='Mversioned.proto=./proto_go' \ - --go_opt='Mconfig.proto=./proto_go' \ - $(TOP_LEVEL)/pkg/meta/proto/imageData.proto + --go_opt='Moci.proto=./proto_go' \ + $(TOP_LEVEL)/pkg/meta/proto/oci.proto .PHONY: binary-minimal binary-minimal: EXTENSIONS= diff --git a/errors/errors.go b/errors/errors.go index ed2dcf42cf..484c1509ea 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -108,6 +108,7 @@ var ( ErrManifestConflict = errors.New("manifest: multiple manifests found") ErrManifestMetaNotFound = errors.New("metadb: image metadata not found for given manifest reference") ErrManifestDataNotFound = errors.New("metadb: image data not found for given manifest digest") + ErrImageDataNotFound = errors.New("metadb: image data not found for") ErrIndexDataNotFount = errors.New("metadb: index data not found for given digest") ErrRepoMetaNotFound = errors.New("metadb: repo metadata not found for given repo name") ErrTagMetaNotFound = errors.New("metadb: tag metadata not found for given repo and tag names") diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 5e563c3061..9df5054784 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -277,7 +277,6 @@ func (c *Controller) InitMetaDB(reloadCtx context.Context) error { return err } - // TODO: undo, commented for testing err = meta.ParseStorage(driver, c.StoreController, c.Log) if err != nil { return err diff --git a/pkg/extensions/search/convert/metadb.go b/pkg/extensions/search/convert/metadb.go index 64b7c63135..68d11df5eb 100644 --- a/pkg/extensions/search/convert/metadb.go +++ b/pkg/extensions/search/convert/metadb.go @@ -1024,8 +1024,8 @@ func FullGetSignaturesInfo(isSigned bool, signatures mTypes.ManifestSignatures, } func PaginatedProtoRepoMeta2RepoSummaries(ctx context.Context, repoMetaList []mTypes.RepoMetadata2, - imageDataMap map[string]mTypes.ImageData2, filter mTypes.Filter, pageInput pagination.PageInput, cveInfo cveinfo.CveInfo, - skip SkipQGLField, + imageDataMap map[string]mTypes.ImageData2, filter mTypes.Filter, pageInput pagination.PageInput, + cveInfo cveinfo.CveInfo, skip SkipQGLField, ) ([]*gql_generated.RepoSummary, zcommon.PageInfo, error) { reposPageFinder, err := pagination.NewRepoSumPageFinder(pageInput.Limit, pageInput.Offset, pageInput.SortBy) if err != nil { @@ -1051,8 +1051,8 @@ func PaginatedProtoRepoMeta2RepoSummaries(ctx context.Context, repoMetaList []mT } func PaginatedFullRepoMeta2RepoSummaries(ctx context.Context, repoMetaList []mTypes.FullRepoMetadata, - imageDataMap map[string]mTypes.ImageData2, filter mTypes.Filter, pageInput pagination.PageInput, cveInfo cveinfo.CveInfo, - skip SkipQGLField, + imageDataMap map[string]mTypes.ImageData2, filter mTypes.Filter, pageInput pagination.PageInput, + cveInfo cveinfo.CveInfo, skip SkipQGLField, ) ([]*gql_generated.RepoSummary, zcommon.PageInfo, error) { reposPageFinder, err := pagination.NewRepoSumPageFinder(pageInput.Limit, pageInput.Offset, pageInput.SortBy) if err != nil { @@ -1077,7 +1077,8 @@ func PaginatedFullRepoMeta2RepoSummaries(ctx context.Context, repoMetaList []mTy return page, pageInfo, nil } -func ProtoRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.RepoMetadata2, imageDataMap map[string]mTypes.ImageData2, +func ProtoRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.RepoMetadata2, + imageDataMap map[string]mTypes.ImageData2, ) *gql_generated.RepoSummary { var ( repoName = repoMeta.Name @@ -1086,7 +1087,7 @@ func ProtoRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.RepoMetadata repoVendorsSet = map[string]bool{} lastUpdatedImageSummary *gql_generated.ImageSummary repoDownloadCount = 0 - repoStarCount = int(repoMeta.Stars) // total number of stars + repoStarCount = repoMeta.Stars // total number of stars repoIsUserStarred = repoMeta.IsStarred // value specific to the current user repoIsUserBookMarked = repoMeta.IsBookmarked // value specific to the current user @@ -1159,11 +1160,12 @@ func ProtoRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.RepoMetadata StarCount: &repoStarCount, IsBookmarked: &repoIsUserBookMarked, IsStarred: &repoIsUserStarred, - Rank: ref(int(repoMeta.Rank)), + Rank: ref(repoMeta.Rank), } } -func FullRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.FullRepoMetadata, imageDataMap map[string]mTypes.ImageData2, +func FullRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.FullRepoMetadata, + imageDataMap map[string]mTypes.ImageData2, ) *gql_generated.RepoSummary { var ( repoName = repoMeta.Name @@ -1175,9 +1177,9 @@ func FullRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.FullRepoMetad repoIsUserStarred = repoMeta.IsStarred // value specific to the current user repoIsUserBookMarked = repoMeta.IsBookmarked // value specific to the current user repoSize = repoMeta.Size + lastUpdatedImageData = imageDataMap[repoMeta.LastUpdatedImage.Digest] ) - lastUpdatedImageData := imageDataMap[repoMeta.LastUpdatedImage.Digest] if repoLastUpdatedTimestamp == nil { repoLastUpdatedTimestamp = &time.Time{} } @@ -1208,7 +1210,7 @@ func FullRepoMeta2RepoSummary(ctx context.Context, repoMeta mTypes.FullRepoMetad StarCount: &repoStarCount, IsBookmarked: &repoIsUserBookMarked, IsStarred: &repoIsUserStarred, - Rank: ref(int(repoMeta.Rank)), + Rank: ref(repoMeta.Rank), } } @@ -1264,8 +1266,7 @@ func ProtoDescriptor2ImageSummary(ctx context.Context, descriptor mTypes.Descrip case ispec.MediaTypeImageIndex: return ProtoImageIndex2ImageSummary(ctx, repo, tag, descriptor.Digest, repoMeta, imageDataMap) default: - // TODO: - return nil, nil, nil + return nil, nil, zerr.ErrMediaTypeNotSupported } } @@ -1277,8 +1278,7 @@ func FullImageData2ImageSummary(ctx context.Context, imageData mTypes.FullImageD case ispec.MediaTypeImageIndex: return FullImageIndex2ImageSummary(ctx, imageData) default: - // TODO: - return nil, nil, nil + return nil, nil, zerr.ErrMediaTypeNotSupported } } @@ -1300,12 +1300,13 @@ func ProtoImageIndex2ImageSummary(ctx context.Context, repo, tag, digest string, ) for _, imageManifest := range imageIndex.Manifests { - imageManifestSummary, manifestBlobs, err := ProtoImageManifest2ImageSummary(ctx, repo, tag, repoMeta, mTypes.ImageData2{ - MediaType: ispec.MediaTypeImageManifest, - Digest: imageManifest.Digest, - Size: imageIndex.Size, - Manifests: []mTypes.ManifestData2{imageManifest}, - }) + imageManifestSummary, manifestBlobs, err := ProtoImageManifest2ImageSummary(ctx, repo, tag, repoMeta, + mTypes.ImageData2{ + MediaType: ispec.MediaTypeImageManifest, + Digest: imageManifest.Digest, + Size: imageIndex.Size, + Manifests: []mTypes.ManifestData2{imageManifest}, + }) if err != nil { return &gql_generated.ImageSummary{}, map[string]int64{}, err } @@ -1351,7 +1352,7 @@ func ProtoImageIndex2ImageSummary(ctx context.Context, repo, tag, digest string, IsSigned: &isSigned, SignatureInfo: signaturesInfo, Size: ref(strconv.FormatInt(indexSize, 10)), - DownloadCount: ref(int(repoMeta.Statistics[indexDigestStr].DownloadCount)), + DownloadCount: ref(repoMeta.Statistics[indexDigestStr].DownloadCount), Description: &annotations.Description, Title: &annotations.Title, Documentation: &annotations.Documentation, @@ -1399,6 +1400,7 @@ func FullImageIndex2ImageSummary(ctx context.Context, imageData mTypes.FullImage } manifestSize := int64(0) + for digest, size := range manifestBlobs { indexBlobs[digest] = size manifestSize += size @@ -1418,7 +1420,7 @@ func FullImageIndex2ImageSummary(ctx context.Context, imageData mTypes.FullImage manifestSummaries = append(manifestSummaries, imageManifestSummary.Manifests[0]) } - signaturesInfo := FullGetSignaturesInfo(isSigned, imageData.Signatures, godigest.Digest(imageData.Digest)) + signaturesInfo := FullGetSignaturesInfo(isSigned, imageData.Signatures, imageData.Digest) if manifestAnnotations == nil { manifestAnnotations = &ImageAnnotations{} @@ -1436,7 +1438,7 @@ func FullImageIndex2ImageSummary(ctx context.Context, imageData mTypes.FullImage IsSigned: &isSigned, SignatureInfo: signaturesInfo, Size: ref(strconv.FormatInt(indexSize, 10)), - DownloadCount: ref(int(imageData.Statistics.DownloadCount)), + DownloadCount: ref(imageData.Statistics.DownloadCount), Description: &annotations.Description, Title: &annotations.Title, Documentation: &annotations.Documentation, @@ -1461,25 +1463,25 @@ func ProtoImageManifest2ImageSummary(ctx context.Context, repo, tag string, repo configDigest = manifest.Config.Digest.String() configSize = manifest.Config.Size manifestDigest = manifest.Digest.String() - manifestSize = int64(manifest.Size) + manifestSize = manifest.Size mediaType = manifest.MediaType artifactType = zcommon.GetManifestArtifactType(imageData.Manifests[0].Manifest) platform = getPlatform(manifest.ConfigContent.Platform) - imageLastUpdated = zcommon.GetImageLastUpdated(manifest.ConfigContent) // TODO: we can cache this - downloadCount = int(repoMeta.Statistics[manifest.Digest.String()].DownloadCount) + imageLastUpdated = zcommon.GetImageLastUpdated(manifest.ConfigContent) + downloadCount = repoMeta.Statistics[manifest.Digest.String()].DownloadCount isSigned = isImageSigned(repoMeta.Signatures[manifest.Digest.String()]) ) imageSize, imageBlobsMap := getImageBlobsInfo(manifestDigest, manifestSize, configDigest, configSize, manifest.Layers) imageSizeStr := strconv.FormatInt(imageSize, 10) - annotations := GetAnnotations(manifest.Annotations, manifest.ConfigContent.Config.Labels) // TODO: This can be cached + annotations := GetAnnotations(manifest.Annotations, manifest.ConfigContent.Config.Labels) authors := annotations.Authors if authors == "" { authors = manifest.ConfigContent.Author } - historyEntries, err := getAllHistory(manifest.Manifest, manifest.ConfigContent) // TODO: this can be cached + historyEntries, err := getAllHistory(manifest.Manifest, manifest.ConfigContent) if err != nil { graphql.AddError(ctx, gqlerror.Errorf("error generating history on tag %s in repo %s: "+ "manifest digest: %s, error: %s", tag, repo, manifest.Digest, err.Error())) @@ -1537,25 +1539,25 @@ func FullImageManifest2ImageSummary(ctx context.Context, imageData mTypes.FullIm configDigest = manifest.Config.Digest.String() configSize = manifest.Config.Size manifestDigest = manifest.Digest.String() - manifestSize = int64(manifest.Size) + manifestSize = manifest.Size mediaType = manifest.MediaType artifactType = zcommon.GetManifestArtifactType(imageData.Manifests[0].Manifest) platform = getPlatform(manifest.ConfigContent.Platform) - imageLastUpdated = zcommon.GetImageLastUpdated(manifest.ConfigContent) // TODO: we can cache this + imageLastUpdated = zcommon.GetImageLastUpdated(manifest.ConfigContent) downloadCount = imageData.Statistics.DownloadCount isSigned = isImageSigned(imageData.Signatures) ) imageSize, imageBlobsMap := getImageBlobsInfo(manifestDigest, manifestSize, configDigest, configSize, manifest.Layers) imageSizeStr := strconv.FormatInt(imageSize, 10) - annotations := GetAnnotations(manifest.Annotations, manifest.ConfigContent.Config.Labels) // TODO: This can be cached + annotations := GetAnnotations(manifest.Annotations, manifest.ConfigContent.Config.Labels) authors := annotations.Authors if authors == "" { authors = manifest.ConfigContent.Author } - historyEntries, err := getAllHistory(manifest.Manifest, manifest.ConfigContent) // TODO: this can be cached + historyEntries, err := getAllHistory(manifest.Manifest, manifest.ConfigContent) if err != nil { graphql.AddError(ctx, gqlerror.Errorf("error generating history on tag %s in repo %s: "+ "manifest digest: %s, error: %s", tag, repoName, manifest.Digest, err.Error())) @@ -1646,14 +1648,14 @@ func getAllProtoHistory(manifest *proto_go.ManifestData) ([]*gql_generated.Layer allHistory = append(allHistory, &gql_generated.LayerHistory{ HistoryDescription: &gql_generated.HistoryDescription{ Created: ref(history[i].GetCreated().AsTime()), - CreatedBy: history[i].Createdby, + CreatedBy: history[i].CreatedBy, Author: history[i].Author, Comment: history[i].Comment, - EmptyLayer: history[i].Emptylayer, + EmptyLayer: history[i].EmptyLayer, }, }) - if history[i].Emptylayer != nil && *history[i].Emptylayer { + if history[i].EmptyLayer != nil && *history[i].EmptyLayer { continue } diff --git a/pkg/extensions/search/resolver.go b/pkg/extensions/search/resolver.go index a322f7ff1c..6804902cf3 100644 --- a/pkg/extensions/search/resolver.go +++ b/pkg/extensions/search/resolver.go @@ -913,18 +913,22 @@ func globalSearch(ctx context.Context, query string, metaDB mTypes.MetaDB, filte repoMetaList, err := metaDB.ProtoSearchRepos(ctx, query) if err != nil { - return &gql_generated.PaginatedReposResult{}, []*gql_generated.ImageSummary{}, []*gql_generated.LayerSummary{}, err + return &gql_generated.PaginatedReposResult{}, []*gql_generated.ImageSummary{}, + []*gql_generated.LayerSummary{}, err } imageDataMap, err := metaDB.ProtoFilterImageData(ctx, getLatestImageDigest(repoMetaList)) if err != nil { - return &gql_generated.PaginatedReposResult{}, []*gql_generated.ImageSummary{}, []*gql_generated.LayerSummary{}, err + return &gql_generated.PaginatedReposResult{}, []*gql_generated.ImageSummary{}, + []*gql_generated.LayerSummary{}, err } - repos, pageInfo, err := convert.PaginatedFullRepoMeta2RepoSummaries(ctx, repoMetaList, imageDataMap, localFilter, pageInput, cveInfo, + repos, pageInfo, err := convert.PaginatedFullRepoMeta2RepoSummaries(ctx, repoMetaList, imageDataMap, localFilter, + pageInput, cveInfo, skip) if err != nil { - return &gql_generated.PaginatedReposResult{}, []*gql_generated.ImageSummary{}, []*gql_generated.LayerSummary{}, err + return &gql_generated.PaginatedReposResult{}, []*gql_generated.ImageSummary{}, + []*gql_generated.LayerSummary{}, err } paginatedRepos.Page = &gql_generated.PageInfo{ @@ -1412,6 +1416,7 @@ func expandedRepoInfo(ctx context.Context, repo string, metaDB mTypes.MetaDB, cv } tagsDigests := []string{} + for i := range repoMeta.Tags { if i == "" { continue diff --git a/pkg/extensions/search/resolver_test.go b/pkg/extensions/search/resolver_test.go index d5efa57509..d6384e4554 100644 --- a/pkg/extensions/search/resolver_test.go +++ b/pkg/extensions/search/resolver_test.go @@ -1385,19 +1385,6 @@ func TestGetImageSummary(t *testing.T) { }) } -func TestFilterBaseImagesFn(t *testing.T) { - Convey("FilterBaseImages", t, func() { - filterFunc := filterBaseImages(&gql_generated.ImageSummary{}) - ok := filterFunc( - mTypes.RepoMetadata{}, - mTypes.ManifestMetadata{ - ManifestBlob: []byte("bad json"), - }, - ) - So(ok, ShouldBeFalse) - }) -} - func TestImageList(t *testing.T) { Convey("getImageList", t, func() { testLogger := log.NewLogger("debug", "") diff --git a/pkg/meta/boltdb/boltdb.go b/pkg/meta/boltdb/boltdb.go index c633e05990..164fbf95b8 100644 --- a/pkg/meta/boltdb/boltdb.go +++ b/pkg/meta/boltdb/boltdb.go @@ -66,7 +66,6 @@ func New(boltDB *bbolt.DB, log log.Logger) (*BoltDB, error) { return err } - // TODO: PROTO STUFF _, err = transaction.CreateBucketIfNotExists([]byte(ProtoImageDataBuck)) if err != nil { return err @@ -918,7 +917,6 @@ func (bdw *BoltDB) UpdateSignaturesValidity(repo string, manifestDigest godigest func (bdw *BoltDB) AddManifestSignature(repo string, signedManifestDigest godigest.Digest, sygMeta mTypes.SignatureMetadata, ) error { - // TODO: add support for RepoMetaProto err := bdw.DB.Update(func(tx *bbolt.Tx) error { buck := tx.Bucket([]byte(RepoMetadataBucket)) diff --git a/pkg/meta/boltdb/proto_boltdb.go b/pkg/meta/boltdb/proto_boltdb.go index fcfc3bc7fc..376299b3dd 100644 --- a/pkg/meta/boltdb/proto_boltdb.go +++ b/pkg/meta/boltdb/proto_boltdb.go @@ -73,7 +73,10 @@ func (bdw *BoltDB) ProtoSetRepoReference(repo string, reference string, imageDat return err } - imageBuck.Put([]byte(imageData.Digest), imageDataBlob) + err = imageBuck.Put([]byte(imageData.Digest), imageDataBlob) + if err != nil { + return err + } repoMetaBlob := repoBuck.Get([]byte(repo)) @@ -95,14 +98,14 @@ func (bdw *BoltDB) ProtoSetRepoReference(repo string, reference string, imageDat // 2. Referrers if protoImageData.Subject != nil { refList := repoMeta.Referrers[protoImageData.Subject.Digest].List - newRefList := append(refList, &proto_go.ReferrerInfo{ + refList = append(refList, &proto_go.ReferrerInfo{ Digest: protoImageData.Digest, MediaType: protoImageData.MediaType, ArtifactType: protoImageData.ArtifacType, Size: protoImageData.Size, Annotations: protoImageData.Annotations, }) - repoMeta.Referrers[protoImageData.Subject.Digest].List = newRefList + repoMeta.Referrers[protoImageData.Subject.Digest].List = refList } // 3. Update tag @@ -139,11 +142,11 @@ func (bdw *BoltDB) ProtoSetRepoReference(repo string, reference string, imageDat } else { err := proto.Unmarshal(repoBlobsBytes, repoBlobs) if err != nil { - return nil + return err } } - repoMeta, repoBlobs, err = common.GetUpdatedRepoMeta(repoMeta, repoBlobs, reference, imageData) + repoMeta, repoBlobs, err = common.AddImageDataToRepoMeta(repoMeta, repoBlobs, reference, imageData) if err != nil { return err } @@ -153,7 +156,10 @@ func (bdw *BoltDB) ProtoSetRepoReference(repo string, reference string, imageDat return err } - repoBlobsBuck.Put([]byte(repoMeta.Name), repoBlobsBytes) + err = repoBlobsBuck.Put([]byte(repoMeta.Name), repoBlobsBytes) + if err != nil { + return err + } repoMetaBlob, err = proto.Marshal(repoMeta) if err != nil { @@ -201,7 +207,6 @@ func (bdw *BoltDB) ProtoFilterImageData(ctx context.Context, digests []string, return imageDataMap, err } -// TODO func (bdw *BoltDB) ProtoSearchRepos(ctx context.Context, searchText string, ) ([]mTypes.FullRepoMetadata, error) { repos := []mTypes.FullRepoMetadata{} @@ -249,7 +254,10 @@ func (bdw *BoltDB) ProtoSearchRepos(ctx context.Context, searchText string, func fetchProtoImageData(imageBuck *bbolt.Bucket, digest string) (*proto_go.ImageData, error) { imageDataBlob := imageBuck.Get([]byte(digest)) - // TODO: check empty imageDataBlob + + if len(imageDataBlob) == 0 { + return nil, zerr.ErrImageDataNotFound + } imageData := proto_go.ImageData{} @@ -306,7 +314,7 @@ func (bdw *BoltDB) ProtoSearchTags(ctx context.Context, searchText string, continue } - protoImageData := &proto_go.ImageData{} + var protoImageData *proto_go.ImageData switch descriptor.MediaType { case ispec.MediaTypeImageManifest: @@ -362,7 +370,8 @@ func (bdw *BoltDB) ProtoSearchTags(ctx context.Context, searchText string, return images, err } -func (bdw *BoltDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.FilterRepoTagFunc, filterFunc mTypes.FilterProtoFunc, +func (bdw *BoltDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.FilterRepoTagFunc, + filterFunc mTypes.FilterProtoFunc, ) ([]mTypes.FullImageData, error) { images := []mTypes.FullImageData{} @@ -460,7 +469,8 @@ func (bdw *BoltDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.Fil return images, err } -func (bdw *BoltDB) ProtoFilterRepos(ctx context.Context, rankName mTypes.FilterRepoNameFunc, filter mTypes.FilterFullRepoFunc, +func (bdw *BoltDB) ProtoFilterRepos(ctx context.Context, rankName mTypes.FilterRepoNameFunc, + filter mTypes.FilterFullRepoFunc, ) ([]mTypes.FullRepoMetadata, error) { repos := []mTypes.FullRepoMetadata{} @@ -720,7 +730,9 @@ func (bdw *BoltDB) ProtoAddManifestSignature(repo string, signedManifestDigest g return err } -func (bdw *BoltDB) ProtoDeleteSignature(repo string, signedManifestDigest godigest.Digest, sigMeta mTypes.SignatureMetadata) error { +func (bdw *BoltDB) ProtoDeleteSignature(repo string, signedManifestDigest godigest.Digest, + sigMeta mTypes.SignatureMetadata, +) error { err := bdw.DB.Update(func(tx *bbolt.Tx) error { buck := tx.Bucket([]byte(ProtoRepoMetaBuck)) @@ -934,7 +946,8 @@ func (bdw *BoltDB) ProtoSetRepoMeta(repo string, repoMeta mTypes.RepoMetadata2) return err } -func (bdw *BoltDB) ProtoGetReferrersInfo(repo string, referredDigest godigest.Digest, artifactTypes []string) ([]mTypes.ReferrerInfo, error) { +func (bdw *BoltDB) ProtoGetReferrersInfo(repo string, referredDigest godigest.Digest, artifactTypes []string, +) ([]mTypes.ReferrerInfo, error) { referrersInfoResult := []mTypes.ReferrerInfo{} err := bdw.DB.View(func(tx *bbolt.Tx) error { @@ -1102,6 +1115,88 @@ func (bdw *BoltDB) ProtoUpdateSignaturesValidity(repo string, manifestDigest god return err } +func (bdw *BoltDB) ProtoRemoveRepoReference(repo, reference string, manifestDigest godigest.Digest) error { + err := bdw.DB.Update(func(tx *bbolt.Tx) error { + buck := tx.Bucket([]byte(ProtoRepoMetaBuck)) + repoBlobsBuck := tx.Bucket([]byte(ProtoRepoBlobsBuck)) + + repoMetaBlob := buck.Get([]byte(repo)) + if repoMetaBlob == nil { + return nil + } + + repoMeta := &proto_go.ProtoRepoMeta{} + + err := proto.Unmarshal(repoMetaBlob, repoMeta) + if err != nil { + return err + } + + if !common.ReferenceIsDigest(reference) { + delete(repoMeta.Tags, reference) + } else { + // remove all tags pointing to this digest + for tag, desc := range repoMeta.Tags { + if desc.Digest == reference { + delete(repoMeta.Tags, tag) + } + } + } + + /* try to find at least one tag pointing to manifestDigest + if not found then we can also remove everything related to this digest */ + var foundTag bool + for _, desc := range repoMeta.Tags { + if desc.Digest == manifestDigest.String() { + foundTag = true + } + } + + if !foundTag { + delete(repoMeta.Statistics, manifestDigest.String()) + delete(repoMeta.Signatures, manifestDigest.String()) + delete(repoMeta.Referrers, manifestDigest.String()) + } + + repoBlobsBytes := repoBlobsBuck.Get([]byte(repoMeta.Name)) + + repoBlobs := &proto_go.RepoBlobs{} + + if repoBlobsBytes == nil { + repoBlobs.Blobs = map[string]*proto_go.BlobInfo{} + } else { + err := proto.Unmarshal(repoBlobsBytes, repoBlobs) + if err != nil { + return err + } + } + + repoMeta, repoBlobs, err = common.RemoveImageFromRepoMeta(repoMeta, repoBlobs, reference) + if err != nil { + return err + } + + repoBlobsBytes, err = proto.Marshal(repoBlobs) + if err != nil { + return err + } + + err = repoBlobsBuck.Put([]byte(repoMeta.Name), repoBlobsBytes) + if err != nil { + return err + } + + repoMetaBlob, err = proto.Marshal(repoMeta) + if err != nil { + return err + } + + return buck.Put([]byte(repo), repoMetaBlob) + }) + + return err +} + func ref[T any](input T) *T { ref := input diff --git a/pkg/meta/common/common.go b/pkg/meta/common/common.go index 2c989b7bad..3cb859d1ce 100644 --- a/pkg/meta/common/common.go +++ b/pkg/meta/common/common.go @@ -358,12 +358,17 @@ func InitializeImageConfig(blob []byte) ispec.Image { return configContent } -func GetUpdatedRepoMeta(repoMeta *proto_go.ProtoRepoMeta, repoBlobs *proto_go.RepoBlobs, ref string, +func AddImageDataToRepoMeta(repoMeta *proto_go.ProtoRepoMeta, repoBlobs *proto_go.RepoBlobs, ref string, imageData mTypes.ImageData2, ) (*proto_go.ProtoRepoMeta, *proto_go.RepoBlobs, error) { + if zcommon.IsDigest(ref) { + return repoMeta, repoBlobs, nil + } + switch imageData.MediaType { case ispec.MediaTypeImageManifest: manifestData := imageData.Manifests[0] + vendor := GetVendor(manifestData.Manifest.Annotations) if vendor == "" { vendor = GetVendor(manifestData.Manifest.Annotations) @@ -375,7 +380,7 @@ func GetUpdatedRepoMeta(repoMeta *proto_go.ProtoRepoMeta, repoBlobs *proto_go.Re } platforms := []*proto_go.Platform{getProtoPlatform(&imageData.Manifests[0].ConfigContent.Platform)} - if platforms[0].Os == "" && platforms[0].Arch == "" { + if platforms[0].OS == "" && platforms[0].Arch == "" { platforms = []*proto_go.Platform{} } @@ -427,6 +432,58 @@ func GetUpdatedRepoMeta(repoMeta *proto_go.ProtoRepoMeta, repoBlobs *proto_go.Re return repoMeta, repoBlobs, nil } +func RemoveImageFromRepoMeta(repoMeta *proto_go.ProtoRepoMeta, repoBlobs *proto_go.RepoBlobs, ref string, +) (*proto_go.ProtoRepoMeta, *proto_go.RepoBlobs, error) { + if zcommon.IsDigest(ref) { + return repoMeta, repoBlobs, nil + } + + var updatedLastImage *proto_go.RepoLastUpdatedImage + + updatedBlobs := map[string]*proto_go.BlobInfo{} + updatedSize := int64(0) + updatedVendors := []string{} + updatedPlatforms := []*proto_go.Platform{} + + for tag, descriptor := range repoMeta.Tags { + if descriptor.Digest == "" { + continue + } + + queue := []string{descriptor.Digest} + + mConvert.GetProtoEarlierUpdatedImage(updatedLastImage, &proto_go.RepoLastUpdatedImage{ + LastUpdated: repoBlobs.Blobs[descriptor.Digest].LastUpdated, + MediaType: descriptor.MediaType, + Digest: descriptor.Digest, + Tag: tag, + }) + + for len(queue) > 0 { + currentBlob := queue[0] + queue = queue[1:] + + if _, found := updatedBlobs[currentBlob]; !found { + blobInfo := repoBlobs.Blobs[currentBlob] + + updatedBlobs[currentBlob] = blobInfo + updatedSize += blobInfo.Size + updatedVendors = mConvert.AddVendors(updatedVendors, blobInfo.Vendors) + updatedPlatforms = mConvert.AddProtoPlatforms(updatedPlatforms, blobInfo.Platforms) + + queue = append(queue, blobInfo.SubBlobs...) + } + } + } + + repoMeta.Size = int32(updatedSize) + repoMeta.Vendors = updatedVendors + repoMeta.Platforms = updatedPlatforms + repoMeta.LastUpdatedImage = updatedLastImage + + return repoMeta, repoBlobs, nil +} + func getRepoSize(repoMeta *proto_go.ProtoRepoMeta, repoBlobs *proto_go.RepoBlobs) int64 { size := int64(0) blobsMap := map[string]struct{}{} @@ -462,7 +519,7 @@ func getProtoPlatform(platform *ispec.Platform) *proto_go.Platform { return &proto_go.Platform{ Arch: getArch(platform.Architecture, platform.Variant), - Os: platform.OS, + OS: platform.OS, } } diff --git a/pkg/meta/convert/convert.go b/pkg/meta/convert/convert.go index 5637657384..a248c09b60 100644 --- a/pkg/meta/convert/convert.go +++ b/pkg/meta/convert/convert.go @@ -4,15 +4,206 @@ import ( "time" godigest "github.com/opencontainers/go-digest" + "github.com/opencontainers/image-spec/specs-go" ispec "github.com/opencontainers/image-spec/specs-go/v1" "google.golang.org/protobuf/types/known/timestamppb" + "zotregistry.io/zot/pkg/common" "zotregistry.io/zot/pkg/meta/proto_go" - mTypes "zotregistry.io/zot/pkg/meta/types" ) -func GetImageManifestData(manifestContent ispec.Manifest, configContent ispec.Image, size int64, digest godigest.Digest) mTypes.ImageData2 { +func getHistory(history []*proto_go.History) []ispec.History { + results := make([]ispec.History, 0, len(history)) + + for _, his := range history { + results = append(results, ispec.History{ + Created: ref(his.Created.AsTime()), + CreatedBy: deref(his.CreatedBy, ""), + Author: deref(his.Author, ""), + Comment: deref(his.Comment, ""), + EmptyLayer: deref(his.EmptyLayer, false), + }) + } + + return results +} + +func getPlatform(platform *proto_go.Platform) ispec.Platform { + if platform == nil { + return ispec.Platform{} + } + + return ispec.Platform{ + Architecture: platform.Arch, + OS: platform.OS, + } +} + +func getLayers(descriptors []*proto_go.Descriptor) []ispec.Descriptor { + results := make([]ispec.Descriptor, 0, len(descriptors)) + + for _, desc := range descriptors { + results = append(results, ispec.Descriptor{ + MediaType: desc.MediaType, + Digest: godigest.Digest(desc.Digest), + Size: desc.Size, + }) + } + + return results +} + +func getSubject(subj *proto_go.Descriptor) *ispec.Descriptor { + if subj == nil { + return nil + } + + return &ispec.Descriptor{ + MediaType: subj.MediaType, + Digest: godigest.Digest(subj.Digest), + Size: subj.Size, + } +} + +func getTime(time *timestamppb.Timestamp) *time.Time { + if time == nil { + return nil + } + + return ref(time.AsTime()) +} + +func GetReferrers(refs map[string]*proto_go.ReferrersInfo) map[string][]mTypes.ReferrerInfo { + results := map[string][]mTypes.ReferrerInfo{} + + for digest, ref := range refs { + referrers := []mTypes.ReferrerInfo{} + + for _, dbRef := range ref.List { + referrers = append(referrers, mTypes.ReferrerInfo{ + Digest: dbRef.Digest, + MediaType: dbRef.MediaType, + ArtifactType: dbRef.ArtifactType, + Size: int(dbRef.Size), + Annotations: dbRef.Annotations, + }) + } + + results[digest] = referrers + } + + return results +} + +func GetImageReferrers(refs *proto_go.ReferrersInfo) []mTypes.ReferrerInfo { + results := []mTypes.ReferrerInfo{} + + for _, dbRef := range refs.List { + results = append(results, mTypes.ReferrerInfo{ + Digest: dbRef.Digest, + MediaType: dbRef.MediaType, + ArtifactType: dbRef.ArtifactType, + Size: int(dbRef.Size), + Annotations: dbRef.Annotations, + }) + } + + return results +} + +func GetSignatures(sigs map[string]*proto_go.ManifestSignatures) map[string]mTypes.ManifestSignatures { + results := map[string]mTypes.ManifestSignatures{} + + for digest, dbSignatures := range sigs { + imageSignatures := mTypes.ManifestSignatures{} + + for signatureName, signatureInfo := range dbSignatures.Map { + imageSignatures[signatureName] = getSignaturesInfo(signatureInfo.List) + } + + results[digest] = imageSignatures + } + + return results +} + +func GetImageSignatures(sigs *proto_go.ManifestSignatures) mTypes.ManifestSignatures { + results := mTypes.ManifestSignatures{} + + for signatureName, signatureInfo := range sigs.Map { + results[signatureName] = getSignaturesInfo(signatureInfo.List) + } + + return results +} + +func getSignaturesInfo(sigsInfo []*proto_go.SignatureInfo) []mTypes.SignatureInfo { + results := []mTypes.SignatureInfo{} + + for _, siginfo := range sigsInfo { + results = append(results, mTypes.SignatureInfo{ + SignatureManifestDigest: siginfo.SignatureManifestDigest, + LayersInfo: getLayersInfo(siginfo.LayersInfo), + }) + } + + return results +} + +func getLayersInfo(layersInfo []*proto_go.LayersInfo) []mTypes.LayerInfo { + results := []mTypes.LayerInfo{} + + for _, layerInfo := range layersInfo { + date := time.Time{} + + if layerInfo.Date != nil { + date = layerInfo.Date.AsTime() + } + + results = append(results, mTypes.LayerInfo{ + LayerDigest: layerInfo.LayerDigest, + LayerContent: layerInfo.LayerContent, + SignatureKey: layerInfo.SignatureKey, + Signer: layerInfo.Signer, + Date: date, + }) + } + + return results +} + +func GetStatisticsMap(stats map[string]*proto_go.DescriptorStatistics) map[string]mTypes.DescriptorStatistics { + results := map[string]mTypes.DescriptorStatistics{} + + for digest, stat := range stats { + results[digest] = mTypes.DescriptorStatistics{ + DownloadCount: int(stat.DownloadCount), + } + } + + return results +} + +func GetImageStatistics(stats *proto_go.DescriptorStatistics) mTypes.DescriptorStatistics { + return mTypes.DescriptorStatistics{ + DownloadCount: int(stats.DownloadCount), + } +} + +func GetRepoMeta(repo *proto_go.ProtoRepoMeta) mTypes.RepoMetadata2 { + return mTypes.RepoMetadata2{ + Name: repo.Name, + Tags: getTags(repo.Tags), + Statistics: GetStatisticsMap(repo.Statistics), + Signatures: GetSignatures(repo.Signatures), + Referrers: GetReferrers(repo.Referrers), + } +} + +func GetImageManifestData(manifestContent ispec.Manifest, configContent ispec.Image, size int64, + digest godigest.Digest, +) mTypes.ImageData2 { return mTypes.ImageData2{ MediaType: ispec.MediaTypeImageManifest, Digest: digest, @@ -38,37 +229,17 @@ func GetImageIndexData(indexContent ispec.Index, size int64, digest godigest.Dig } } -func GetProtoImageData(imageData mTypes.ImageData2) *proto_go.ImageData { - switch imageData.MediaType { - case ispec.MediaTypeImageManifest: - if len(imageData.Manifests) == 0 { - return nil - } +func getTags(tags map[string]*proto_go.TagDescriptor) map[string]mTypes.Descriptor { + resultMap := map[string]mTypes.Descriptor{} - return GetProtoImageManifestData(imageData.Manifests[0].Manifest, imageData.Manifests[0].ConfigContent, - imageData.Manifests[0].Size, imageData.Manifests[0].Digest.String()) - case ispec.MediaTypeImageIndex: - if imageData.Index == nil { - return nil + for tag, tagDescriptor := range tags { + resultMap[tag] = mTypes.Descriptor{ + Digest: tagDescriptor.Digest, + MediaType: tagDescriptor.MediaType, } - - return GetProtoImageIndexData(*imageData.Index, imageData.Size, imageData.Digest.String()) - default: - return nil } -} -func GetProtoImageIndexData(indexContent ispec.Index, size int64, digest string) *proto_go.ImageData { - return &proto_go.ImageData{ - Versioned: &proto_go.Versioned{Schemaversion: int32(indexContent.SchemaVersion)}, - MediaType: ispec.MediaTypeImageIndex, - ArtifacType: common.GetIndexArtifactType(indexContent), - Manifests: getProtoManifests(indexContent.Manifests), - Subject: getProtoDesc(indexContent.Subject), - Annotations: indexContent.Annotations, - Size: size, - Digest: digest, - } + return resultMap } func getProtoManifests(descriptors []ispec.Descriptor) []*proto_go.ManifestData { @@ -97,64 +268,6 @@ func getManifests(descriptors []ispec.Descriptor) []mTypes.ManifestData2 { return manifestList } -func GetProtoImageManifestData(manifestContent ispec.Manifest, configContent ispec.Image, size int64, digest string, -) *proto_go.ImageData { - return &proto_go.ImageData{ - Versioned: &proto_go.Versioned{Schemaversion: int32(manifestContent.SchemaVersion)}, - MediaType: ispec.MediaTypeImageManifest, - Manifests: []*proto_go.ManifestData{GetProtoManifestData(manifestContent, configContent, size, digest)}, - ArtifacType: common.GetManifestArtifactType(manifestContent), - Subject: getProtoDesc(manifestContent.Subject), - Annotations: manifestContent.Annotations, - Size: size, - Digest: digest, - } -} - -func GetProtoManifestData(manifestContent ispec.Manifest, configContent ispec.Image, size int64, digest string, -) *proto_go.ManifestData { - return &proto_go.ManifestData{ - Versioned: &proto_go.Versioned{Schemaversion: int32(manifestContent.SchemaVersion)}, - Digest: digest, - MediaType: ref(ispec.MediaTypeImageManifest), - Config: &proto_go.ConfigData{ - Digest: manifestContent.Config.Digest.String(), - Size: manifestContent.Config.Size, - Created: GetProtoTime(configContent.Created), - Author: &configContent.Author, - Platform: &proto_go.Platform{ - Arch: getArch(configContent.Architecture, configContent.Variant), - Os: configContent.OS, - // Osversion: &configContent.OSVersion, - // Osfeatures: configContent.OSFeatures, - // Variant: &configContent.Variant, - }, - Config: &proto_go.ImageConfig{ - User: configContent.Config.User, - Exposedports: getProtoExposedports(configContent.Config.ExposedPorts), - Env: configContent.Config.Env, - Entrypoint: configContent.Config.Entrypoint, - Cmd: configContent.Config.Cmd, - Volumes: getProtoConfigVolumes(configContent.Config.Volumes), - Workingdir: &configContent.Config.WorkingDir, - Labels: configContent.Config.Labels, - Stopsignal: &configContent.Config.StopSignal, - Argsescaped: configContent.Config.ArgsEscaped, - }, - Rootfs: &proto_go.RootFS{ - Type: configContent.RootFS.Type, - Diffids: getProtoDiffIDs(configContent.RootFS.DiffIDs), - }, - History: getProtoHistory(configContent.History), - }, - Size: size, - ArtifactType: ref(common.GetManifestArtifactType(manifestContent)), - Layers: getProtoManifestLayers(manifestContent.Layers), - Subject: getProtoDesc(manifestContent.Subject), - Annotations: manifestContent.Annotations, - } -} - func getArch(arch string, variant string) string { if variant != "" { arch = arch + "/" + variant @@ -163,14 +276,6 @@ func getArch(arch string, variant string) string { return arch } -func GetProtoTime(time *time.Time) *timestamppb.Timestamp { - if time == nil { - return nil - } - - return timestamppb.New(*time) -} - func GetTime(time *timestamppb.Timestamp) *time.Time { if time == nil { return nil @@ -179,139 +284,237 @@ func GetTime(time *timestamppb.Timestamp) *time.Time { return ref(time.AsTime()) } -func getProtoManifestLayers(layers []ispec.Descriptor) []*proto_go.Descriptor { - protoLayers := []*proto_go.Descriptor{} +func GetFullImageData(tag string, protoRepoMeta *proto_go.ProtoRepoMeta, protoImageData *proto_go.ImageData, +) mTypes.FullImageData { + imageData := GetImageData(protoImageData) + imageDigest := imageData.Digest.String() - for _, layer := range layers { - layer := layer + return mTypes.FullImageData{ + Repo: protoRepoMeta.Name, + Tag: tag, + MediaType: imageData.MediaType, + Digest: imageData.Digest, + Size: imageData.Size, + Index: imageData.Index, + Manifests: GetFullManifestData(protoRepoMeta, imageData.Manifests), - protoLayers = append(protoLayers, getProtoDesc(&layer)) + Referrers: GetImageReferrers(protoRepoMeta.Referrers[imageDigest]), + Statistics: GetImageStatistics(protoRepoMeta.Statistics[imageDigest]), + Signatures: GetImageSignatures(protoRepoMeta.Signatures[imageDigest]), } +} - return protoLayers +func GetFullManifestData(protoRepoMeta *proto_go.ProtoRepoMeta, manifestData []mTypes.ManifestData2, +) []mTypes.FullManifestData { + results := []mTypes.FullManifestData{} + + for i := range manifestData { + results = append(results, mTypes.FullManifestData{ + ManifestData2: manifestData[i], + Referrers: GetImageReferrers(protoRepoMeta.Referrers[manifestData[i].Digest.String()]), + Statistics: GetImageStatistics(protoRepoMeta.Statistics[manifestData[i].Digest.String()]), + Signatures: GetImageSignatures(protoRepoMeta.Signatures[manifestData[i].Digest.String()]), + }) + } + + return results } -func getProtoDesc(descriptor *ispec.Descriptor) *proto_go.Descriptor { - if descriptor == nil { - return nil +func GetFullRepoMeta(protoRepoMeta *proto_go.ProtoRepoMeta) mTypes.FullRepoMetadata { + repoDownloads := int32(0) + + for _, descriptor := range protoRepoMeta.Tags { + repoDownloads += protoRepoMeta.Statistics[descriptor.Digest].DownloadCount } - return &proto_go.Descriptor{ - MediaType: descriptor.MediaType, - Digest: descriptor.Digest.String(), - Size: descriptor.Size, - Urls: descriptor.URLs, - Annotations: descriptor.Annotations, - Data: descriptor.Data, - Platform: getProtoPlatform(descriptor.Platform), - ArtifactType: &descriptor.ArtifactType, + return mTypes.FullRepoMetadata{ + Name: protoRepoMeta.Name, + Tags: getTags(protoRepoMeta.Tags), + Rank: int(protoRepoMeta.Rank), + Size: int64(protoRepoMeta.Size), + Platforms: GetPlatforms(protoRepoMeta.Platforms), + Vendors: protoRepoMeta.Vendors, + IsStarred: protoRepoMeta.IsStarred, + IsBookmarked: protoRepoMeta.IsBookmarked, + StarCount: int(protoRepoMeta.Stars), + DownloadCount: int(repoDownloads), + LastUpdatedImage: GetLastUpdatedImage(protoRepoMeta.LastUpdatedImage), + Statistics: GetStatisticsMap(protoRepoMeta.Statistics), + Signatures: GetSignatures(protoRepoMeta.Signatures), + Referrers: GetReferrers(protoRepoMeta.Referrers), } } -func getProtoPlatform(platform *ispec.Platform) *proto_go.Platform { - if platform == nil { - return nil - } +func GetPlatforms(platforms []*proto_go.Platform) []ispec.Platform { + result := []ispec.Platform{} - return &proto_go.Platform{ - Arch: getArch(platform.Architecture, platform.Variant), - Os: platform.OS, - // Osversion: &platform.OSVersion, - // Osfeatures: platform.OSFeatures, - // Variant: &platform.Variant, + for i := range platforms { + result = append(result, ispec.Platform{ + OS: platforms[i].OS, + Architecture: platforms[i].Arch, + }) } + + return result } -func getProtoHistory(historySlice []ispec.History) []*proto_go.History { - protoHistory := []*proto_go.History{} +func GetLastUpdated(timestamp *timestamppb.Timestamp) *time.Time { + if timestamp == nil { + return nil + } - for _, history := range historySlice { - history := history + return ref(timestamp.AsTime()) +} - protoHistory = append(protoHistory, &proto_go.History{ - Created: GetProtoTime(history.Created), - Createdby: &history.CreatedBy, - Author: &history.Author, - Comment: &history.Comment, - Emptylayer: &history.EmptyLayer, - }) +func AddPlatforms(platforms []ispec.Platform, newPlatforms []ispec.Platform) []ispec.Platform { + for _, newPlatform := range newPlatforms { + if !ContainsPlatform(platforms, newPlatform) { + platforms = append(platforms, newPlatform) + } } - return protoHistory + return platforms } -func getProtoDiffIDs(digests []godigest.Digest) []string { - digestsStr := []string{} +func ContainsPlatform(platforms []ispec.Platform, platform ispec.Platform) bool { + for i := range platforms { + if platforms[i].OS == platform.OS || platforms[i].Architecture == platform.Architecture { + return true + } + } + + return false +} - for _, digest := range digests { - digestsStr = append(digestsStr, digest.String()) +func AddProtoPlatforms(platforms []*proto_go.Platform, newPlatforms []*proto_go.Platform) []*proto_go.Platform { + for _, newPlatform := range newPlatforms { + if !ContainsProtoPlatform(platforms, newPlatform) { + platforms = append(platforms, newPlatform) + } } - return digestsStr + return platforms } -func getProtoExposedports(exposedPorts map[string]struct{}) map[string]*proto_go.EmptyMessage { - protoPorts := map[string]*proto_go.EmptyMessage{} +func ContainsProtoPlatform(platforms []*proto_go.Platform, platform *proto_go.Platform) bool { + for i := range platforms { + if platforms[i].OS == platform.OS || platforms[i].Arch == platform.Arch { + return true + } + } + + return false +} - for i := range exposedPorts { - protoPorts[i] = &proto_go.EmptyMessage{} +func AddVendors(vendors []string, newVendors []string) []string { + for _, newVendor := range newVendors { + if !common.Contains(vendors, newVendor) { + vendors = append(vendors, newVendor) + } } - return protoPorts + return vendors } -func getProtoConfigVolumes(volumes map[string]struct{}) map[string]*proto_go.EmptyMessage { - protoVolumes := map[string]*proto_go.EmptyMessage{} +func GetEarlierLastUpdated(lastUpdated *time.Time, newLastUpdated *time.Time) *time.Time { + if newLastUpdated == nil { + return lastUpdated + } - for i := range volumes { - protoVolumes[i] = &proto_go.EmptyMessage{} + if lastUpdated == nil { + return newLastUpdated } - return protoVolumes + if lastUpdated.Before(*newLastUpdated) { + return newLastUpdated + } + + return lastUpdated } -func GetProtoRefferrerInfo(referrer mTypes.ReferrerInfo) *proto_go.ReferrerInfo { - return &proto_go.ReferrerInfo{ - Digest: referrer.Digest, - MediaType: referrer.MediaType, - ArtifactType: referrer.ArtifactType, - Size: int64(referrer.Size), - Annotations: referrer.Annotations, +func GetLastUpdatedImage(protoLastUpdated *proto_go.RepoLastUpdatedImage) *mTypes.LastUpdatedImage { + if protoLastUpdated == nil { + return nil + } + + return &mTypes.LastUpdatedImage{ + Descriptor: mTypes.Descriptor{ + Digest: protoLastUpdated.Digest, + MediaType: protoLastUpdated.MediaType, + }, + Tag: protoLastUpdated.Tag, + LastUpdated: getTime(protoLastUpdated.LastUpdated), } } -func GetFullImageData(tag string, protoRepoMeta *proto_go.ProtoRepoMeta, protoImageData *proto_go.ImageData, -) mTypes.FullImageData { - imageData := GetImageData(protoImageData) - imageDigest := imageData.Digest.String() +func GetImageData(dbImageData *proto_go.ImageData) mTypes.ImageData2 { + imageData := mTypes.ImageData2{ + MediaType: dbImageData.MediaType, + Size: dbImageData.Size, + Digest: godigest.Digest(dbImageData.Digest), + } - return mTypes.FullImageData{ - Repo: protoRepoMeta.Name, - Tag: tag, - MediaType: imageData.MediaType, - Digest: imageData.Digest, - Size: imageData.Size, - Index: imageData.Index, - Manifests: GetFullManifestData(protoRepoMeta, imageData.Manifests), + if dbImageData.MediaType == ispec.MediaTypeImageIndex { + manifests := make([]ispec.Descriptor, 0, len(dbImageData.Manifests)) + subject := &ispec.Descriptor{} - Referrers: GetImageReferrers(protoRepoMeta.Referrers[imageDigest]), - Statistics: GetImageStatistics(protoRepoMeta.Statistics[imageDigest]), - Signatures: GetImageSignatures(protoRepoMeta.Signatures[imageDigest]), + for _, manifest := range dbImageData.Manifests { + manifests = append(manifests, ispec.Descriptor{ + MediaType: deref(manifest.MediaType, ""), + Digest: godigest.Digest(manifest.Digest), + Size: manifest.Size, + }) + } + + if dbImageData.Subject != nil { + subject = &ispec.Descriptor{ + MediaType: dbImageData.Subject.MediaType, + Digest: godigest.Digest(dbImageData.Subject.Digest), + Size: dbImageData.Subject.Size, + } + } + + imageData.Index = &ispec.Index{ + Versioned: specs.Versioned{SchemaVersion: int(dbImageData.Versioned.GetSchemaVersion())}, + MediaType: ispec.MediaTypeImageIndex, + ArtifactType: dbImageData.ArtifacType, + Manifests: manifests, + Subject: subject, + Annotations: dbImageData.Annotations, + } } -} -func GetFullManifestData(protoRepoMeta *proto_go.ProtoRepoMeta, manifestData []mTypes.ManifestData2, -) []mTypes.FullManifestData { - results := []mTypes.FullManifestData{} + manifestDataList := make([]mTypes.ManifestData2, 0, len(dbImageData.Manifests)) - for i := range manifestData { - results = append(results, mTypes.FullManifestData{ - ManifestData2: manifestData[i], - Referrers: GetImageReferrers(protoRepoMeta.Referrers[manifestData[i].Digest.String()]), - Statistics: GetImageStatistics(protoRepoMeta.Statistics[manifestData[i].Digest.String()]), - Signatures: GetImageSignatures(protoRepoMeta.Signatures[manifestData[i].Digest.String()]), + for _, manifest := range dbImageData.Manifests { + manifestDataList = append(manifestDataList, mTypes.ManifestData2{ + Size: manifest.Size, + Digest: godigest.Digest(manifest.Digest), + Manifest: ispec.Manifest{ + Versioned: specs.Versioned{SchemaVersion: int(manifest.Versioned.GetSchemaVersion())}, + MediaType: deref(manifest.MediaType, ""), + ArtifactType: deref(manifest.ArtifactType, ""), + Config: ispec.Descriptor{ + MediaType: manifest.Config.MediaType, + Size: manifest.Config.Size, + Digest: godigest.Digest(manifest.Config.Digest), + }, + Layers: getLayers(manifest.Layers), + Subject: getSubject(manifest.Subject), + Annotations: manifest.Annotations, + }, + ConfigContent: ispec.Image{ + Created: getTime(manifest.Config.Created), + Author: deref(manifest.Config.Author, ""), + Platform: getPlatform(manifest.Config.Platform), + Config: ispec.ImageConfig{}, + RootFS: ispec.RootFS{}, + History: getHistory(manifest.Config.History), + }, }) } - return results + imageData.Manifests = manifestDataList + + return imageData } diff --git a/pkg/meta/convert/convert2.go b/pkg/meta/convert/convert2.go deleted file mode 100644 index 1f3ed27a96..0000000000 --- a/pkg/meta/convert/convert2.go +++ /dev/null @@ -1,555 +0,0 @@ -package convert - -import ( - "time" - - godigest "github.com/opencontainers/go-digest" - "github.com/opencontainers/image-spec/specs-go" - ispec "github.com/opencontainers/image-spec/specs-go/v1" - "google.golang.org/protobuf/types/known/timestamppb" - zcommon "zotregistry.io/zot/pkg/common" - "zotregistry.io/zot/pkg/meta/proto_go" - - mTypes "zotregistry.io/zot/pkg/meta/types" -) - -func GetRepoMeta(repo *proto_go.ProtoRepoMeta) mTypes.RepoMetadata2 { - return mTypes.RepoMetadata2{ - Name: repo.Name, - Tags: getTags(repo.Tags), - Statistics: GetStatisticsMap(repo.Statistics), - Signatures: GetSignatures(repo.Signatures), - Referrers: GetReferrers(repo.Referrers), - } -} - -func GetProtoRepoMeta(repo mTypes.RepoMetadata2) *proto_go.ProtoRepoMeta { - return &proto_go.ProtoRepoMeta{ - Name: repo.Name, - Tags: getProtoTags(repo.Tags), - Statistics: getProtoStatistics(repo.Statistics), - Signatures: getProtoSignatures(repo.Signatures), - Referrers: getProtoReferrers(repo.Referrers), - } -} - -func GetImageData(dbImageData *proto_go.ImageData) mTypes.ImageData2 { - imageData := mTypes.ImageData2{ - MediaType: dbImageData.MediaType, - Size: dbImageData.Size, - Digest: godigest.Digest(dbImageData.Digest), - } - - if dbImageData.MediaType == ispec.MediaTypeImageIndex { - manifests := make([]ispec.Descriptor, 0, len(dbImageData.Manifests)) - var subject *ispec.Descriptor - - for _, manifest := range dbImageData.Manifests { - manifests = append(manifests, ispec.Descriptor{ - MediaType: deref(manifest.MediaType, ""), - Digest: godigest.Digest(manifest.Digest), - Size: manifest.Size, - }) - } - - if dbImageData.Subject != nil { - subject = &ispec.Descriptor{ - MediaType: dbImageData.Subject.MediaType, - Digest: godigest.Digest(dbImageData.Subject.Digest), - Size: dbImageData.Subject.Size, - } - } - - imageData.Index = &ispec.Index{ - Versioned: specs.Versioned{SchemaVersion: int(dbImageData.Versioned.GetSchemaversion())}, - MediaType: ispec.MediaTypeImageIndex, - ArtifactType: dbImageData.ArtifacType, - Manifests: manifests, - Subject: subject, - Annotations: dbImageData.Annotations, - } - } - - manifestDataList := make([]mTypes.ManifestData2, 0, len(dbImageData.Manifests)) - - for _, manifest := range dbImageData.Manifests { - manifestDataList = append(manifestDataList, mTypes.ManifestData2{ - Size: manifest.Size, - Digest: godigest.Digest(manifest.Digest), - Manifest: ispec.Manifest{ - Versioned: specs.Versioned{SchemaVersion: int(manifest.Versioned.GetSchemaversion())}, - MediaType: deref(manifest.MediaType, ""), - ArtifactType: deref(manifest.ArtifactType, ""), - Config: ispec.Descriptor{ - MediaType: ispec.MediaTypeImageConfig, // TODO add config media type to manifest data in DB - Size: manifest.Config.Size, - Digest: godigest.Digest(manifest.Config.Digest), - }, - Layers: getLayers(manifest.Layers), - Subject: getSubject(manifest.Subject), - Annotations: manifest.Annotations, - }, - ConfigContent: ispec.Image{ - Created: getTime(manifest.Config.Created), - Author: deref(manifest.Config.Author, ""), - Platform: getPlatform(manifest.Config.Platform), - Config: ispec.ImageConfig{}, - RootFS: ispec.RootFS{}, - History: getHistory(manifest.Config.History), - }, - }) - } - - imageData.Manifests = manifestDataList - - return imageData -} - -func getTime(time *timestamppb.Timestamp) *time.Time { - if time == nil { - return nil - } - - return ref(time.AsTime()) -} - -func getHistory(history []*proto_go.History) []ispec.History { - results := make([]ispec.History, 0, len(history)) - - for _, his := range history { - results = append(results, ispec.History{ - Created: ref(his.Created.AsTime()), - CreatedBy: deref(his.Createdby, ""), - Author: deref(his.Author, ""), - Comment: deref(his.Comment, ""), - EmptyLayer: deref(his.Emptylayer, false), - }) - } - - return results -} - -func ref[T any](input T) *T { - ref := input - - return &ref -} - -func deref[T any](pointer *T, defaultVal T) T { - if pointer != nil { - return *pointer - } - - return defaultVal -} - -func getPlatform(platform *proto_go.Platform) ispec.Platform { - if platform == nil { - return ispec.Platform{} - } - - return ispec.Platform{ - Architecture: platform.Arch, - OS: platform.Os, - // OSVersion: deref(platform.Osversion, ""), - // OSFeatures: platform.Osfeatures, - // Variant: deref(platform.Variant, ""), - } -} - -func getLayers(descriptors []*proto_go.Descriptor) []ispec.Descriptor { - results := make([]ispec.Descriptor, 0, len(descriptors)) - - for _, desc := range descriptors { - results = append(results, ispec.Descriptor{ - MediaType: desc.MediaType, - Digest: godigest.Digest(desc.Digest), - Size: desc.Size, - }) - } - - return results -} - -func getSubject(subj *proto_go.Descriptor) *ispec.Descriptor { - if subj == nil { - return nil - } - - return &ispec.Descriptor{ - MediaType: subj.MediaType, - Digest: godigest.Digest(subj.Digest), - Size: subj.Size, - } -} - -func GetStatisticsMap(stats map[string]*proto_go.DescriptorStatistics) map[string]mTypes.DescriptorStatistics { - results := map[string]mTypes.DescriptorStatistics{} - - for digest, stat := range stats { - results[digest] = mTypes.DescriptorStatistics{ - DownloadCount: int(stat.DownloadCount), - } - } - - return results -} - -func GetImageStatistics(stats *proto_go.DescriptorStatistics) mTypes.DescriptorStatistics { - return mTypes.DescriptorStatistics{ - DownloadCount: int(stats.DownloadCount), - } -} - -func getProtoStatistics(stats map[string]mTypes.DescriptorStatistics) map[string]*proto_go.DescriptorStatistics { - results := map[string]*proto_go.DescriptorStatistics{} - - for digest, stat := range stats { - results[digest] = &proto_go.DescriptorStatistics{ - DownloadCount: int32(stat.DownloadCount), - } - } - - return results -} - -func GetReferrers(refs map[string]*proto_go.ReferrersInfo) map[string][]mTypes.ReferrerInfo { - results := map[string][]mTypes.ReferrerInfo{} - - for digest, ref := range refs { - referrers := []mTypes.ReferrerInfo{} - - for _, dbRef := range ref.List { - referrers = append(referrers, mTypes.ReferrerInfo{ - Digest: dbRef.Digest, - MediaType: dbRef.MediaType, - ArtifactType: dbRef.ArtifactType, - Size: int(dbRef.Size), - Annotations: dbRef.Annotations, - }) - } - - results[digest] = referrers - } - - return results -} - -func GetImageReferrers(refs *proto_go.ReferrersInfo) []mTypes.ReferrerInfo { - results := []mTypes.ReferrerInfo{} - - for _, dbRef := range refs.List { - results = append(results, mTypes.ReferrerInfo{ - Digest: dbRef.Digest, - MediaType: dbRef.MediaType, - ArtifactType: dbRef.ArtifactType, - Size: int(dbRef.Size), - Annotations: dbRef.Annotations, - }) - } - - return results -} - -func getProtoReferrers(refs map[string][]mTypes.ReferrerInfo) map[string]*proto_go.ReferrersInfo { - results := map[string]*proto_go.ReferrersInfo{} - - for digest, ref := range refs { - referrersInfoList := []*proto_go.ReferrerInfo{} - - for _, dbRef := range ref { - referrersInfoList = append(referrersInfoList, &proto_go.ReferrerInfo{ - Digest: dbRef.Digest, - MediaType: dbRef.MediaType, - ArtifactType: dbRef.ArtifactType, - Size: int64(dbRef.Size), - Annotations: dbRef.Annotations, - }) - } - - results[digest] = &proto_go.ReferrersInfo{List: referrersInfoList} - } - - return results -} - -func GetSignatures(sigs map[string]*proto_go.ManifestSignatures) map[string]mTypes.ManifestSignatures { - results := map[string]mTypes.ManifestSignatures{} - - for digest, dbSignatures := range sigs { - imageSignatures := mTypes.ManifestSignatures{} - - for signatureName, signatureInfo := range dbSignatures.Map { - imageSignatures[signatureName] = getSignaturesInfo(signatureInfo.List) - } - - results[digest] = imageSignatures - } - - return results -} - -func GetImageSignatures(sigs *proto_go.ManifestSignatures) mTypes.ManifestSignatures { - results := mTypes.ManifestSignatures{} - - for signatureName, signatureInfo := range sigs.Map { - results[signatureName] = getSignaturesInfo(signatureInfo.List) - } - - return results -} - -func getProtoSignatures(sigs map[string]mTypes.ManifestSignatures) map[string]*proto_go.ManifestSignatures { - results := map[string]*proto_go.ManifestSignatures{} - - for digest, dbSignatures := range sigs { - imageSignatures := &proto_go.ManifestSignatures{Map: map[string]*proto_go.SignaturesInfo{}} - - for signatureName, signatureInfo := range dbSignatures { - imageSignatures.Map[signatureName] = &proto_go.SignaturesInfo{List: getProtoSignaturesInfo(signatureInfo)} - } - - results[digest] = imageSignatures - } - - return results -} - -func getSignaturesInfo(sigsInfo []*proto_go.SignatureInfo) []mTypes.SignatureInfo { - results := []mTypes.SignatureInfo{} - - for _, siginfo := range sigsInfo { - results = append(results, mTypes.SignatureInfo{ - SignatureManifestDigest: siginfo.SignatureManifestDigest, - LayersInfo: getLayersInfo(siginfo.LayersInfo), - }) - } - - return results -} - -func getProtoSignaturesInfo(sigsInfo []mTypes.SignatureInfo) []*proto_go.SignatureInfo { - results := []*proto_go.SignatureInfo{} - - for _, sigInfo := range sigsInfo { - results = append(results, &proto_go.SignatureInfo{ - SignatureManifestDigest: sigInfo.SignatureManifestDigest, - LayersInfo: GetProtoLayersInfo(sigInfo.LayersInfo), - }) - } - - return results -} - -func GetProtoLayersInfo(layersInfo []mTypes.LayerInfo) []*proto_go.LayersInfo { - result := make([]*proto_go.LayersInfo, len(layersInfo)) - - for _, layerInfo := range layersInfo { - result = append(result, &proto_go.LayersInfo{ - LayerDigest: layerInfo.LayerDigest, - LayerContent: layerInfo.LayerContent, - SignatureKey: layerInfo.SignatureKey, - Signer: layerInfo.Signer, - Date: timestamppb.New(layerInfo.Date), - }) - } - - return result -} - -func getLayersInfo(layersInfo []*proto_go.LayersInfo) []mTypes.LayerInfo { - results := []mTypes.LayerInfo{} - - for _, layerInfo := range layersInfo { - date := time.Time{} - - if layerInfo.Date != nil { - date = layerInfo.Date.AsTime() - } - - results = append(results, mTypes.LayerInfo{ - LayerDigest: layerInfo.LayerDigest, - LayerContent: layerInfo.LayerContent, - SignatureKey: layerInfo.SignatureKey, - Signer: layerInfo.Signer, - Date: date, - }) - } - - return results -} - -func getTags(tags map[string]*proto_go.TagDescriptor) map[string]mTypes.Descriptor { - resultMap := map[string]mTypes.Descriptor{} - - for tag, tagDescriptor := range tags { - resultMap[tag] = mTypes.Descriptor{ - Digest: tagDescriptor.Digest, - MediaType: tagDescriptor.MediaType, - } - } - - return resultMap -} - -func getProtoTags(tags map[string]mTypes.Descriptor) map[string]*proto_go.TagDescriptor { - resultMap := map[string]*proto_go.TagDescriptor{} - - for tag, tagDescriptor := range tags { - resultMap[tag] = &proto_go.TagDescriptor{ - Digest: tagDescriptor.Digest, - MediaType: tagDescriptor.MediaType, - } - } - - return resultMap -} - -func GetFullRepoMeta(protoRepoMeta *proto_go.ProtoRepoMeta) mTypes.FullRepoMetadata { - repoDownloads := int32(0) - - for _, descriptor := range protoRepoMeta.Tags { - repoDownloads += protoRepoMeta.Statistics[descriptor.Digest].DownloadCount - } - - return mTypes.FullRepoMetadata{ - Name: protoRepoMeta.Name, - Tags: getTags(protoRepoMeta.Tags), - Rank: int(protoRepoMeta.Rank), - Size: int64(protoRepoMeta.Size), - Platforms: GetPlatforms(protoRepoMeta.Platforms), - Vendors: protoRepoMeta.Vendors, - IsStarred: protoRepoMeta.IsStarred, - IsBookmarked: protoRepoMeta.IsBookmarked, - StarCount: int(protoRepoMeta.Stars), - DownloadCount: int(repoDownloads), - LastUpdatedImage: GetLastUpdatedImage(protoRepoMeta.LastUpdatedImage), - Statistics: GetStatisticsMap(protoRepoMeta.Statistics), - Signatures: GetSignatures(protoRepoMeta.Signatures), - Referrers: GetReferrers(protoRepoMeta.Referrers), - } - -} - -func GetPlatforms(platforms []*proto_go.Platform) []ispec.Platform { - result := []ispec.Platform{} - - for i := range platforms { - result = append(result, ispec.Platform{ - OS: platforms[i].Os, - Architecture: platforms[i].Arch, - }) - } - - return result -} - -func GetLastUpdated(timestamp *timestamppb.Timestamp) *time.Time { - if timestamp == nil { - return nil - } - - return ref(timestamp.AsTime()) -} - -func AddPlatforms(platforms []ispec.Platform, newPlatforms []ispec.Platform) []ispec.Platform { - for _, newPlatform := range newPlatforms { - if !ContainsPlatform(platforms, newPlatform) { - platforms = append(platforms, newPlatform) - } - } - - return platforms -} - -func ContainsPlatform(platforms []ispec.Platform, platform ispec.Platform) bool { - for i := range platforms { - if platforms[i].OS == platform.OS || platforms[i].Architecture == platform.Architecture { - return true - } - } - - return false -} - -func AddProtoPlatforms(platforms []*proto_go.Platform, newPlatforms []*proto_go.Platform) []*proto_go.Platform { - for _, newPlatform := range newPlatforms { - if !ContainsProtoPlatform(platforms, newPlatform) { - platforms = append(platforms, newPlatform) - } - } - - return platforms -} - -func ContainsProtoPlatform(platforms []*proto_go.Platform, platform *proto_go.Platform) bool { - for i := range platforms { - if platforms[i].Os == platform.Os || platforms[i].Arch == platform.Arch { - return true - } - } - - return false -} - -func AddVendors(vendors []string, newVendors []string) []string { - for _, newVendor := range newVendors { - if !zcommon.Contains(vendors, newVendor) { - vendors = append(vendors, newVendor) - } - } - - return vendors -} - -func GetEarlierLastUpdated(lastUpdated *time.Time, newLastUpdated *time.Time) *time.Time { - if newLastUpdated == nil { - return lastUpdated - } - - if lastUpdated == nil { - return newLastUpdated - } - - if lastUpdated.Before(*newLastUpdated) { - return newLastUpdated - } - - return lastUpdated -} - -func GetLastUpdatedImage(protoLastUpdated *proto_go.RepoLastUpdatedImage) *mTypes.LastUpdatedImage { - if protoLastUpdated == nil { - return nil - } - - return &mTypes.LastUpdatedImage{ - Descriptor: mTypes.Descriptor{ - Digest: protoLastUpdated.Digest, - MediaType: protoLastUpdated.MediaType, - }, - Tag: protoLastUpdated.Tag, - LastUpdated: getTime(protoLastUpdated.LastUpdated), - } -} - -func GetProtoEarlierUpdatedImage(repoLastImage *proto_go.RepoLastUpdatedImage, newLastImage *proto_go.RepoLastUpdatedImage, -) *proto_go.RepoLastUpdatedImage { - if repoLastImage == nil { - return newLastImage - } - - if newLastImage == nil || newLastImage.LastUpdated == nil { - return repoLastImage - } - - if repoLastImage.LastUpdated == nil { - return newLastImage - } - - if repoLastImage.LastUpdated.AsTime().Before(newLastImage.LastUpdated.AsTime()) { - return newLastImage - } - - return repoLastImage -} diff --git a/pkg/meta/convert/convert_full.go b/pkg/meta/convert/convert_full.go deleted file mode 100644 index 3a85f2ff86..0000000000 --- a/pkg/meta/convert/convert_full.go +++ /dev/null @@ -1,18 +0,0 @@ -package convert - -// import ( -// "zotregistry.io/zot/pkg/meta/proto_go" - -// mTypes "zotregistry.io/zot/pkg/meta/types" -// ) - -// // func GetFullRepoMeta(repo *proto_go.ProtoRepoMeta) mTypes.FullRepoMetadata { - -// // return mTypes.FullRepoMetadata{ -// // Name: repo.Name, -// // Tags: getTags(repo.Tags), -// // Statistics: getStatistics(repo.Statistics), -// // Signatures: getSignatures(repo.Signatures), -// // Referrers: getReferrers(repo.Referrers), -// // } -// // } diff --git a/pkg/meta/convert/convert_proto.go b/pkg/meta/convert/convert_proto.go new file mode 100644 index 0000000000..e9f491b527 --- /dev/null +++ b/pkg/meta/convert/convert_proto.go @@ -0,0 +1,351 @@ +package convert + +import ( + "time" + + godigest "github.com/opencontainers/go-digest" + ispec "github.com/opencontainers/image-spec/specs-go/v1" + "google.golang.org/protobuf/types/known/timestamppb" + + "zotregistry.io/zot/pkg/common" + "zotregistry.io/zot/pkg/meta/proto_go" + mTypes "zotregistry.io/zot/pkg/meta/types" +) + +func GetProtoRepoMeta(repo mTypes.RepoMetadata2) *proto_go.ProtoRepoMeta { + return &proto_go.ProtoRepoMeta{ + Name: repo.Name, + Tags: getProtoTags(repo.Tags), + Statistics: getProtoStatistics(repo.Statistics), + Signatures: getProtoSignatures(repo.Signatures), + Referrers: getProtoReferrers(repo.Referrers), + } +} + +func GetProtoImageData(imageData mTypes.ImageData2) *proto_go.ImageData { + switch imageData.MediaType { + case ispec.MediaTypeImageManifest: + if len(imageData.Manifests) == 0 { + return nil + } + + return GetProtoImageManifestData(imageData.Manifests[0].Manifest, imageData.Manifests[0].ConfigContent, + imageData.Manifests[0].Size, imageData.Manifests[0].Digest.String()) + case ispec.MediaTypeImageIndex: + if imageData.Index == nil { + return nil + } + + return GetProtoImageIndexData(*imageData.Index, imageData.Size, imageData.Digest.String()) + default: + return nil + } +} + +func GetProtoImageManifestData(manifestContent ispec.Manifest, configContent ispec.Image, size int64, digest string, +) *proto_go.ImageData { + return &proto_go.ImageData{ + Versioned: &proto_go.Versioned{SchemaVersion: int32(manifestContent.SchemaVersion)}, + MediaType: ispec.MediaTypeImageManifest, + Manifests: []*proto_go.ManifestData{GetProtoManifestData(manifestContent, configContent, size, digest)}, + ArtifacType: common.GetManifestArtifactType(manifestContent), + Subject: getProtoDesc(manifestContent.Subject), + Annotations: manifestContent.Annotations, + Size: size, + Digest: digest, + } +} + +func GetProtoManifestData(manifestContent ispec.Manifest, configContent ispec.Image, size int64, digest string, +) *proto_go.ManifestData { + return &proto_go.ManifestData{ + Versioned: &proto_go.Versioned{SchemaVersion: int32(manifestContent.SchemaVersion)}, + Digest: digest, + MediaType: ref(ispec.MediaTypeImageManifest), + Config: &proto_go.ConfigData{ + Digest: manifestContent.Config.Digest.String(), + Size: manifestContent.Config.Size, + MediaType: manifestContent.MediaType, + Created: GetProtoTime(configContent.Created), + Author: &configContent.Author, + Platform: &proto_go.Platform{ + Arch: getArch(configContent.Architecture, configContent.Variant), + OS: configContent.OS, + // Osversion: &configContent.OSVersion, + // Osfeatures: configContent.OSFeatures, + // Variant: &configContent.Variant, + }, + Config: &proto_go.ImageConfig{ + User: configContent.Config.User, + ExposedPorts: getProtoExposedPorts(configContent.Config.ExposedPorts), + Env: configContent.Config.Env, + Entrypoint: configContent.Config.Entrypoint, + Cmd: configContent.Config.Cmd, + Volumes: getProtoConfigVolumes(configContent.Config.Volumes), + WorkingDir: &configContent.Config.WorkingDir, + Labels: configContent.Config.Labels, + StopSignal: &configContent.Config.StopSignal, + // Argsescaped: configContent.Config.ArgsEscaped, + }, + RootFS: &proto_go.RootFS{ + Type: configContent.RootFS.Type, + DiffIDs: getProtoDiffIDs(configContent.RootFS.DiffIDs), + }, + History: getProtoHistory(configContent.History), + }, + Size: size, + ArtifactType: ref(common.GetManifestArtifactType(manifestContent)), + Layers: getProtoManifestLayers(manifestContent.Layers), + Subject: getProtoDesc(manifestContent.Subject), + Annotations: manifestContent.Annotations, + } +} + +func GetProtoImageIndexData(indexContent ispec.Index, size int64, digest string) *proto_go.ImageData { + return &proto_go.ImageData{ + Versioned: &proto_go.Versioned{SchemaVersion: int32(indexContent.SchemaVersion)}, + MediaType: ispec.MediaTypeImageIndex, + ArtifacType: common.GetIndexArtifactType(indexContent), + Manifests: getProtoManifests(indexContent.Manifests), + Subject: getProtoDesc(indexContent.Subject), + Annotations: indexContent.Annotations, + Size: size, + Digest: digest, + } +} + +func getProtoStatistics(stats map[string]mTypes.DescriptorStatistics) map[string]*proto_go.DescriptorStatistics { + results := map[string]*proto_go.DescriptorStatistics{} + + for digest, stat := range stats { + results[digest] = &proto_go.DescriptorStatistics{ + DownloadCount: int32(stat.DownloadCount), + } + } + + return results +} + +func getProtoReferrers(refs map[string][]mTypes.ReferrerInfo) map[string]*proto_go.ReferrersInfo { + results := map[string]*proto_go.ReferrersInfo{} + + for digest, ref := range refs { + referrersInfoList := []*proto_go.ReferrerInfo{} + + for _, dbRef := range ref { + referrersInfoList = append(referrersInfoList, &proto_go.ReferrerInfo{ + Digest: dbRef.Digest, + MediaType: dbRef.MediaType, + ArtifactType: dbRef.ArtifactType, + Size: int64(dbRef.Size), + Annotations: dbRef.Annotations, + }) + } + + results[digest] = &proto_go.ReferrersInfo{List: referrersInfoList} + } + + return results +} + +func getProtoSignatures(sigs map[string]mTypes.ManifestSignatures) map[string]*proto_go.ManifestSignatures { + results := map[string]*proto_go.ManifestSignatures{} + + for digest, dbSignatures := range sigs { + imageSignatures := &proto_go.ManifestSignatures{Map: map[string]*proto_go.SignaturesInfo{}} + + for signatureName, signatureInfo := range dbSignatures { + imageSignatures.Map[signatureName] = &proto_go.SignaturesInfo{List: getProtoSignaturesInfo(signatureInfo)} + } + + results[digest] = imageSignatures + } + + return results +} + +func getProtoSignaturesInfo(sigsInfo []mTypes.SignatureInfo) []*proto_go.SignatureInfo { + results := []*proto_go.SignatureInfo{} + + for _, sigInfo := range sigsInfo { + results = append(results, &proto_go.SignatureInfo{ + SignatureManifestDigest: sigInfo.SignatureManifestDigest, + LayersInfo: GetProtoLayersInfo(sigInfo.LayersInfo), + }) + } + + return results +} + +func GetProtoLayersInfo(layersInfo []mTypes.LayerInfo) []*proto_go.LayersInfo { + result := make([]*proto_go.LayersInfo, 0, len(layersInfo)) + + for _, layerInfo := range layersInfo { + result = append(result, &proto_go.LayersInfo{ + LayerDigest: layerInfo.LayerDigest, + LayerContent: layerInfo.LayerContent, + SignatureKey: layerInfo.SignatureKey, + Signer: layerInfo.Signer, + Date: timestamppb.New(layerInfo.Date), + }) + } + + return result +} + +func getProtoManifestLayers(layers []ispec.Descriptor) []*proto_go.Descriptor { + protoLayers := []*proto_go.Descriptor{} + + for _, layer := range layers { + layer := layer + + protoLayers = append(protoLayers, getProtoDesc(&layer)) + } + + return protoLayers +} + +func getProtoDesc(descriptor *ispec.Descriptor) *proto_go.Descriptor { + if descriptor == nil { + return nil + } + + return &proto_go.Descriptor{ + MediaType: descriptor.MediaType, + Digest: descriptor.Digest.String(), + Size: descriptor.Size, + URLs: descriptor.URLs, + Annotations: descriptor.Annotations, + Data: descriptor.Data, + Platform: getProtoPlatform(descriptor.Platform), + ArtifactType: &descriptor.ArtifactType, + } +} + +func getProtoPlatform(platform *ispec.Platform) *proto_go.Platform { + if platform == nil { + return nil + } + + return &proto_go.Platform{ + Arch: getArch(platform.Architecture, platform.Variant), + OS: platform.OS, + // Osversion: &platform.OSVersion, + // Osfeatures: platform.OSFeatures, + // Variant: &platform.Variant, + } +} + +func getProtoHistory(historySlice []ispec.History) []*proto_go.History { + protoHistory := []*proto_go.History{} + + for _, history := range historySlice { + history := history + + protoHistory = append(protoHistory, &proto_go.History{ + Created: GetProtoTime(history.Created), + CreatedBy: &history.CreatedBy, + Author: &history.Author, + Comment: &history.Comment, + EmptyLayer: &history.EmptyLayer, + }) + } + + return protoHistory +} + +func getProtoDiffIDs(digests []godigest.Digest) []string { + digestsStr := []string{} + + for _, digest := range digests { + digestsStr = append(digestsStr, digest.String()) + } + + return digestsStr +} + +func getProtoExposedPorts(exposedPorts map[string]struct{}) map[string]*proto_go.EmptyMessage { + protoPorts := map[string]*proto_go.EmptyMessage{} + + for i := range exposedPorts { + protoPorts[i] = &proto_go.EmptyMessage{} + } + + return protoPorts +} + +func getProtoConfigVolumes(volumes map[string]struct{}) map[string]*proto_go.EmptyMessage { + protoVolumes := map[string]*proto_go.EmptyMessage{} + + for i := range volumes { + protoVolumes[i] = &proto_go.EmptyMessage{} + } + + return protoVolumes +} + +func GetProtoRefferrerInfo(referrer mTypes.ReferrerInfo) *proto_go.ReferrerInfo { + return &proto_go.ReferrerInfo{ + Digest: referrer.Digest, + MediaType: referrer.MediaType, + ArtifactType: referrer.ArtifactType, + Size: int64(referrer.Size), + Annotations: referrer.Annotations, + } +} + +func GetProtoTime(time *time.Time) *timestamppb.Timestamp { + if time == nil { + return nil + } + + return timestamppb.New(*time) +} + +func getProtoTags(tags map[string]mTypes.Descriptor) map[string]*proto_go.TagDescriptor { + resultMap := map[string]*proto_go.TagDescriptor{} + + for tag, tagDescriptor := range tags { + resultMap[tag] = &proto_go.TagDescriptor{ + Digest: tagDescriptor.Digest, + MediaType: tagDescriptor.MediaType, + } + } + + return resultMap +} + +func GetProtoEarlierUpdatedImage(repoLastImage *proto_go.RepoLastUpdatedImage, lastImage *proto_go.RepoLastUpdatedImage, +) *proto_go.RepoLastUpdatedImage { + if repoLastImage == nil { + return lastImage + } + + if lastImage == nil || lastImage.LastUpdated == nil { + return repoLastImage + } + + if repoLastImage.LastUpdated == nil { + return lastImage + } + + if repoLastImage.LastUpdated.AsTime().Before(lastImage.LastUpdated.AsTime()) { + return lastImage + } + + return repoLastImage +} + +func ref[T any](input T) *T { + ref := input + + return &ref +} + +func deref[T any](pointer *T, defaultVal T) T { + if pointer != nil { + return *pointer + } + + return defaultVal +} diff --git a/pkg/meta/dynamodb/dynamodb.go b/pkg/meta/dynamodb/dynamodb.go index b26ea00f44..2bf1a10029 100644 --- a/pkg/meta/dynamodb/dynamodb.go +++ b/pkg/meta/dynamodb/dynamodb.go @@ -58,9 +58,9 @@ func New( VersionTablename: params.VersionTablename, UserDataTablename: params.UserDataTablename, APIKeyTablename: params.APIKeyTablename, - ProtoRepoMetaTablename: "Proto" + params.RepoMetaTablename, // TODO CHANGE - ProtoImageDataTablename: "Proto" + params.ManifestDataTablename, // TODO CHANGE - ProtoRepoBlobsTablename: "ProtoBlobs" + params.RepoMetaTablename, + ProtoRepoMetaTablename: "Proto" + params.RepoMetaTablename, // TODO CHANGE + ProtoImageDataTablename: "Proto" + params.ManifestDataTablename, // TODO CHANGE + ProtoRepoBlobsTablename: "ProtoBlobs" + params.RepoMetaTablename, // TODO CHANGE Patches: version.GetDynamoDBPatches(), imgTrustStore: nil, Log: log, @@ -2339,8 +2339,8 @@ func (dwr *DynamoDB) ProtoSetImageData(digest godigest.Digest, imageData mTypes. return dwr.SetProtoImageData(imageData.Digest, mConvert.GetProtoImageData(imageData)) } -func (dwr *DynamoDB) GetProtoImageData(digest godigest.Digest) (*proto_go.ImageData, error) { - resp, err := dwr.Client.GetItem(context.TODO(), &dynamodb.GetItemInput{ +func (dwr *DynamoDB) GetProtoImageData(ctx context.Context, digest godigest.Digest) (*proto_go.ImageData, error) { + resp, err := dwr.Client.GetItem(ctx, &dynamodb.GetItemInput{ TableName: aws.String(dwr.ProtoImageDataTablename), Key: map[string]types.AttributeValue{ "Digest": &types.AttributeValueMemberS{Value: digest.String()}, @@ -2399,8 +2399,8 @@ func (dwr *DynamoDB) setProtoRepoMeta(repo string, repoMeta *proto_go.ProtoRepoM return err } -func (dwr *DynamoDB) getProtoRepoMeta(repo string) (*proto_go.ProtoRepoMeta, error) { - resp, err := dwr.Client.GetItem(context.TODO(), &dynamodb.GetItemInput{ +func (dwr *DynamoDB) getProtoRepoMeta(ctx context.Context, repo string) (*proto_go.ProtoRepoMeta, error) { + resp, err := dwr.Client.GetItem(ctx, &dynamodb.GetItemInput{ TableName: aws.String(dwr.ProtoRepoMetaTablename), Key: map[string]types.AttributeValue{ "RepoName": &types.AttributeValueMemberS{Value: repo}, @@ -2444,7 +2444,7 @@ func (dwr *DynamoDB) ProtoSetRepoReference(repo string, reference string, imageD return err } - repoMeta, err := dwr.getProtoRepoMeta(repo) + repoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { if !errors.Is(err, zerr.ErrRepoMetaNotFound) { return err @@ -2462,14 +2462,14 @@ func (dwr *DynamoDB) ProtoSetRepoReference(repo string, reference string, imageD // 2. Referrers if protoImageData.Subject != nil { refList := repoMeta.Referrers[protoImageData.Subject.Digest].List - newRefList := append(refList, &proto_go.ReferrerInfo{ + refList = append(refList, &proto_go.ReferrerInfo{ Digest: protoImageData.Digest, MediaType: protoImageData.MediaType, ArtifactType: protoImageData.ArtifacType, Size: protoImageData.Size, Annotations: protoImageData.Annotations, }) - repoMeta.Referrers[protoImageData.Subject.Digest].List = newRefList + repoMeta.Referrers[protoImageData.Subject.Digest].List = refList } // 3. Update tag @@ -2502,7 +2502,7 @@ func (dwr *DynamoDB) ProtoSetRepoReference(repo string, reference string, imageD return err } - repoMeta, repoBlobs, err = common.GetUpdatedRepoMeta(repoMeta, repoBlobs, reference, imageData) + repoMeta, repoBlobs, err = common.AddImageDataToRepoMeta(repoMeta, repoBlobs, reference, imageData) if err != nil { return err } @@ -2625,7 +2625,6 @@ func (dwr *DynamoDB) ProtoSearchRepos(ctx context.Context, searchText string) ([ protoRepoMeta.IsBookmarked = zcommon.Contains(userBookmarks, protoRepoMeta.Name) repos = append(repos, mConvert.GetFullRepoMeta(protoRepoMeta)) - } return repos, nil @@ -2646,7 +2645,7 @@ func (dwr *DynamoDB) ProtoSearchTags(ctx context.Context, searchText string) ([] return []mTypes.FullImageData{}, err } - protoRepoMeta, err := dwr.getProtoRepoMeta(searchedRepo) + protoRepoMeta, err := dwr.getProtoRepoMeta(ctx, searchedRepo) if err != nil { return nil, err } @@ -2661,13 +2660,13 @@ func (dwr *DynamoDB) ProtoSearchTags(ctx context.Context, searchText string) ([] continue } - protoImageData := &proto_go.ImageData{} + var protoImageData *proto_go.ImageData switch descriptor.MediaType { case ispec.MediaTypeImageManifest: manifestDigest := descriptor.Digest - imageManifestData, err := dwr.GetProtoImageData(godigest.Digest(manifestDigest)) + imageManifestData, err := dwr.GetProtoImageData(ctx, godigest.Digest(manifestDigest)) if err != nil { return []mTypes.FullImageData{}, fmt.Errorf("metadb: error fetching manifest meta for manifest with digest %s %w", manifestDigest, err) @@ -2680,7 +2679,7 @@ func (dwr *DynamoDB) ProtoSearchTags(ctx context.Context, searchText string) ([] case ispec.MediaTypeImageIndex: indexDigest := godigest.Digest(descriptor.Digest) - imageIndexData, err := dwr.GetProtoImageData(indexDigest) + imageIndexData, err := dwr.GetProtoImageData(ctx, indexDigest) if err != nil { return []mTypes.FullImageData{}, fmt.Errorf("metadb: error fetching manifest meta for manifest with digest %s %w", indexDigest, err) @@ -2689,7 +2688,7 @@ func (dwr *DynamoDB) ProtoSearchTags(ctx context.Context, searchText string) ([] for i, manifest := range imageIndexData.Manifests { manifestDigest := godigest.Digest(manifest.Digest) - imageManifestData, err := dwr.GetProtoImageData(manifestDigest) + imageManifestData, err := dwr.GetProtoImageData(ctx, manifestDigest) if err != nil { return []mTypes.FullImageData{}, err } @@ -2719,7 +2718,8 @@ func ref[T any](input T) *T { return &ref } -func (dwr *DynamoDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.FilterRepoTagFunc, filterFunc mTypes.FilterProtoFunc, +func (dwr *DynamoDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.FilterRepoTagFunc, + filterFunc mTypes.FilterProtoFunc, ) ([]mTypes.FullImageData, error) { images := []mTypes.FullImageData{} userBookmarks := getUserBookmarks(ctx, dwr) @@ -2759,7 +2759,7 @@ func (dwr *DynamoDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.F case ispec.MediaTypeImageManifest: manifestDigest := descriptor.Digest - imageManifestData, err := dwr.GetProtoImageData(godigest.Digest(manifestDigest)) + imageManifestData, err := dwr.GetProtoImageData(ctx, godigest.Digest(manifestDigest)) if err != nil { return []mTypes.FullImageData{}, fmt.Errorf("metadb: error fetching manifest meta for manifest with digest %s %w", manifestDigest, err) @@ -2776,7 +2776,7 @@ func (dwr *DynamoDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.F case ispec.MediaTypeImageIndex: indexDigest := descriptor.Digest - imageIndexData, err := dwr.GetProtoImageData(godigest.Digest(indexDigest)) + imageIndexData, err := dwr.GetProtoImageData(ctx, godigest.Digest(indexDigest)) if err != nil { return []mTypes.FullImageData{}, fmt.Errorf("metadb: error fetching manifest meta for manifest with digest %s %w", indexDigest, err) @@ -2787,7 +2787,7 @@ func (dwr *DynamoDB) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.F for _, manifest := range imageIndexData.Manifests { manifestDigest := manifest.Digest - imageManifestData, err := dwr.GetProtoImageData(godigest.Digest(manifestDigest)) + imageManifestData, err := dwr.GetProtoImageData(ctx, godigest.Digest(manifestDigest)) if err != nil { return []mTypes.FullImageData{}, fmt.Errorf("metadb: error while getting manifest data for digest %s %w", manifestDigest, err) @@ -2853,7 +2853,7 @@ func getProtoImageDataFromAttribute(imageDataAttribute types.AttributeValue) (*p } func (dwr *DynamoDB) ProtoGetRepoMeta(repo string) (mTypes.RepoMetadata2, error) { - protoRepoMeta, err := dwr.getProtoRepoMeta(repo) + protoRepoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { return mTypes.RepoMetadata2{}, err } @@ -2864,7 +2864,7 @@ func (dwr *DynamoDB) ProtoGetRepoMeta(repo string) (mTypes.RepoMetadata2, error) } func (dwr *DynamoDB) ProtoGetFullRepoMeta(ctx context.Context, repo string) (mTypes.FullRepoMetadata, error) { - protoRepoMeta, err := dwr.getProtoRepoMeta(repo) + protoRepoMeta, err := dwr.getProtoRepoMeta(ctx, repo) if err != nil { return mTypes.FullRepoMetadata{}, err } @@ -2875,7 +2875,7 @@ func (dwr *DynamoDB) ProtoGetFullRepoMeta(ctx context.Context, repo string) (mTy } func (dwr *DynamoDB) ProtoGetImageData(digest godigest.Digest) (mTypes.ImageData2, error) { - imageData, err := dwr.GetProtoImageData(digest) + imageData, err := dwr.GetProtoImageData(context.Background(), digest) if err != nil { return mTypes.ImageData2{}, err } @@ -2929,7 +2929,8 @@ func (dwr *DynamoDB) ProtoGetMultipleRepoMeta(ctx context.Context, filter func(r return foundRepos, err } -func (dwr *DynamoDB) ProtoFilterRepos(ctx context.Context, rankName mTypes.FilterRepoNameFunc, filterFunc mTypes.FilterFullRepoFunc, +func (dwr *DynamoDB) ProtoFilterRepos(ctx context.Context, rankName mTypes.FilterRepoNameFunc, + filterFunc mTypes.FilterFullRepoFunc, ) ([]mTypes.FullRepoMetadata, error) { repos := []mTypes.FullRepoMetadata{} userBookmarks := getUserBookmarks(ctx, dwr) @@ -2956,7 +2957,7 @@ func (dwr *DynamoDB) ProtoFilterRepos(ctx context.Context, rankName mTypes.Filte continue } - rank := rankName(string(protoRepoMeta.Name)) + rank := rankName(protoRepoMeta.Name) if rank < 0 { continue } @@ -2976,7 +2977,7 @@ func (dwr *DynamoDB) ProtoFilterRepos(ctx context.Context, rankName mTypes.Filte } func (dwr *DynamoDB) ProtoIncrementRepoStars(repo string) error { - repoMeta, err := dwr.getProtoRepoMeta(repo) + repoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { return err } @@ -2987,7 +2988,7 @@ func (dwr *DynamoDB) ProtoIncrementRepoStars(repo string) error { } func (dwr *DynamoDB) ProtoDecrementRepoStars(repo string) error { - repoMeta, err := dwr.getProtoRepoMeta(repo) + repoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { return err } @@ -2998,7 +2999,7 @@ func (dwr *DynamoDB) ProtoDecrementRepoStars(repo string) error { } func (dwr *DynamoDB) ProtoGetRepoStars(repo string) (int, error) { - repoMeta, err := dwr.getProtoRepoMeta(repo) + repoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { return 0, err } @@ -3105,7 +3106,8 @@ func (dwr *DynamoDB) ProtoSetRepoMeta(repo string, repoMeta mTypes.RepoMetadata2 return dwr.setProtoRepoMeta(repo, protoRepoMeta) } -func (dwr *DynamoDB) ProtoGetReferrersInfo(repo string, referredDigest godigest.Digest, artifactTypes []string) ([]mTypes.ReferrerInfo, error) { +func (dwr *DynamoDB) ProtoGetReferrersInfo(repo string, referredDigest godigest.Digest, artifactTypes []string, +) ([]mTypes.ReferrerInfo, error) { repoMeta, err := dwr.GetRepoMeta(repo) if err != nil { return []mTypes.ReferrerInfo{}, err @@ -3127,7 +3129,7 @@ func (dwr *DynamoDB) ProtoGetReferrersInfo(repo string, referredDigest godigest. } func (dwr *DynamoDB) ProtoIncrementImageDownloads(repo string, reference string) error { - repoMeta, err := dwr.getProtoRepoMeta(repo) + repoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { return err } @@ -3159,18 +3161,19 @@ func (dwr *DynamoDB) ProtoUpdateSignaturesValidity(repo string, manifestDigest g return nil } - protoImageData, err := dwr.GetProtoImageData(manifestDigest) + protoImageData, err := dwr.GetProtoImageData(context.Background(), manifestDigest) if err != nil { return err } // update signatures with details about validity and author - protoRepoMeta, err := dwr.getProtoRepoMeta(repo) + protoRepoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { return err } manifestSignatures := proto_go.ManifestSignatures{Map: map[string]*proto_go.SignaturesInfo{"": {}}} + for sigType, sigs := range protoRepoMeta.Signatures[manifestDigest.String()].Map { signaturesInfo := []*proto_go.SignatureInfo{} @@ -3210,7 +3213,7 @@ func (dwr *DynamoDB) ProtoUpdateSignaturesValidity(repo string, manifestDigest g func (dwr *DynamoDB) ProtoAddManifestSignature(repo string, signedManifestDigest godigest.Digest, sygMeta mTypes.SignatureMetadata, ) error { - protoRepoMeta, err := dwr.getProtoRepoMeta(repo) + protoRepoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { if errors.Is(err, zerr.ErrRepoMetaNotFound) { protoRepoMeta = &proto_go.ProtoRepoMeta{ @@ -3275,9 +3278,10 @@ func (dwr *DynamoDB) ProtoAddManifestSignature(repo string, signedManifestDigest return dwr.setProtoRepoMeta(protoRepoMeta.Name, protoRepoMeta) } -func (dwr *DynamoDB) ProtoDeleteSignature(repo string, signedManifestDigest godigest.Digest, sigMeta mTypes.SignatureMetadata, +func (dwr *DynamoDB) ProtoDeleteSignature(repo string, signedManifestDigest godigest.Digest, + sigMeta mTypes.SignatureMetadata, ) error { - protoRepoMeta, err := dwr.getProtoRepoMeta(repo) + protoRepoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) if err != nil { return err } @@ -3352,6 +3356,69 @@ func (dwr *DynamoDB) ProtoFilterImageData(ctx context.Context, digests []string, return results, nil } +func (dwr *DynamoDB) ProtoRemoveRepoReference(repo, reference string, manifestDigest godigest.Digest, +) error { + protoRepoMeta, err := dwr.getProtoRepoMeta(context.Background(), repo) + if err != nil { + if errors.Is(err, zerr.ErrRepoMetaNotFound) { + return nil + } + + return err + } + + if !common.ReferenceIsDigest(reference) { + delete(protoRepoMeta.Tags, reference) + } else { + // find all tags pointing to this digest + tags := []string{} + for tag, desc := range protoRepoMeta.Tags { + if desc.Digest == reference { + tags = append(tags, tag) + } + } + + // remove all tags + for _, tag := range tags { + delete(protoRepoMeta.Tags, tag) + } + } + + /* try to find at least one tag pointing to manifestDigest + if not found then we can also remove everything related to this digest */ + var foundTag bool + + for _, desc := range protoRepoMeta.Tags { + if desc.Digest == manifestDigest.String() { + foundTag = true + } + } + + if !foundTag { + delete(protoRepoMeta.Statistics, manifestDigest.String()) + delete(protoRepoMeta.Signatures, manifestDigest.String()) + delete(protoRepoMeta.Referrers, manifestDigest.String()) + } + + repoBlobsInfo, err := dwr.getRepoBlobsInfo(repo) + if err != nil { + return err + } + + protoRepoMeta, repoBlobsInfo, err = common.RemoveImageFromRepoMeta(protoRepoMeta, repoBlobsInfo, reference) + if err != nil { + return err + } + + err = dwr.setRepoBlobsInfo(repo, repoBlobsInfo) + if err != nil { + return err + } + err = dwr.setProtoRepoMeta(repo, protoRepoMeta) + + return err +} + func (dwr *DynamoDB) fetchImageDataAttributesByDigest(ctx context.Context, digests []string, ) ([]map[string]types.AttributeValue, error) { resp, err := dwr.Client.BatchGetItem(ctx, &dynamodb.BatchGetItemInput{ diff --git a/pkg/meta/dynamodb/dynamodb_test.go b/pkg/meta/dynamodb/dynamodb_test.go index fe0bb32430..d1dd35bb29 100644 --- a/pkg/meta/dynamodb/dynamodb_test.go +++ b/pkg/meta/dynamodb/dynamodb_test.go @@ -24,8 +24,8 @@ import ( mdynamodb "zotregistry.io/zot/pkg/meta/dynamodb" mTypes "zotregistry.io/zot/pkg/meta/types" reqCtx "zotregistry.io/zot/pkg/requestcontext" - tskip "zotregistry.io/zot/pkg/test/skip" . "zotregistry.io/zot/pkg/test/image-utils" + tskip "zotregistry.io/zot/pkg/test/skip" ) const badTablename = "bad tablename" @@ -1446,7 +1446,7 @@ func TestProto(t *testing.T) { So(metaDB, ShouldNotBeNil) So(err, ShouldBeNil) - metaDB.ProtoSetRepoMeta("repo", mTypes.RepoMetadata2{ + err = metaDB.ProtoSetRepoMeta("repo", mTypes.RepoMetadata2{ Name: "repo", Tags: map[string]mTypes.Descriptor{"tag": {Digest: "d", MediaType: "m"}}, Statistics: map[string]mTypes.DescriptorStatistics{"d": {DownloadCount: 2}}, @@ -1454,6 +1454,7 @@ func TestProto(t *testing.T) { Referrers: map[string][]mTypes.ReferrerInfo{"d": {{Digest: "d"}}}, Stars: 20, }) + So(err, ShouldBeNil) repoMeta, _ := metaDB.ProtoGetRepoMeta("repo") fmt.Println(repoMeta) diff --git a/pkg/meta/meta_test.go b/pkg/meta/meta_test.go index 7e9996df49..b21e88f186 100644 --- a/pkg/meta/meta_test.go +++ b/pkg/meta/meta_test.go @@ -453,7 +453,7 @@ func RunMetaDBTests(t *testing.T, metaDB mTypes.MetaDB, preparationFuncs ...func }) }) - Convey("Test SetManifestData and GetManifestData", func() { + Convey("Test Setting an image by tag and retriving data", func() { configBlob, manifestBlob, err := generateTestImage() So(err, ShouldBeNil) diff --git a/pkg/meta/parse.go b/pkg/meta/parse.go index ee7d9eec19..d7b3111543 100644 --- a/pkg/meta/parse.go +++ b/pkg/meta/parse.go @@ -82,7 +82,6 @@ func ParseRepo(repo string, metaDB mTypes.MetaDB, storeController storage.StoreC for _, descriptor := range indexContent.Manifests { tag := descriptor.Annotations[ispec.AnnotationRefName] - // TODO take info from RepoDB if it exists already descriptorBlob, _, _, err := imageStore.GetImageManifest(repo, descriptor.Digest.String()) if err != nil { log.Error().Err(err).Str("repository", repo).Str("digest", descriptor.Digest.String()). @@ -156,43 +155,6 @@ func getAllRepos(storeController storage.StoreController) ([]string, error) { return allRepos, nil } -func getCachedBlob(repo string, descriptor ispec.Descriptor, metaDB mTypes.MetaDB, - imageStore storageTypes.ImageStore, log log.Logger, -) ([]byte, error) { - digest := descriptor.Digest - - descriptorBlob, err := getCachedBlobFromMetaDB(descriptor, metaDB) - - if err != nil || len(descriptorBlob) == 0 { - descriptorBlob, _, _, err = imageStore.GetImageManifest(repo, digest.String()) - if err != nil { - log.Error().Err(err).Str("repository", repo).Str("digest", digest.String()). - Msg("load-repo: failed to get blob for image") - - return nil, err - } - - return descriptorBlob, nil - } - - return descriptorBlob, nil -} - -func getCachedBlobFromMetaDB(descriptor ispec.Descriptor, metaDB mTypes.MetaDB) ([]byte, error) { - switch descriptor.MediaType { - case ispec.MediaTypeImageManifest: - manifestData, err := metaDB.GetManifestData(descriptor.Digest) - - return manifestData.ManifestBlob, err - case ispec.MediaTypeImageIndex: - indexData, err := metaDB.GetIndexData(descriptor.Digest) - - return indexData.IndexBlob, err - } - - return nil, nil -} - func GetSignatureLayersInfo(repo, tag, manifestDigest, signatureType string, manifestBlob []byte, imageStore storageTypes.ImageStore, log log.Logger, ) ([]mTypes.LayerInfo, error) { @@ -440,8 +402,8 @@ func ProtoSetImageMetaFromInput(repo, reference, mediaType string, digest godige err = metaDB.ProtoUpdateSignaturesValidity(repo, signedManifestDigest) if err != nil { - log.Error().Err(err).Str("repository", repo).Str("reference", reference).Str("digest", signedManifestDigest.String()).Msg( - "load-repo: failed verify signatures validity for signed image") + log.Error().Err(err).Str("repository", repo).Str("reference", reference).Str("digest", + signedManifestDigest.String()).Msg("load-repo: failed verify signatures validity for signed image") return err } @@ -553,9 +515,3 @@ func GetReferredInfo(descriptorBlob []byte, referrerDigest, mediaType string, return referrerSubject.Digest, referrerInfo, true, nil } - -func ref[T any](input T) *T { - ref := input - - return &ref -} diff --git a/pkg/meta/proto/config.proto b/pkg/meta/proto/config.proto deleted file mode 100644 index 7d9c3f21b2..0000000000 --- a/pkg/meta/proto/config.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; -package v1; - -import "timestamp.proto"; -import "descriptor.proto"; - -// https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go - -message ImageConfig { - string user = 1; - map exposedports = 2; - repeated string env = 3; - repeated string entrypoint = 4; - repeated string cmd = 5; - map volumes = 6; - optional string workingdir = 7; - map labels = 8; - optional string stopsignal = 9; - bool argsescaped = 10; -} - -message RootFS { - string type = 1; - repeated string diffids = 2; -} - -message History { - optional google.protobuf.Timestamp created = 1; - optional string createdby = 2; - optional string author = 3; - optional string comment = 4; - optional bool emptylayer = 5; -} - -message ConfigData { - optional google.protobuf.Timestamp created = 1; - optional string author = 2; - Platform platform = 3; - optional ImageConfig config = 4; - optional RootFS rootfs = 5; - repeated History history = 6; - string Digest = 7; - int64 Size = 8; -} - -message EmptyMessage{} diff --git a/pkg/meta/proto/descriptor.proto b/pkg/meta/proto/descriptor.proto deleted file mode 100644 index 6a4b5757eb..0000000000 --- a/pkg/meta/proto/descriptor.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package v1; - -// https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/descriptor.go - -message Descriptor { - string mediaType = 1; - string digest = 2; - int64 size = 3; - repeated string urls = 4; - map annotations = 5; - bytes data = 6; - optional Platform platform = 7; - optional string artifactType = 8; -} - -message Platform { - string Os = 1; - string Arch = 2; -} diff --git a/pkg/meta/proto/index.proto b/pkg/meta/proto/index.proto deleted file mode 100644 index 281cb84a5f..0000000000 --- a/pkg/meta/proto/index.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package v1; - -import "descriptor.proto"; -import "versioned.proto"; - -// https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/index.go - -message Index { - Versioned versioned = 1; - optional string mediatype = 2; - optional string artifacttype = 3; - repeated Descriptor manifests = 4; - optional Descriptor subject = 5; - map annotations = 6; -} diff --git a/pkg/meta/proto/manifest.proto b/pkg/meta/proto/manifest.proto deleted file mode 100644 index 6d0e835c22..0000000000 --- a/pkg/meta/proto/manifest.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package v1; - -import "descriptor.proto"; -import "versioned.proto"; - -// https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/manifest.go - -message Manifest { - Versioned versioned = 1; - optional string mediatype = 2; - optional string artifacttype = 3; - Descriptor config = 4; - repeated Descriptor layers = 5; - optional Descriptor subject = 6; - map annotations = 7; -} diff --git a/pkg/meta/proto/imageData.proto b/pkg/meta/proto/meta.proto similarity index 83% rename from pkg/meta/proto/imageData.proto rename to pkg/meta/proto/meta.proto index 515194a469..1676b1b2ea 100644 --- a/pkg/meta/proto/imageData.proto +++ b/pkg/meta/proto/meta.proto @@ -1,10 +1,8 @@ syntax = "proto3"; package v1; -import "versioned.proto"; -import "config.proto"; +import "oci.proto"; import "timestamp.proto"; -import "descriptor.proto"; message TagDescriptor { string MediaType = 1; @@ -26,23 +24,24 @@ message ImageData { } message ManifestData { - Versioned versioned = 1; - string Digest = 2; - optional string MediaType = 4; - optional string ArtifactType = 5; - repeated Descriptor Layers = 6; - optional Descriptor Subject = 7; - map Annotations = 8; - - int64 Size = 9; - ConfigData Config = 10; + Versioned Versioned = 1; + string Digest = 2; + optional string MediaType = 4; + optional string ArtifactType = 5; + repeated Descriptor Layers = 6; + optional Descriptor Subject = 7; + map Annotations = 8; + string ConfigMediaType = 9; + + int64 Size = 10; + ConfigData Config = 11; } message RepoLastUpdatedImage { optional google.protobuf.Timestamp LastUpdated = 1; string MediaType = 2; - string Digest = 3; - string Tag = 4; + string Digest = 3; + string Tag = 4; } message ProtoRepoMeta { diff --git a/pkg/meta/proto/oci.proto b/pkg/meta/proto/oci.proto new file mode 100644 index 0000000000..0dd90c69ed --- /dev/null +++ b/pkg/meta/proto/oci.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; +package v1; + +import "timestamp.proto"; + +// https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go + +message ImageConfig { + map ExposedPorts = 1; + map Volumes = 2; + map Labels = 3; + string User = 4; + repeated string Env = 5; + repeated string Entrypoint = 6; + repeated string Cmd = 7; + optional string WorkingDir = 8; + optional string StopSignal = 9; + bool ArgsEscaped = 10; +} + +message RootFS { + string Type = 1; + repeated string DiffIDs = 2; +} + +message History { + optional google.protobuf.Timestamp Created = 1; + + optional string CreatedBy = 2; + optional string Author = 3; + optional string Comment = 4; + optional bool EmptyLayer = 5; +} + +message ConfigData { + optional google.protobuf.Timestamp Created = 1; + + optional string Author = 2; + Platform Platform = 3; + optional ImageConfig Config = 4; + optional RootFS RootFS = 5; + repeated History History = 6; + string Digest = 7; + string MediaType = 8; + int64 Size = 9; +} + +message EmptyMessage{} + +message Descriptor { + string MediaType = 1; + string Digest = 2; + int64 Size = 3; + repeated string URLs = 4; + bytes Data = 5; + optional Platform Platform = 6; + optional string ArtifactType = 7; + map Annotations = 8; +} + +message Platform { + string OS = 1; + string Arch = 2; +} + +// https://github.com/opencontainers/image-spec/blob/main/specs-go/versioned.go + +message Versioned { + int32 SchemaVersion = 1; +} diff --git a/pkg/meta/proto/versioned.proto b/pkg/meta/proto/versioned.proto deleted file mode 100644 index f9c82bca84..0000000000 --- a/pkg/meta/proto/versioned.proto +++ /dev/null @@ -1,8 +0,0 @@ -syntax = "proto3"; -package v1; - -// https://github.com/opencontainers/image-spec/blob/main/specs-go/versioned.go - -message Versioned { - int32 schemaversion = 1; -} diff --git a/pkg/meta/proto_go/config.pb.go b/pkg/meta/proto_go/config.pb.go deleted file mode 100644 index e95795392c..0000000000 --- a/pkg/meta/proto_go/config.pb.go +++ /dev/null @@ -1,644 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.15.8 -// source: config.proto - -package proto_go - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ImageConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - Exposedports map[string]*EmptyMessage `protobuf:"bytes,2,rep,name=exposedports,proto3" json:"exposedports,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Env []string `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` - Entrypoint []string `protobuf:"bytes,4,rep,name=entrypoint,proto3" json:"entrypoint,omitempty"` - Cmd []string `protobuf:"bytes,5,rep,name=cmd,proto3" json:"cmd,omitempty"` - Volumes map[string]*EmptyMessage `protobuf:"bytes,6,rep,name=volumes,proto3" json:"volumes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Workingdir *string `protobuf:"bytes,7,opt,name=workingdir,proto3,oneof" json:"workingdir,omitempty"` - Labels map[string]string `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Stopsignal *string `protobuf:"bytes,9,opt,name=stopsignal,proto3,oneof" json:"stopsignal,omitempty"` - Argsescaped bool `protobuf:"varint,10,opt,name=argsescaped,proto3" json:"argsescaped,omitempty"` -} - -func (x *ImageConfig) Reset() { - *x = ImageConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImageConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageConfig) ProtoMessage() {} - -func (x *ImageConfig) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ImageConfig.ProtoReflect.Descriptor instead. -func (*ImageConfig) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{0} -} - -func (x *ImageConfig) GetUser() string { - if x != nil { - return x.User - } - return "" -} - -func (x *ImageConfig) GetExposedports() map[string]*EmptyMessage { - if x != nil { - return x.Exposedports - } - return nil -} - -func (x *ImageConfig) GetEnv() []string { - if x != nil { - return x.Env - } - return nil -} - -func (x *ImageConfig) GetEntrypoint() []string { - if x != nil { - return x.Entrypoint - } - return nil -} - -func (x *ImageConfig) GetCmd() []string { - if x != nil { - return x.Cmd - } - return nil -} - -func (x *ImageConfig) GetVolumes() map[string]*EmptyMessage { - if x != nil { - return x.Volumes - } - return nil -} - -func (x *ImageConfig) GetWorkingdir() string { - if x != nil && x.Workingdir != nil { - return *x.Workingdir - } - return "" -} - -func (x *ImageConfig) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *ImageConfig) GetStopsignal() string { - if x != nil && x.Stopsignal != nil { - return *x.Stopsignal - } - return "" -} - -func (x *ImageConfig) GetArgsescaped() bool { - if x != nil { - return x.Argsescaped - } - return false -} - -type RootFS struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Diffids []string `protobuf:"bytes,2,rep,name=diffids,proto3" json:"diffids,omitempty"` -} - -func (x *RootFS) Reset() { - *x = RootFS{} - if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RootFS) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RootFS) ProtoMessage() {} - -func (x *RootFS) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RootFS.ProtoReflect.Descriptor instead. -func (*RootFS) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{1} -} - -func (x *RootFS) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *RootFS) GetDiffids() []string { - if x != nil { - return x.Diffids - } - return nil -} - -type History struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Created *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created,proto3,oneof" json:"created,omitempty"` - Createdby *string `protobuf:"bytes,2,opt,name=createdby,proto3,oneof" json:"createdby,omitempty"` - Author *string `protobuf:"bytes,3,opt,name=author,proto3,oneof" json:"author,omitempty"` - Comment *string `protobuf:"bytes,4,opt,name=comment,proto3,oneof" json:"comment,omitempty"` - Emptylayer *bool `protobuf:"varint,5,opt,name=emptylayer,proto3,oneof" json:"emptylayer,omitempty"` -} - -func (x *History) Reset() { - *x = History{} - if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *History) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*History) ProtoMessage() {} - -func (x *History) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use History.ProtoReflect.Descriptor instead. -func (*History) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{2} -} - -func (x *History) GetCreated() *timestamppb.Timestamp { - if x != nil { - return x.Created - } - return nil -} - -func (x *History) GetCreatedby() string { - if x != nil && x.Createdby != nil { - return *x.Createdby - } - return "" -} - -func (x *History) GetAuthor() string { - if x != nil && x.Author != nil { - return *x.Author - } - return "" -} - -func (x *History) GetComment() string { - if x != nil && x.Comment != nil { - return *x.Comment - } - return "" -} - -func (x *History) GetEmptylayer() bool { - if x != nil && x.Emptylayer != nil { - return *x.Emptylayer - } - return false -} - -type ConfigData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Created *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created,proto3,oneof" json:"created,omitempty"` - Author *string `protobuf:"bytes,2,opt,name=author,proto3,oneof" json:"author,omitempty"` - Platform *Platform `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` - Config *ImageConfig `protobuf:"bytes,4,opt,name=config,proto3,oneof" json:"config,omitempty"` - Rootfs *RootFS `protobuf:"bytes,5,opt,name=rootfs,proto3,oneof" json:"rootfs,omitempty"` - History []*History `protobuf:"bytes,6,rep,name=history,proto3" json:"history,omitempty"` - Digest string `protobuf:"bytes,7,opt,name=Digest,proto3" json:"Digest,omitempty"` - Size int64 `protobuf:"varint,8,opt,name=Size,proto3" json:"Size,omitempty"` -} - -func (x *ConfigData) Reset() { - *x = ConfigData{} - if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConfigData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfigData) ProtoMessage() {} - -func (x *ConfigData) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfigData.ProtoReflect.Descriptor instead. -func (*ConfigData) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{3} -} - -func (x *ConfigData) GetCreated() *timestamppb.Timestamp { - if x != nil { - return x.Created - } - return nil -} - -func (x *ConfigData) GetAuthor() string { - if x != nil && x.Author != nil { - return *x.Author - } - return "" -} - -func (x *ConfigData) GetPlatform() *Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *ConfigData) GetConfig() *ImageConfig { - if x != nil { - return x.Config - } - return nil -} - -func (x *ConfigData) GetRootfs() *RootFS { - if x != nil { - return x.Rootfs - } - return nil -} - -func (x *ConfigData) GetHistory() []*History { - if x != nil { - return x.History - } - return nil -} - -func (x *ConfigData) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -func (x *ConfigData) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -type EmptyMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *EmptyMessage) Reset() { - *x = EmptyMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EmptyMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EmptyMessage) ProtoMessage() {} - -func (x *EmptyMessage) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead. -func (*EmptyMessage) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{4} -} - -var File_config_proto protoreflect.FileDescriptor - -var file_config_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, - 0x76, 0x31, 0x1a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xff, 0x04, 0x0a, 0x0b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0c, 0x65, 0x78, 0x70, - 0x6f, 0x73, 0x65, 0x64, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x70, 0x6f, 0x72, 0x74, 0x73, - 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, - 0x6e, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x03, 0x63, 0x6d, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x07, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0a, - 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x64, 0x69, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x64, 0x69, 0x72, 0x88, 0x01, - 0x01, 0x12, 0x33, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x23, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x73, 0x74, - 0x6f, 0x70, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x0b, 0x61, - 0x72, 0x67, 0x73, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x61, 0x72, 0x67, 0x73, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x1a, 0x51, 0x0a, - 0x11, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x4c, 0x0a, 0x0c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, - 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x77, 0x6f, - 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x64, 0x69, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, 0x6f, - 0x70, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x22, 0x36, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x74, 0x46, - 0x53, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x66, 0x66, 0x69, 0x64, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x64, 0x69, 0x66, 0x66, 0x69, 0x64, 0x73, 0x22, - 0x88, 0x02, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x39, 0x0a, 0x07, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x62, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x62, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x06, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, 0x52, 0x0a, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x62, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x42, - 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x22, 0xe5, 0x02, 0x0a, 0x0a, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x88, 0x01, - 0x01, 0x12, 0x28, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x02, 0x52, 0x06, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x06, 0x72, 0x6f, 0x6f, - 0x74, 0x66, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x6f, 0x6f, 0x74, 0x46, 0x53, 0x48, 0x03, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x66, 0x73, 0x88, - 0x01, 0x01, 0x12, 0x25, 0x0a, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, - 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x04, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x42, 0x09, 0x0a, 0x07, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x66, 0x73, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_config_proto_rawDescOnce sync.Once - file_config_proto_rawDescData = file_config_proto_rawDesc -) - -func file_config_proto_rawDescGZIP() []byte { - file_config_proto_rawDescOnce.Do(func() { - file_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_proto_rawDescData) - }) - return file_config_proto_rawDescData -} - -var file_config_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_config_proto_goTypes = []interface{}{ - (*ImageConfig)(nil), // 0: v1.ImageConfig - (*RootFS)(nil), // 1: v1.RootFS - (*History)(nil), // 2: v1.History - (*ConfigData)(nil), // 3: v1.ConfigData - (*EmptyMessage)(nil), // 4: v1.EmptyMessage - nil, // 5: v1.ImageConfig.ExposedportsEntry - nil, // 6: v1.ImageConfig.VolumesEntry - nil, // 7: v1.ImageConfig.LabelsEntry - (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp - (*Platform)(nil), // 9: v1.Platform -} -var file_config_proto_depIdxs = []int32{ - 5, // 0: v1.ImageConfig.exposedports:type_name -> v1.ImageConfig.ExposedportsEntry - 6, // 1: v1.ImageConfig.volumes:type_name -> v1.ImageConfig.VolumesEntry - 7, // 2: v1.ImageConfig.labels:type_name -> v1.ImageConfig.LabelsEntry - 8, // 3: v1.History.created:type_name -> google.protobuf.Timestamp - 8, // 4: v1.ConfigData.created:type_name -> google.protobuf.Timestamp - 9, // 5: v1.ConfigData.platform:type_name -> v1.Platform - 0, // 6: v1.ConfigData.config:type_name -> v1.ImageConfig - 1, // 7: v1.ConfigData.rootfs:type_name -> v1.RootFS - 2, // 8: v1.ConfigData.history:type_name -> v1.History - 4, // 9: v1.ImageConfig.ExposedportsEntry.value:type_name -> v1.EmptyMessage - 4, // 10: v1.ImageConfig.VolumesEntry.value:type_name -> v1.EmptyMessage - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_config_proto_init() } -func file_config_proto_init() { - if File_config_proto != nil { - return - } - file_descriptor_proto_init() - if !protoimpl.UnsafeEnabled { - file_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RootFS); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*History); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_config_proto_msgTypes[0].OneofWrappers = []interface{}{} - file_config_proto_msgTypes[2].OneofWrappers = []interface{}{} - file_config_proto_msgTypes[3].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_config_proto_goTypes, - DependencyIndexes: file_config_proto_depIdxs, - MessageInfos: file_config_proto_msgTypes, - }.Build() - File_config_proto = out.File - file_config_proto_rawDesc = nil - file_config_proto_goTypes = nil - file_config_proto_depIdxs = nil -} diff --git a/pkg/meta/proto_go/descriptor.pb.go b/pkg/meta/proto_go/descriptor.pb.go deleted file mode 100644 index a7c056b8b9..0000000000 --- a/pkg/meta/proto_go/descriptor.pb.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.15.8 -// source: descriptor.proto - -package proto_go - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Descriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MediaType string `protobuf:"bytes,1,opt,name=mediaType,proto3" json:"mediaType,omitempty"` - Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` - Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - Urls []string `protobuf:"bytes,4,rep,name=urls,proto3" json:"urls,omitempty"` - Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` - Platform *Platform `protobuf:"bytes,7,opt,name=platform,proto3,oneof" json:"platform,omitempty"` - ArtifactType *string `protobuf:"bytes,8,opt,name=artifactType,proto3,oneof" json:"artifactType,omitempty"` -} - -func (x *Descriptor) Reset() { - *x = Descriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_descriptor_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Descriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Descriptor) ProtoMessage() {} - -func (x *Descriptor) ProtoReflect() protoreflect.Message { - mi := &file_descriptor_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Descriptor.ProtoReflect.Descriptor instead. -func (*Descriptor) Descriptor() ([]byte, []int) { - return file_descriptor_proto_rawDescGZIP(), []int{0} -} - -func (x *Descriptor) GetMediaType() string { - if x != nil { - return x.MediaType - } - return "" -} - -func (x *Descriptor) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -func (x *Descriptor) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *Descriptor) GetUrls() []string { - if x != nil { - return x.Urls - } - return nil -} - -func (x *Descriptor) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -func (x *Descriptor) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *Descriptor) GetPlatform() *Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *Descriptor) GetArtifactType() string { - if x != nil && x.ArtifactType != nil { - return *x.ArtifactType - } - return "" -} - -type Platform struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Os string `protobuf:"bytes,1,opt,name=Os,proto3" json:"Os,omitempty"` - Arch string `protobuf:"bytes,2,opt,name=Arch,proto3" json:"Arch,omitempty"` -} - -func (x *Platform) Reset() { - *x = Platform{} - if protoimpl.UnsafeEnabled { - mi := &file_descriptor_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Platform) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Platform) ProtoMessage() {} - -func (x *Platform) ProtoReflect() protoreflect.Message { - mi := &file_descriptor_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Platform.ProtoReflect.Descriptor instead. -func (*Platform) Descriptor() ([]byte, []int) { - return file_descriptor_proto_rawDescGZIP(), []int{1} -} - -func (x *Platform) GetOs() string { - if x != nil { - return x.Os - } - return "" -} - -func (x *Platform) GetArch() string { - if x != nil { - return x.Arch - } - return "" -} - -var File_descriptor_proto protoreflect.FileDescriptor - -var file_descriptor_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x22, 0xf7, 0x02, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x75, - 0x72, 0x6c, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x08, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x48, 0x00, 0x52, 0x08, 0x70, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x61, 0x72, 0x74, - 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x01, 0x52, 0x0c, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x88, - 0x01, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x42, - 0x0f, 0x0a, 0x0d, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x22, 0x2e, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, - 0x4f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x4f, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x41, 0x72, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x72, 0x63, 0x68, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_descriptor_proto_rawDescOnce sync.Once - file_descriptor_proto_rawDescData = file_descriptor_proto_rawDesc -) - -func file_descriptor_proto_rawDescGZIP() []byte { - file_descriptor_proto_rawDescOnce.Do(func() { - file_descriptor_proto_rawDescData = protoimpl.X.CompressGZIP(file_descriptor_proto_rawDescData) - }) - return file_descriptor_proto_rawDescData -} - -var file_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_descriptor_proto_goTypes = []interface{}{ - (*Descriptor)(nil), // 0: v1.Descriptor - (*Platform)(nil), // 1: v1.Platform - nil, // 2: v1.Descriptor.AnnotationsEntry -} -var file_descriptor_proto_depIdxs = []int32{ - 2, // 0: v1.Descriptor.annotations:type_name -> v1.Descriptor.AnnotationsEntry - 1, // 1: v1.Descriptor.platform:type_name -> v1.Platform - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_descriptor_proto_init() } -func file_descriptor_proto_init() { - if File_descriptor_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_descriptor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Descriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_descriptor_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Platform); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_descriptor_proto_msgTypes[0].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_descriptor_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_descriptor_proto_goTypes, - DependencyIndexes: file_descriptor_proto_depIdxs, - MessageInfos: file_descriptor_proto_msgTypes, - }.Build() - File_descriptor_proto = out.File - file_descriptor_proto_rawDesc = nil - file_descriptor_proto_goTypes = nil - file_descriptor_proto_depIdxs = nil -} diff --git a/pkg/meta/proto_go/index.pb.go b/pkg/meta/proto_go/index.pb.go deleted file mode 100644 index 105d456566..0000000000 --- a/pkg/meta/proto_go/index.pb.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.15.8 -// source: index.proto - -package proto_go - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Index struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Versioned *Versioned `protobuf:"bytes,1,opt,name=versioned,proto3" json:"versioned,omitempty"` - Mediatype *string `protobuf:"bytes,2,opt,name=mediatype,proto3,oneof" json:"mediatype,omitempty"` - Artifacttype *string `protobuf:"bytes,3,opt,name=artifacttype,proto3,oneof" json:"artifacttype,omitempty"` - Manifests []*Descriptor `protobuf:"bytes,4,rep,name=manifests,proto3" json:"manifests,omitempty"` - Subject *Descriptor `protobuf:"bytes,5,opt,name=subject,proto3,oneof" json:"subject,omitempty"` - Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Index) Reset() { - *x = Index{} - if protoimpl.UnsafeEnabled { - mi := &file_index_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Index) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Index) ProtoMessage() {} - -func (x *Index) ProtoReflect() protoreflect.Message { - mi := &file_index_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Index.ProtoReflect.Descriptor instead. -func (*Index) Descriptor() ([]byte, []int) { - return file_index_proto_rawDescGZIP(), []int{0} -} - -func (x *Index) GetVersioned() *Versioned { - if x != nil { - return x.Versioned - } - return nil -} - -func (x *Index) GetMediatype() string { - if x != nil && x.Mediatype != nil { - return *x.Mediatype - } - return "" -} - -func (x *Index) GetArtifacttype() string { - if x != nil && x.Artifacttype != nil { - return *x.Artifacttype - } - return "" -} - -func (x *Index) GetManifests() []*Descriptor { - if x != nil { - return x.Manifests - } - return nil -} - -func (x *Index) GetSubject() *Descriptor { - if x != nil { - return x.Subject - } - return nil -} - -func (x *Index) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -var File_index_proto protoreflect.FileDescriptor - -var file_index_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, - 0x31, 0x1a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x03, 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2b, - 0x0a, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, - 0x52, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x6d, - 0x65, 0x64, 0x69, 0x61, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x27, - 0x0a, 0x0c, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0c, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, - 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x09, 0x6d, 0x61, 0x6e, 0x69, 0x66, - 0x65, 0x73, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x6d, 0x61, 0x6e, 0x69, - 0x66, 0x65, 0x73, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x48, 0x02, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x31, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x79, 0x70, 0x65, - 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x74, 0x79, 0x70, - 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_index_proto_rawDescOnce sync.Once - file_index_proto_rawDescData = file_index_proto_rawDesc -) - -func file_index_proto_rawDescGZIP() []byte { - file_index_proto_rawDescOnce.Do(func() { - file_index_proto_rawDescData = protoimpl.X.CompressGZIP(file_index_proto_rawDescData) - }) - return file_index_proto_rawDescData -} - -var file_index_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_index_proto_goTypes = []interface{}{ - (*Index)(nil), // 0: v1.Index - nil, // 1: v1.Index.AnnotationsEntry - (*Versioned)(nil), // 2: v1.Versioned - (*Descriptor)(nil), // 3: v1.Descriptor -} -var file_index_proto_depIdxs = []int32{ - 2, // 0: v1.Index.versioned:type_name -> v1.Versioned - 3, // 1: v1.Index.manifests:type_name -> v1.Descriptor - 3, // 2: v1.Index.subject:type_name -> v1.Descriptor - 1, // 3: v1.Index.annotations:type_name -> v1.Index.AnnotationsEntry - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_index_proto_init() } -func file_index_proto_init() { - if File_index_proto != nil { - return - } - file_descriptor_proto_init() - file_versioned_proto_init() - if !protoimpl.UnsafeEnabled { - file_index_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Index); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_index_proto_msgTypes[0].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_index_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_index_proto_goTypes, - DependencyIndexes: file_index_proto_depIdxs, - MessageInfos: file_index_proto_msgTypes, - }.Build() - File_index_proto = out.File - file_index_proto_rawDesc = nil - file_index_proto_goTypes = nil - file_index_proto_depIdxs = nil -} diff --git a/pkg/meta/proto_go/manifest.pb.go b/pkg/meta/proto_go/manifest.pb.go deleted file mode 100644 index 0032207340..0000000000 --- a/pkg/meta/proto_go/manifest.pb.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.15.8 -// source: manifest.proto - -package proto_go - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Manifest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Versioned *Versioned `protobuf:"bytes,1,opt,name=versioned,proto3" json:"versioned,omitempty"` - Mediatype *string `protobuf:"bytes,2,opt,name=mediatype,proto3,oneof" json:"mediatype,omitempty"` - Artifacttype *string `protobuf:"bytes,3,opt,name=artifacttype,proto3,oneof" json:"artifacttype,omitempty"` - Config *Descriptor `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` - Layers []*Descriptor `protobuf:"bytes,5,rep,name=layers,proto3" json:"layers,omitempty"` - Subject *Descriptor `protobuf:"bytes,6,opt,name=subject,proto3,oneof" json:"subject,omitempty"` - Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Manifest) Reset() { - *x = Manifest{} - if protoimpl.UnsafeEnabled { - mi := &file_manifest_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Manifest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Manifest) ProtoMessage() {} - -func (x *Manifest) ProtoReflect() protoreflect.Message { - mi := &file_manifest_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Manifest.ProtoReflect.Descriptor instead. -func (*Manifest) Descriptor() ([]byte, []int) { - return file_manifest_proto_rawDescGZIP(), []int{0} -} - -func (x *Manifest) GetVersioned() *Versioned { - if x != nil { - return x.Versioned - } - return nil -} - -func (x *Manifest) GetMediatype() string { - if x != nil && x.Mediatype != nil { - return *x.Mediatype - } - return "" -} - -func (x *Manifest) GetArtifacttype() string { - if x != nil && x.Artifacttype != nil { - return *x.Artifacttype - } - return "" -} - -func (x *Manifest) GetConfig() *Descriptor { - if x != nil { - return x.Config - } - return nil -} - -func (x *Manifest) GetLayers() []*Descriptor { - if x != nil { - return x.Layers - } - return nil -} - -func (x *Manifest) GetSubject() *Descriptor { - if x != nil { - return x.Subject - } - return nil -} - -func (x *Manifest) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -var File_manifest_proto protoreflect.FileDescriptor - -var file_manifest_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x02, 0x76, 0x31, 0x1a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x03, 0x0a, 0x08, 0x4d, 0x61, 0x6e, 0x69, - 0x66, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x52, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x64, 0x12, 0x21, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x79, 0x70, - 0x65, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0c, 0x61, 0x72, - 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, - 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x0a, 0x06, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x0a, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x48, 0x02, - 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x0b, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, - 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, - 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0c, 0x0a, - 0x0a, 0x5f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, - 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0a, 0x0a, 0x08, - 0x5f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_manifest_proto_rawDescOnce sync.Once - file_manifest_proto_rawDescData = file_manifest_proto_rawDesc -) - -func file_manifest_proto_rawDescGZIP() []byte { - file_manifest_proto_rawDescOnce.Do(func() { - file_manifest_proto_rawDescData = protoimpl.X.CompressGZIP(file_manifest_proto_rawDescData) - }) - return file_manifest_proto_rawDescData -} - -var file_manifest_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_manifest_proto_goTypes = []interface{}{ - (*Manifest)(nil), // 0: v1.Manifest - nil, // 1: v1.Manifest.AnnotationsEntry - (*Versioned)(nil), // 2: v1.Versioned - (*Descriptor)(nil), // 3: v1.Descriptor -} -var file_manifest_proto_depIdxs = []int32{ - 2, // 0: v1.Manifest.versioned:type_name -> v1.Versioned - 3, // 1: v1.Manifest.config:type_name -> v1.Descriptor - 3, // 2: v1.Manifest.layers:type_name -> v1.Descriptor - 3, // 3: v1.Manifest.subject:type_name -> v1.Descriptor - 1, // 4: v1.Manifest.annotations:type_name -> v1.Manifest.AnnotationsEntry - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_manifest_proto_init() } -func file_manifest_proto_init() { - if File_manifest_proto != nil { - return - } - file_descriptor_proto_init() - file_versioned_proto_init() - if !protoimpl.UnsafeEnabled { - file_manifest_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Manifest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_manifest_proto_msgTypes[0].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_manifest_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_manifest_proto_goTypes, - DependencyIndexes: file_manifest_proto_depIdxs, - MessageInfos: file_manifest_proto_msgTypes, - }.Build() - File_manifest_proto = out.File - file_manifest_proto_rawDesc = nil - file_manifest_proto_goTypes = nil - file_manifest_proto_depIdxs = nil -} diff --git a/pkg/meta/proto_go/imageData.pb.go b/pkg/meta/proto_go/meta.pb.go similarity index 58% rename from pkg/meta/proto_go/imageData.pb.go rename to pkg/meta/proto_go/meta.pb.go index f8d2afd3af..0b73bc6b45 100644 --- a/pkg/meta/proto_go/imageData.pb.go +++ b/pkg/meta/proto_go/meta.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.31.0 // protoc v3.15.8 -// source: imageData.proto +// source: meta.proto package proto_go @@ -33,7 +33,7 @@ type TagDescriptor struct { func (x *TagDescriptor) Reset() { *x = TagDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[0] + mi := &file_meta_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +46,7 @@ func (x *TagDescriptor) String() string { func (*TagDescriptor) ProtoMessage() {} func (x *TagDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[0] + mi := &file_meta_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -59,7 +59,7 @@ func (x *TagDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use TagDescriptor.ProtoReflect.Descriptor instead. func (*TagDescriptor) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{0} + return file_meta_proto_rawDescGZIP(), []int{0} } func (x *TagDescriptor) GetMediaType() string { @@ -96,7 +96,7 @@ type ImageData struct { func (x *ImageData) Reset() { *x = ImageData{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[1] + mi := &file_meta_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -109,7 +109,7 @@ func (x *ImageData) String() string { func (*ImageData) ProtoMessage() {} func (x *ImageData) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[1] + mi := &file_meta_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -122,7 +122,7 @@ func (x *ImageData) ProtoReflect() protoreflect.Message { // Deprecated: Use ImageData.ProtoReflect.Descriptor instead. func (*ImageData) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{1} + return file_meta_proto_rawDescGZIP(), []int{1} } func (x *ImageData) GetVersioned() *Versioned { @@ -200,21 +200,22 @@ type ManifestData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Versioned *Versioned `protobuf:"bytes,1,opt,name=versioned,proto3" json:"versioned,omitempty"` - Digest string `protobuf:"bytes,2,opt,name=Digest,proto3" json:"Digest,omitempty"` - MediaType *string `protobuf:"bytes,4,opt,name=MediaType,proto3,oneof" json:"MediaType,omitempty"` - ArtifactType *string `protobuf:"bytes,5,opt,name=ArtifactType,proto3,oneof" json:"ArtifactType,omitempty"` - Layers []*Descriptor `protobuf:"bytes,6,rep,name=Layers,proto3" json:"Layers,omitempty"` - Subject *Descriptor `protobuf:"bytes,7,opt,name=Subject,proto3,oneof" json:"Subject,omitempty"` - Annotations map[string]string `protobuf:"bytes,8,rep,name=Annotations,proto3" json:"Annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Size int64 `protobuf:"varint,9,opt,name=Size,proto3" json:"Size,omitempty"` - Config *ConfigData `protobuf:"bytes,10,opt,name=Config,proto3" json:"Config,omitempty"` + Versioned *Versioned `protobuf:"bytes,1,opt,name=Versioned,proto3" json:"Versioned,omitempty"` + Digest string `protobuf:"bytes,2,opt,name=Digest,proto3" json:"Digest,omitempty"` + MediaType *string `protobuf:"bytes,4,opt,name=MediaType,proto3,oneof" json:"MediaType,omitempty"` + ArtifactType *string `protobuf:"bytes,5,opt,name=ArtifactType,proto3,oneof" json:"ArtifactType,omitempty"` + Layers []*Descriptor `protobuf:"bytes,6,rep,name=Layers,proto3" json:"Layers,omitempty"` + Subject *Descriptor `protobuf:"bytes,7,opt,name=Subject,proto3,oneof" json:"Subject,omitempty"` + Annotations map[string]string `protobuf:"bytes,8,rep,name=Annotations,proto3" json:"Annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ConfigMediaType string `protobuf:"bytes,9,opt,name=ConfigMediaType,proto3" json:"ConfigMediaType,omitempty"` + Size int64 `protobuf:"varint,10,opt,name=Size,proto3" json:"Size,omitempty"` + Config *ConfigData `protobuf:"bytes,11,opt,name=Config,proto3" json:"Config,omitempty"` } func (x *ManifestData) Reset() { *x = ManifestData{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[2] + mi := &file_meta_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -227,7 +228,7 @@ func (x *ManifestData) String() string { func (*ManifestData) ProtoMessage() {} func (x *ManifestData) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[2] + mi := &file_meta_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -240,7 +241,7 @@ func (x *ManifestData) ProtoReflect() protoreflect.Message { // Deprecated: Use ManifestData.ProtoReflect.Descriptor instead. func (*ManifestData) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{2} + return file_meta_proto_rawDescGZIP(), []int{2} } func (x *ManifestData) GetVersioned() *Versioned { @@ -292,6 +293,13 @@ func (x *ManifestData) GetAnnotations() map[string]string { return nil } +func (x *ManifestData) GetConfigMediaType() string { + if x != nil { + return x.ConfigMediaType + } + return "" +} + func (x *ManifestData) GetSize() int64 { if x != nil { return x.Size @@ -320,7 +328,7 @@ type RepoLastUpdatedImage struct { func (x *RepoLastUpdatedImage) Reset() { *x = RepoLastUpdatedImage{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[3] + mi := &file_meta_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -333,7 +341,7 @@ func (x *RepoLastUpdatedImage) String() string { func (*RepoLastUpdatedImage) ProtoMessage() {} func (x *RepoLastUpdatedImage) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[3] + mi := &file_meta_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -346,7 +354,7 @@ func (x *RepoLastUpdatedImage) ProtoReflect() protoreflect.Message { // Deprecated: Use RepoLastUpdatedImage.ProtoReflect.Descriptor instead. func (*RepoLastUpdatedImage) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{3} + return file_meta_proto_rawDescGZIP(), []int{3} } func (x *RepoLastUpdatedImage) GetLastUpdated() *timestamppb.Timestamp { @@ -400,7 +408,7 @@ type ProtoRepoMeta struct { func (x *ProtoRepoMeta) Reset() { *x = ProtoRepoMeta{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[4] + mi := &file_meta_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -413,7 +421,7 @@ func (x *ProtoRepoMeta) String() string { func (*ProtoRepoMeta) ProtoMessage() {} func (x *ProtoRepoMeta) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[4] + mi := &file_meta_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -426,7 +434,7 @@ func (x *ProtoRepoMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtoRepoMeta.ProtoReflect.Descriptor instead. func (*ProtoRepoMeta) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{4} + return file_meta_proto_rawDescGZIP(), []int{4} } func (x *ProtoRepoMeta) GetName() string { @@ -532,7 +540,7 @@ type RepoBlobs struct { func (x *RepoBlobs) Reset() { *x = RepoBlobs{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[5] + mi := &file_meta_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -545,7 +553,7 @@ func (x *RepoBlobs) String() string { func (*RepoBlobs) ProtoMessage() {} func (x *RepoBlobs) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[5] + mi := &file_meta_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -558,7 +566,7 @@ func (x *RepoBlobs) ProtoReflect() protoreflect.Message { // Deprecated: Use RepoBlobs.ProtoReflect.Descriptor instead. func (*RepoBlobs) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{5} + return file_meta_proto_rawDescGZIP(), []int{5} } func (x *RepoBlobs) GetName() string { @@ -592,7 +600,7 @@ type BlobInfo struct { func (x *BlobInfo) Reset() { *x = BlobInfo{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[6] + mi := &file_meta_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -605,7 +613,7 @@ func (x *BlobInfo) String() string { func (*BlobInfo) ProtoMessage() {} func (x *BlobInfo) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[6] + mi := &file_meta_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -618,7 +626,7 @@ func (x *BlobInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobInfo.ProtoReflect.Descriptor instead. func (*BlobInfo) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{6} + return file_meta_proto_rawDescGZIP(), []int{6} } func (x *BlobInfo) GetSize() int64 { @@ -667,7 +675,7 @@ type DescriptorStatistics struct { func (x *DescriptorStatistics) Reset() { *x = DescriptorStatistics{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[7] + mi := &file_meta_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -680,7 +688,7 @@ func (x *DescriptorStatistics) String() string { func (*DescriptorStatistics) ProtoMessage() {} func (x *DescriptorStatistics) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[7] + mi := &file_meta_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -693,7 +701,7 @@ func (x *DescriptorStatistics) ProtoReflect() protoreflect.Message { // Deprecated: Use DescriptorStatistics.ProtoReflect.Descriptor instead. func (*DescriptorStatistics) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{7} + return file_meta_proto_rawDescGZIP(), []int{7} } func (x *DescriptorStatistics) GetDownloadCount() int32 { @@ -714,7 +722,7 @@ type ReferrersInfo struct { func (x *ReferrersInfo) Reset() { *x = ReferrersInfo{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[8] + mi := &file_meta_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -727,7 +735,7 @@ func (x *ReferrersInfo) String() string { func (*ReferrersInfo) ProtoMessage() {} func (x *ReferrersInfo) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[8] + mi := &file_meta_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -740,7 +748,7 @@ func (x *ReferrersInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ReferrersInfo.ProtoReflect.Descriptor instead. func (*ReferrersInfo) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{8} + return file_meta_proto_rawDescGZIP(), []int{8} } func (x *ReferrersInfo) GetList() []*ReferrerInfo { @@ -765,7 +773,7 @@ type ReferrerInfo struct { func (x *ReferrerInfo) Reset() { *x = ReferrerInfo{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[9] + mi := &file_meta_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -778,7 +786,7 @@ func (x *ReferrerInfo) String() string { func (*ReferrerInfo) ProtoMessage() {} func (x *ReferrerInfo) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[9] + mi := &file_meta_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -791,7 +799,7 @@ func (x *ReferrerInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ReferrerInfo.ProtoReflect.Descriptor instead. func (*ReferrerInfo) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{9} + return file_meta_proto_rawDescGZIP(), []int{9} } func (x *ReferrerInfo) GetDigest() string { @@ -840,7 +848,7 @@ type ManifestSignatures struct { func (x *ManifestSignatures) Reset() { *x = ManifestSignatures{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[10] + mi := &file_meta_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -853,7 +861,7 @@ func (x *ManifestSignatures) String() string { func (*ManifestSignatures) ProtoMessage() {} func (x *ManifestSignatures) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[10] + mi := &file_meta_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -866,7 +874,7 @@ func (x *ManifestSignatures) ProtoReflect() protoreflect.Message { // Deprecated: Use ManifestSignatures.ProtoReflect.Descriptor instead. func (*ManifestSignatures) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{10} + return file_meta_proto_rawDescGZIP(), []int{10} } func (x *ManifestSignatures) GetMap() map[string]*SignaturesInfo { @@ -887,7 +895,7 @@ type SignaturesInfo struct { func (x *SignaturesInfo) Reset() { *x = SignaturesInfo{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[11] + mi := &file_meta_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -900,7 +908,7 @@ func (x *SignaturesInfo) String() string { func (*SignaturesInfo) ProtoMessage() {} func (x *SignaturesInfo) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[11] + mi := &file_meta_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -913,7 +921,7 @@ func (x *SignaturesInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SignaturesInfo.ProtoReflect.Descriptor instead. func (*SignaturesInfo) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{11} + return file_meta_proto_rawDescGZIP(), []int{11} } func (x *SignaturesInfo) GetList() []*SignatureInfo { @@ -935,7 +943,7 @@ type SignatureInfo struct { func (x *SignatureInfo) Reset() { *x = SignatureInfo{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[12] + mi := &file_meta_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -948,7 +956,7 @@ func (x *SignatureInfo) String() string { func (*SignatureInfo) ProtoMessage() {} func (x *SignatureInfo) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[12] + mi := &file_meta_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -961,7 +969,7 @@ func (x *SignatureInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SignatureInfo.ProtoReflect.Descriptor instead. func (*SignatureInfo) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{12} + return file_meta_proto_rawDescGZIP(), []int{12} } func (x *SignatureInfo) GetSignatureManifestDigest() string { @@ -993,7 +1001,7 @@ type LayersInfo struct { func (x *LayersInfo) Reset() { *x = LayersInfo{} if protoimpl.UnsafeEnabled { - mi := &file_imageData_proto_msgTypes[13] + mi := &file_meta_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1006,7 +1014,7 @@ func (x *LayersInfo) String() string { func (*LayersInfo) ProtoMessage() {} func (x *LayersInfo) ProtoReflect() protoreflect.Message { - mi := &file_imageData_proto_msgTypes[13] + mi := &file_meta_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1019,7 +1027,7 @@ func (x *LayersInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use LayersInfo.ProtoReflect.Descriptor instead. func (*LayersInfo) Descriptor() ([]byte, []int) { - return file_imageData_proto_rawDescGZIP(), []int{13} + return file_meta_proto_rawDescGZIP(), []int{13} } func (x *LayersInfo) GetLayerDigest() string { @@ -1057,243 +1065,243 @@ func (x *LayersInfo) GetDate() *timestamppb.Timestamp { return nil } -var File_imageData_proto protoreflect.FileDescriptor - -var file_imageData_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x02, 0x76, 0x31, 0x1a, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0d, 0x54, 0x61, 0x67, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, - 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4d, 0x65, 0x64, - 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0xd2, - 0x03, 0x0a, 0x09, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x09, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x52, 0x09, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x64, - 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4d, 0x65, - 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x72, 0x74, 0x69, 0x66, - 0x61, 0x63, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x41, 0x72, - 0x74, 0x69, 0x66, 0x61, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x4d, 0x61, 0x6e, - 0x69, 0x66, 0x65, 0x73, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, - 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x53, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x07, 0x53, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x41, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, - 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x52, 0x65, 0x70, 0x6f, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x52, 0x65, 0x70, 0x6f, 0x88, 0x01, 0x01, 0x12, - 0x15, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x03, - 0x54, 0x61, 0x67, 0x88, 0x01, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x53, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x52, 0x65, 0x70, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x5f, - 0x54, 0x61, 0x67, 0x22, 0xe2, 0x03, 0x0a, 0x0c, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x52, 0x09, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09, 0x4d, 0x65, 0x64, - 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, - 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, - 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x01, 0x52, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x06, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x0a, - 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x48, 0x02, - 0x52, 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x0b, - 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, - 0x61, 0x74, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x3e, 0x0a, - 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, +var File_meta_proto protoreflect.FileDescriptor + +var file_meta_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, + 0x1a, 0x09, 0x6f, 0x63, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0d, + 0x54, 0x61, 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, + 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, + 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x22, 0xd2, 0x03, 0x0a, 0x09, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x2b, 0x0a, 0x09, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x64, 0x52, 0x09, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, + 0x0a, 0x09, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x09, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x73, 0x12, 0x2d, + 0x0a, 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x48, + 0x00, 0x52, 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, + 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, + 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x52, + 0x65, 0x70, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x52, 0x65, 0x70, + 0x6f, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x02, 0x52, 0x03, 0x54, 0x61, 0x67, 0x88, 0x01, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x52, 0x65, 0x70, 0x6f, + 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x54, 0x61, 0x67, 0x22, 0x8c, 0x04, 0x0a, 0x0c, 0x4d, 0x61, 0x6e, + 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x09, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x52, 0x09, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, + 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x06, 0x4c, 0x61, + 0x79, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x4c, 0x61, 0x79, 0x65, + 0x72, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x48, 0x02, 0x52, 0x07, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x43, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, + 0x66, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x53, 0x69, 0x7a, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x3e, 0x0a, 0x10, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0c, 0x0a, 0x0a, + 0x5f, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x41, + 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0xb1, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, + 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x12, 0x41, 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x48, 0x00, 0x52, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x54, 0x61, 0x67, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x54, 0x61, 0x67, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, + 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x8d, 0x07, 0x0a, 0x0d, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x12, 0x0a, + 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, + 0x74, 0x61, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x54, 0x61, + 0x67, 0x73, 0x12, 0x41, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x41, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x72, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x49, 0x73, 0x53, 0x74, + 0x61, 0x72, 0x72, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x49, 0x73, 0x53, + 0x74, 0x61, 0x72, 0x72, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x49, 0x73, 0x42, 0x6f, 0x6f, 0x6b, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x49, 0x73, + 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x61, + 0x6e, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x14, + 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, + 0x74, 0x61, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x6e, 0x64, + 0x6f, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, + 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x52, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x49, + 0x0a, 0x10, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x70, 0x6f, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x48, 0x00, 0x52, 0x10, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x1a, 0x4a, 0x0a, 0x09, 0x54, 0x61, 0x67, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x57, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x55, + 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0c, 0x0a, - 0x0a, 0x5f, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, - 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0a, 0x0a, 0x08, - 0x5f, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0xb1, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x70, - 0x6f, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x54, 0x61, - 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x54, 0x61, 0x67, 0x42, 0x0e, 0x0a, 0x0c, - 0x5f, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x8d, 0x07, 0x0a, - 0x0d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x12, - 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, - 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x54, - 0x61, 0x67, 0x73, 0x12, 0x41, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, - 0x73, 0x74, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x53, 0x74, 0x61, 0x74, - 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x41, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x09, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x2e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x49, 0x73, 0x53, - 0x74, 0x61, 0x72, 0x72, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x49, 0x73, - 0x53, 0x74, 0x61, 0x72, 0x72, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x49, 0x73, 0x42, 0x6f, 0x6f, - 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x49, - 0x73, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x52, - 0x61, 0x6e, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, - 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x53, 0x74, 0x61, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x6e, - 0x64, 0x6f, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x6e, 0x64, - 0x6f, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, - 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, - 0x49, 0x0a, 0x10, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x70, 0x6f, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x10, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x1a, 0x4a, 0x0a, 0x09, 0x54, 0x61, - 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, - 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x57, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, - 0x74, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, - 0x74, 0x69, 0x63, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x55, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, - 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, - 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x4c, 0x61, 0x73, 0x74, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x97, 0x01, 0x0a, - 0x09, 0x52, 0x65, 0x70, 0x6f, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, - 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x2e, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x1a, 0x46, - 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd3, 0x01, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, - 0x73, 0x12, 0x2a, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x52, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x1a, 0x0a, - 0x08, 0x53, 0x75, 0x62, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x08, 0x53, 0x75, 0x62, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x4c, 0x61, 0x73, - 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x4c, 0x61, - 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, - 0x5f, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x3c, 0x0a, 0x14, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, - 0x74, 0x69, 0x63, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x44, 0x6f, 0x77, - 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x35, 0x0a, 0x0d, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x04, 0x6c, - 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, - 0x74, 0x22, 0x81, 0x02, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, - 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4d, - 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x72, 0x74, 0x69, - 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x43, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, - 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x03, - 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x1a, - 0x4a, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, 0x0e, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, - 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, - 0x6c, 0x69, 0x73, 0x74, 0x22, 0x79, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x2e, 0x0a, 0x0a, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, - 0xbe, 0x01, 0x0a, 0x0a, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, - 0x0a, 0x0b, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x12, 0x22, 0x0a, 0x0c, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, - 0x12, 0x2e, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x4c, 0x61, 0x73, 0x74, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x97, 0x01, 0x0a, 0x09, + 0x52, 0x65, 0x70, 0x6f, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, + 0x05, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x62, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x1a, 0x46, 0x0a, + 0x0a, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd3, 0x01, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, + 0x12, 0x2a, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x52, 0x09, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x53, 0x75, 0x62, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x53, 0x75, 0x62, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x4c, 0x61, 0x73, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, + 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x3c, 0x0a, 0x14, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x44, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x35, 0x0a, 0x0d, 0x52, 0x65, 0x66, + 0x65, 0x72, 0x72, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x22, 0x81, 0x02, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, 0x64, + 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4d, 0x65, + 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, + 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, + 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, + 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x43, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x72, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, + 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x03, 0x6d, + 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, + 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x1a, 0x4a, + 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, 0x0e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x22, 0x79, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x2e, + 0x0a, 0x0a, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x0a, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xbe, + 0x01, 0x0a, 0x0a, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, + 0x0b, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, + 0x22, 0x0a, 0x0c, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, + 0x2e, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_imageData_proto_rawDescOnce sync.Once - file_imageData_proto_rawDescData = file_imageData_proto_rawDesc + file_meta_proto_rawDescOnce sync.Once + file_meta_proto_rawDescData = file_meta_proto_rawDesc ) -func file_imageData_proto_rawDescGZIP() []byte { - file_imageData_proto_rawDescOnce.Do(func() { - file_imageData_proto_rawDescData = protoimpl.X.CompressGZIP(file_imageData_proto_rawDescData) +func file_meta_proto_rawDescGZIP() []byte { + file_meta_proto_rawDescOnce.Do(func() { + file_meta_proto_rawDescData = protoimpl.X.CompressGZIP(file_meta_proto_rawDescData) }) - return file_imageData_proto_rawDescData + return file_meta_proto_rawDescData } -var file_imageData_proto_msgTypes = make([]protoimpl.MessageInfo, 23) -var file_imageData_proto_goTypes = []interface{}{ +var file_meta_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_meta_proto_goTypes = []interface{}{ (*TagDescriptor)(nil), // 0: v1.TagDescriptor (*ImageData)(nil), // 1: v1.ImageData (*ManifestData)(nil), // 2: v1.ManifestData @@ -1323,12 +1331,12 @@ var file_imageData_proto_goTypes = []interface{}{ (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp (*Platform)(nil), // 27: v1.Platform } -var file_imageData_proto_depIdxs = []int32{ +var file_meta_proto_depIdxs = []int32{ 23, // 0: v1.ImageData.Versioned:type_name -> v1.Versioned 2, // 1: v1.ImageData.Manifests:type_name -> v1.ManifestData 24, // 2: v1.ImageData.Subject:type_name -> v1.Descriptor 14, // 3: v1.ImageData.Annotations:type_name -> v1.ImageData.AnnotationsEntry - 23, // 4: v1.ManifestData.versioned:type_name -> v1.Versioned + 23, // 4: v1.ManifestData.Versioned:type_name -> v1.Versioned 24, // 5: v1.ManifestData.Layers:type_name -> v1.Descriptor 24, // 6: v1.ManifestData.Subject:type_name -> v1.Descriptor 15, // 7: v1.ManifestData.Annotations:type_name -> v1.ManifestData.AnnotationsEntry @@ -1362,16 +1370,14 @@ var file_imageData_proto_depIdxs = []int32{ 0, // [0:31] is the sub-list for field type_name } -func init() { file_imageData_proto_init() } -func file_imageData_proto_init() { - if File_imageData_proto != nil { +func init() { file_meta_proto_init() } +func file_meta_proto_init() { + if File_meta_proto != nil { return } - file_versioned_proto_init() - file_config_proto_init() - file_descriptor_proto_init() + file_oci_proto_init() if !protoimpl.UnsafeEnabled { - file_imageData_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TagDescriptor); i { case 0: return &v.state @@ -1383,7 +1389,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ImageData); i { case 0: return &v.state @@ -1395,7 +1401,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ManifestData); i { case 0: return &v.state @@ -1407,7 +1413,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RepoLastUpdatedImage); i { case 0: return &v.state @@ -1419,7 +1425,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProtoRepoMeta); i { case 0: return &v.state @@ -1431,7 +1437,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RepoBlobs); i { case 0: return &v.state @@ -1443,7 +1449,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlobInfo); i { case 0: return &v.state @@ -1455,7 +1461,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DescriptorStatistics); i { case 0: return &v.state @@ -1467,7 +1473,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReferrersInfo); i { case 0: return &v.state @@ -1479,7 +1485,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReferrerInfo); i { case 0: return &v.state @@ -1491,7 +1497,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ManifestSignatures); i { case 0: return &v.state @@ -1503,7 +1509,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignaturesInfo); i { case 0: return &v.state @@ -1515,7 +1521,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignatureInfo); i { case 0: return &v.state @@ -1527,7 +1533,7 @@ func file_imageData_proto_init() { return nil } } - file_imageData_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_meta_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LayersInfo); i { case 0: return &v.state @@ -1540,27 +1546,27 @@ func file_imageData_proto_init() { } } } - file_imageData_proto_msgTypes[1].OneofWrappers = []interface{}{} - file_imageData_proto_msgTypes[2].OneofWrappers = []interface{}{} - file_imageData_proto_msgTypes[3].OneofWrappers = []interface{}{} - file_imageData_proto_msgTypes[4].OneofWrappers = []interface{}{} - file_imageData_proto_msgTypes[6].OneofWrappers = []interface{}{} + file_meta_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_meta_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_meta_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_meta_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_meta_proto_msgTypes[6].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_imageData_proto_rawDesc, + RawDescriptor: file_meta_proto_rawDesc, NumEnums: 0, NumMessages: 23, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_imageData_proto_goTypes, - DependencyIndexes: file_imageData_proto_depIdxs, - MessageInfos: file_imageData_proto_msgTypes, + GoTypes: file_meta_proto_goTypes, + DependencyIndexes: file_meta_proto_depIdxs, + MessageInfos: file_meta_proto_msgTypes, }.Build() - File_imageData_proto = out.File - file_imageData_proto_rawDesc = nil - file_imageData_proto_goTypes = nil - file_imageData_proto_depIdxs = nil + File_meta_proto = out.File + file_meta_proto_rawDesc = nil + file_meta_proto_goTypes = nil + file_meta_proto_depIdxs = nil } diff --git a/pkg/meta/proto_go/oci.pb.go b/pkg/meta/proto_go/oci.pb.go new file mode 100644 index 0000000000..d305d5f8a1 --- /dev/null +++ b/pkg/meta/proto_go/oci.pb.go @@ -0,0 +1,928 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.15.8 +// source: oci.proto + +package proto_go + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ImageConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExposedPorts map[string]*EmptyMessage `protobuf:"bytes,1,rep,name=ExposedPorts,proto3" json:"ExposedPorts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Volumes map[string]*EmptyMessage `protobuf:"bytes,2,rep,name=Volumes,proto3" json:"Volumes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Labels map[string]string `protobuf:"bytes,3,rep,name=Labels,proto3" json:"Labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + User string `protobuf:"bytes,4,opt,name=User,proto3" json:"User,omitempty"` + Env []string `protobuf:"bytes,5,rep,name=Env,proto3" json:"Env,omitempty"` + Entrypoint []string `protobuf:"bytes,6,rep,name=Entrypoint,proto3" json:"Entrypoint,omitempty"` + Cmd []string `protobuf:"bytes,7,rep,name=Cmd,proto3" json:"Cmd,omitempty"` + WorkingDir *string `protobuf:"bytes,8,opt,name=WorkingDir,proto3,oneof" json:"WorkingDir,omitempty"` + StopSignal *string `protobuf:"bytes,9,opt,name=StopSignal,proto3,oneof" json:"StopSignal,omitempty"` + ArgsEscaped bool `protobuf:"varint,10,opt,name=ArgsEscaped,proto3" json:"ArgsEscaped,omitempty"` +} + +func (x *ImageConfig) Reset() { + *x = ImageConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImageConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageConfig) ProtoMessage() {} + +func (x *ImageConfig) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageConfig.ProtoReflect.Descriptor instead. +func (*ImageConfig) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{0} +} + +func (x *ImageConfig) GetExposedPorts() map[string]*EmptyMessage { + if x != nil { + return x.ExposedPorts + } + return nil +} + +func (x *ImageConfig) GetVolumes() map[string]*EmptyMessage { + if x != nil { + return x.Volumes + } + return nil +} + +func (x *ImageConfig) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ImageConfig) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *ImageConfig) GetEnv() []string { + if x != nil { + return x.Env + } + return nil +} + +func (x *ImageConfig) GetEntrypoint() []string { + if x != nil { + return x.Entrypoint + } + return nil +} + +func (x *ImageConfig) GetCmd() []string { + if x != nil { + return x.Cmd + } + return nil +} + +func (x *ImageConfig) GetWorkingDir() string { + if x != nil && x.WorkingDir != nil { + return *x.WorkingDir + } + return "" +} + +func (x *ImageConfig) GetStopSignal() string { + if x != nil && x.StopSignal != nil { + return *x.StopSignal + } + return "" +} + +func (x *ImageConfig) GetArgsEscaped() bool { + if x != nil { + return x.ArgsEscaped + } + return false +} + +type RootFS struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` + DiffIDs []string `protobuf:"bytes,2,rep,name=DiffIDs,proto3" json:"DiffIDs,omitempty"` +} + +func (x *RootFS) Reset() { + *x = RootFS{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RootFS) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RootFS) ProtoMessage() {} + +func (x *RootFS) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RootFS.ProtoReflect.Descriptor instead. +func (*RootFS) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{1} +} + +func (x *RootFS) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *RootFS) GetDiffIDs() []string { + if x != nil { + return x.DiffIDs + } + return nil +} + +type History struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Created *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=Created,proto3,oneof" json:"Created,omitempty"` + CreatedBy *string `protobuf:"bytes,2,opt,name=CreatedBy,proto3,oneof" json:"CreatedBy,omitempty"` + Author *string `protobuf:"bytes,3,opt,name=Author,proto3,oneof" json:"Author,omitempty"` + Comment *string `protobuf:"bytes,4,opt,name=Comment,proto3,oneof" json:"Comment,omitempty"` + EmptyLayer *bool `protobuf:"varint,5,opt,name=EmptyLayer,proto3,oneof" json:"EmptyLayer,omitempty"` +} + +func (x *History) Reset() { + *x = History{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *History) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*History) ProtoMessage() {} + +func (x *History) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use History.ProtoReflect.Descriptor instead. +func (*History) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{2} +} + +func (x *History) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *History) GetCreatedBy() string { + if x != nil && x.CreatedBy != nil { + return *x.CreatedBy + } + return "" +} + +func (x *History) GetAuthor() string { + if x != nil && x.Author != nil { + return *x.Author + } + return "" +} + +func (x *History) GetComment() string { + if x != nil && x.Comment != nil { + return *x.Comment + } + return "" +} + +func (x *History) GetEmptyLayer() bool { + if x != nil && x.EmptyLayer != nil { + return *x.EmptyLayer + } + return false +} + +type ConfigData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Created *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=Created,proto3,oneof" json:"Created,omitempty"` + Author *string `protobuf:"bytes,2,opt,name=Author,proto3,oneof" json:"Author,omitempty"` + Platform *Platform `protobuf:"bytes,3,opt,name=Platform,proto3" json:"Platform,omitempty"` + Config *ImageConfig `protobuf:"bytes,4,opt,name=Config,proto3,oneof" json:"Config,omitempty"` + RootFS *RootFS `protobuf:"bytes,5,opt,name=RootFS,proto3,oneof" json:"RootFS,omitempty"` + History []*History `protobuf:"bytes,6,rep,name=History,proto3" json:"History,omitempty"` + Digest string `protobuf:"bytes,7,opt,name=Digest,proto3" json:"Digest,omitempty"` + MediaType string `protobuf:"bytes,8,opt,name=MediaType,proto3" json:"MediaType,omitempty"` + Size int64 `protobuf:"varint,9,opt,name=Size,proto3" json:"Size,omitempty"` +} + +func (x *ConfigData) Reset() { + *x = ConfigData{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigData) ProtoMessage() {} + +func (x *ConfigData) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigData.ProtoReflect.Descriptor instead. +func (*ConfigData) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{3} +} + +func (x *ConfigData) GetCreated() *timestamppb.Timestamp { + if x != nil { + return x.Created + } + return nil +} + +func (x *ConfigData) GetAuthor() string { + if x != nil && x.Author != nil { + return *x.Author + } + return "" +} + +func (x *ConfigData) GetPlatform() *Platform { + if x != nil { + return x.Platform + } + return nil +} + +func (x *ConfigData) GetConfig() *ImageConfig { + if x != nil { + return x.Config + } + return nil +} + +func (x *ConfigData) GetRootFS() *RootFS { + if x != nil { + return x.RootFS + } + return nil +} + +func (x *ConfigData) GetHistory() []*History { + if x != nil { + return x.History + } + return nil +} + +func (x *ConfigData) GetDigest() string { + if x != nil { + return x.Digest + } + return "" +} + +func (x *ConfigData) GetMediaType() string { + if x != nil { + return x.MediaType + } + return "" +} + +func (x *ConfigData) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type EmptyMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EmptyMessage) Reset() { + *x = EmptyMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyMessage) ProtoMessage() {} + +func (x *EmptyMessage) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead. +func (*EmptyMessage) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{4} +} + +type Descriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MediaType string `protobuf:"bytes,1,opt,name=MediaType,proto3" json:"MediaType,omitempty"` + Digest string `protobuf:"bytes,2,opt,name=Digest,proto3" json:"Digest,omitempty"` + Size int64 `protobuf:"varint,3,opt,name=Size,proto3" json:"Size,omitempty"` + URLs []string `protobuf:"bytes,4,rep,name=URLs,proto3" json:"URLs,omitempty"` + Data []byte `protobuf:"bytes,5,opt,name=Data,proto3" json:"Data,omitempty"` + Platform *Platform `protobuf:"bytes,6,opt,name=Platform,proto3,oneof" json:"Platform,omitempty"` + ArtifactType *string `protobuf:"bytes,7,opt,name=ArtifactType,proto3,oneof" json:"ArtifactType,omitempty"` + Annotations map[string]string `protobuf:"bytes,8,rep,name=Annotations,proto3" json:"Annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Descriptor) Reset() { + *x = Descriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Descriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Descriptor) ProtoMessage() {} + +func (x *Descriptor) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Descriptor.ProtoReflect.Descriptor instead. +func (*Descriptor) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{5} +} + +func (x *Descriptor) GetMediaType() string { + if x != nil { + return x.MediaType + } + return "" +} + +func (x *Descriptor) GetDigest() string { + if x != nil { + return x.Digest + } + return "" +} + +func (x *Descriptor) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *Descriptor) GetURLs() []string { + if x != nil { + return x.URLs + } + return nil +} + +func (x *Descriptor) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Descriptor) GetPlatform() *Platform { + if x != nil { + return x.Platform + } + return nil +} + +func (x *Descriptor) GetArtifactType() string { + if x != nil && x.ArtifactType != nil { + return *x.ArtifactType + } + return "" +} + +func (x *Descriptor) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +type Platform struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OS string `protobuf:"bytes,1,opt,name=OS,proto3" json:"OS,omitempty"` + Arch string `protobuf:"bytes,2,opt,name=Arch,proto3" json:"Arch,omitempty"` +} + +func (x *Platform) Reset() { + *x = Platform{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Platform) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Platform) ProtoMessage() {} + +func (x *Platform) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Platform.ProtoReflect.Descriptor instead. +func (*Platform) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{6} +} + +func (x *Platform) GetOS() string { + if x != nil { + return x.OS + } + return "" +} + +func (x *Platform) GetArch() string { + if x != nil { + return x.Arch + } + return "" +} + +type Versioned struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SchemaVersion int32 `protobuf:"varint,1,opt,name=SchemaVersion,proto3" json:"SchemaVersion,omitempty"` +} + +func (x *Versioned) Reset() { + *x = Versioned{} + if protoimpl.UnsafeEnabled { + mi := &file_oci_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Versioned) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Versioned) ProtoMessage() {} + +func (x *Versioned) ProtoReflect() protoreflect.Message { + mi := &file_oci_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Versioned.ProtoReflect.Descriptor instead. +func (*Versioned) Descriptor() ([]byte, []int) { + return file_oci_proto_rawDescGZIP(), []int{7} +} + +func (x *Versioned) GetSchemaVersion() int32 { + if x != nil { + return x.SchemaVersion + } + return 0 +} + +var File_oci_proto protoreflect.FileDescriptor + +var file_oci_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x6f, 0x63, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x1a, + 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xff, 0x04, 0x0a, 0x0b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x45, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x50, + 0x6f, 0x72, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x45, 0x78, 0x70, 0x6f, 0x73, + 0x65, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x07, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, + 0x33, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x6e, 0x76, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x45, 0x6e, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x43, 0x6d, + 0x64, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x43, 0x6d, 0x64, 0x12, 0x23, 0x0a, 0x0a, + 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x0a, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x72, 0x88, 0x01, + 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x72, 0x67, 0x73, 0x45, 0x73, + 0x63, 0x61, 0x70, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x41, 0x72, 0x67, + 0x73, 0x45, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x1a, 0x51, 0x0a, 0x11, 0x45, 0x78, 0x70, 0x6f, + 0x73, 0x65, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4c, 0x0a, 0x0c, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, + 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, + 0x44, 0x69, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x22, 0x36, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x74, 0x46, 0x53, 0x12, 0x12, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x44, 0x69, 0x66, 0x66, 0x49, 0x44, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x44, 0x69, 0x66, 0x66, 0x49, 0x44, 0x73, 0x22, 0x88, 0x02, 0x0a, 0x07, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x39, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x88, 0x01, + 0x01, 0x12, 0x21, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, + 0x79, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x06, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x88, 0x01, + 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x03, 0x52, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, + 0x12, 0x23, 0x0a, 0x0a, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, 0x52, 0x0a, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4c, 0x61, 0x79, + 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x42, + 0x09, 0x0a, 0x07, 0x5f, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x4c, 0x61, 0x79, 0x65, 0x72, 0x22, 0x83, 0x03, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x48, 0x00, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, + 0x1b, 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x01, 0x52, 0x06, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x08, + 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x02, 0x52, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x74, 0x46, 0x53, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6f, 0x74, 0x46, 0x53, + 0x48, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x74, 0x46, 0x53, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, + 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x07, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, + 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x0a, + 0x0a, 0x08, 0x5f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x52, 0x6f, 0x6f, 0x74, 0x46, 0x53, 0x22, 0x0e, 0x0a, 0x0c, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xf7, 0x02, 0x0a, 0x0a, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x65, + 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4d, + 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, + 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x55, 0x52, 0x4c, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x04, 0x55, 0x52, 0x4c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x08, + 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x48, 0x00, 0x52, 0x08, + 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x41, + 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x50, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2e, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x53, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x4f, + 0x53, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x72, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x41, 0x72, 0x63, 0x68, 0x22, 0x31, 0x0a, 0x09, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_oci_proto_rawDescOnce sync.Once + file_oci_proto_rawDescData = file_oci_proto_rawDesc +) + +func file_oci_proto_rawDescGZIP() []byte { + file_oci_proto_rawDescOnce.Do(func() { + file_oci_proto_rawDescData = protoimpl.X.CompressGZIP(file_oci_proto_rawDescData) + }) + return file_oci_proto_rawDescData +} + +var file_oci_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_oci_proto_goTypes = []interface{}{ + (*ImageConfig)(nil), // 0: v1.ImageConfig + (*RootFS)(nil), // 1: v1.RootFS + (*History)(nil), // 2: v1.History + (*ConfigData)(nil), // 3: v1.ConfigData + (*EmptyMessage)(nil), // 4: v1.EmptyMessage + (*Descriptor)(nil), // 5: v1.Descriptor + (*Platform)(nil), // 6: v1.Platform + (*Versioned)(nil), // 7: v1.Versioned + nil, // 8: v1.ImageConfig.ExposedPortsEntry + nil, // 9: v1.ImageConfig.VolumesEntry + nil, // 10: v1.ImageConfig.LabelsEntry + nil, // 11: v1.Descriptor.AnnotationsEntry + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp +} +var file_oci_proto_depIdxs = []int32{ + 8, // 0: v1.ImageConfig.ExposedPorts:type_name -> v1.ImageConfig.ExposedPortsEntry + 9, // 1: v1.ImageConfig.Volumes:type_name -> v1.ImageConfig.VolumesEntry + 10, // 2: v1.ImageConfig.Labels:type_name -> v1.ImageConfig.LabelsEntry + 12, // 3: v1.History.Created:type_name -> google.protobuf.Timestamp + 12, // 4: v1.ConfigData.Created:type_name -> google.protobuf.Timestamp + 6, // 5: v1.ConfigData.Platform:type_name -> v1.Platform + 0, // 6: v1.ConfigData.Config:type_name -> v1.ImageConfig + 1, // 7: v1.ConfigData.RootFS:type_name -> v1.RootFS + 2, // 8: v1.ConfigData.History:type_name -> v1.History + 6, // 9: v1.Descriptor.Platform:type_name -> v1.Platform + 11, // 10: v1.Descriptor.Annotations:type_name -> v1.Descriptor.AnnotationsEntry + 4, // 11: v1.ImageConfig.ExposedPortsEntry.value:type_name -> v1.EmptyMessage + 4, // 12: v1.ImageConfig.VolumesEntry.value:type_name -> v1.EmptyMessage + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_oci_proto_init() } +func file_oci_proto_init() { + if File_oci_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_oci_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImageConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oci_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RootFS); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oci_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*History); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oci_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oci_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oci_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Descriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oci_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Platform); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oci_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Versioned); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_oci_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_oci_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_oci_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_oci_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_oci_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_oci_proto_goTypes, + DependencyIndexes: file_oci_proto_depIdxs, + MessageInfos: file_oci_proto_msgTypes, + }.Build() + File_oci_proto = out.File + file_oci_proto_rawDesc = nil + file_oci_proto_goTypes = nil + file_oci_proto_depIdxs = nil +} diff --git a/pkg/meta/proto_go/versioned.pb.go b/pkg/meta/proto_go/versioned.pb.go deleted file mode 100644 index b865ec2fa3..0000000000 --- a/pkg/meta/proto_go/versioned.pb.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v3.15.8 -// source: versioned.proto - -package proto_go - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Versioned struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Schemaversion int32 `protobuf:"varint,1,opt,name=schemaversion,proto3" json:"schemaversion,omitempty"` -} - -func (x *Versioned) Reset() { - *x = Versioned{} - if protoimpl.UnsafeEnabled { - mi := &file_versioned_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Versioned) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Versioned) ProtoMessage() {} - -func (x *Versioned) ProtoReflect() protoreflect.Message { - mi := &file_versioned_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Versioned.ProtoReflect.Descriptor instead. -func (*Versioned) Descriptor() ([]byte, []int) { - return file_versioned_proto_rawDescGZIP(), []int{0} -} - -func (x *Versioned) GetSchemaversion() int32 { - if x != nil { - return x.Schemaversion - } - return 0 -} - -var File_versioned_proto protoreflect.FileDescriptor - -var file_versioned_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x02, 0x76, 0x31, 0x22, 0x31, 0x0a, 0x09, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_versioned_proto_rawDescOnce sync.Once - file_versioned_proto_rawDescData = file_versioned_proto_rawDesc -) - -func file_versioned_proto_rawDescGZIP() []byte { - file_versioned_proto_rawDescOnce.Do(func() { - file_versioned_proto_rawDescData = protoimpl.X.CompressGZIP(file_versioned_proto_rawDescData) - }) - return file_versioned_proto_rawDescData -} - -var file_versioned_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_versioned_proto_goTypes = []interface{}{ - (*Versioned)(nil), // 0: v1.Versioned -} -var file_versioned_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_versioned_proto_init() } -func file_versioned_proto_init() { - if File_versioned_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_versioned_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Versioned); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_versioned_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_versioned_proto_goTypes, - DependencyIndexes: file_versioned_proto_depIdxs, - MessageInfos: file_versioned_proto_msgTypes, - }.Build() - File_versioned_proto = out.File - file_versioned_proto_rawDesc = nil - file_versioned_proto_goTypes = nil - file_versioned_proto_depIdxs = nil -} diff --git a/pkg/meta/proto_test.go b/pkg/meta/proto_test.go index f5cf9e22d7..57f4f580ff 100644 --- a/pkg/meta/proto_test.go +++ b/pkg/meta/proto_test.go @@ -2,14 +2,10 @@ package meta_test import ( "encoding/json" - "fmt" "net/url" - "sync" "testing" - ispec "github.com/opencontainers/image-spec/specs-go/v1" . "github.com/smartystreets/goconvey/convey" - "google.golang.org/protobuf/proto" "gopkg.in/resty.v1" "zotregistry.io/zot/pkg/api" @@ -18,49 +14,11 @@ import ( zcommon "zotregistry.io/zot/pkg/common" extconf "zotregistry.io/zot/pkg/extensions/config" "zotregistry.io/zot/pkg/log" - "zotregistry.io/zot/pkg/meta/proto_go" - . "zotregistry.io/zot/pkg/test" + . "zotregistry.io/zot/pkg/test/common" . "zotregistry.io/zot/pkg/test/image-utils" + . "zotregistry.io/zot/pkg/test/oci-utils" ) -func TestProto(t *testing.T) { - Convey("Basic conversion", t, func() { - Convey("Manifest", func() { - mediaType := ispec.MediaTypeImageManifest - manifest := &proto_go.Manifest{ - Versioned: &proto_go.Versioned{Schemaversion: 2}, - Mediatype: &mediaType, - } - - buf, err := proto.Marshal(manifest) - So(err, ShouldBeNil) - - manifest = &proto_go.Manifest{} - - err = proto.Unmarshal(buf, manifest) - So(err, ShouldBeNil) - So(manifest.GetMediatype(), ShouldEqual, ispec.MediaTypeImageManifest) - }) - - Convey("Index", func() { - mediaType := ispec.MediaTypeImageIndex - index := &proto_go.Index{ - Versioned: &proto_go.Versioned{Schemaversion: 2}, - Mediatype: &mediaType, - } - - out, err := proto.Marshal(index) - So(err, ShouldBeNil) - - index = &proto_go.Index{} - - err = proto.Unmarshal(out, index) - So(err, ShouldBeNil) - So(index.GetMediatype(), ShouldEqual, ispec.MediaTypeImageIndex) - }) - }) -} - func TestProtoParsing(t *testing.T) { Convey("proto parse", t, func() { port := GetFreePort() @@ -137,72 +95,3 @@ func TestProtoParsing(t *testing.T) { So(responseStructRepos.Repos, ShouldNotBeEmpty) }) } - -func TestGenerate(t *testing.T) { - repoCount := 2000 - manifestImageCount := 10 - multiarchCount := 5 - - storeController := GetDefaultStoreController("/home/laur/dev/images/stress-test/storage", log.NewLogger("debug", "/dev/null")) - - for repoId := 0; repoId < repoCount; repoId++ { - for i := 0; i < manifestImageCount; i++ { - err := WriteImageToFileSystem( - CreateImageWith(). - RandomLayers(2, 5). - RandomConfig(). - Annotations(map[string]string{"test": "annotation"}).Build(), - fmt.Sprintf("repo%d", repoId), - fmt.Sprintf("tag%d", i), - storeController, - ) - if err != nil { - t.FailNow() - } - - t.Logf("Repo: %d, Manifest Tag: %d", repoId, i) - } - - for i := 0; i < multiarchCount; i++ { - err := WriteMultiArchImageToFileSystem( - CreateRandomMultiarch(), - fmt.Sprintf("repo%d", repoId), - fmt.Sprintf("tag-multi%d", i), - storeController, - ) - if err != nil { - t.FailNow() - } - - t.Logf("Repo: %d, Index Tag: %d", repoId, i) - } - } -} - -const ( - homeQuery1 = `{GlobalSearch(query:"", requestedPage: {limit:3 offset:0 sortBy: DOWNLOADS} ) {Page {TotalCount ItemCount} Repos {Name LastUpdated Size Platforms { Os Arch } IsStarred IsBookmarked NewestImage { Tag Vulnerabilities {MaxSeverity Count} Description IsSigned SignatureInfo { Tool IsTrusted Author } Licenses Vendor Labels } DownloadCount}}}` - homeQuery2 = `{GlobalSearch(query:"", requestedPage: {limit:2 offset:0 sortBy: UPDATE_TIME} ) {Page {TotalCount ItemCount} Repos {Name LastUpdated Size Platforms { Os Arch } IsStarred IsBookmarked NewestImage { Tag Vulnerabilities {MaxSeverity Count} Description IsSigned SignatureInfo { Tool IsTrusted Author } Licenses Vendor Labels } DownloadCount}}}` - homeQuery3 = `{GlobalSearch(query:"", requestedPage: {limit:2 offset:0 sortBy: RELEVANCE} ,filter: { IsBookmarked: true}) {Page {TotalCount ItemCount} Repos {Name LastUpdated Size Platforms { Os Arch } IsStarred IsBookmarked NewestImage { Tag Vulnerabilities {MaxSeverity Count} Description IsSigned SignatureInfo { Tool IsTrusted Author } Licenses Vendor Labels } DownloadCount}}}` -) - -func TestProfileHomePage(t *testing.T) { - for i := 0; i < 10; i++ { - wg := &sync.WaitGroup{} - - go RunQuery(homeQuery1, wg, t) - go RunQuery(homeQuery2, wg, t) - go RunQuery(homeQuery3, wg, t) - - wg.Wait() - t.Logf("Execution: %d", i) - } -} - -func RunQuery(query string, wg *sync.WaitGroup, t *testing.T) { - resp, err := resty.R().Get("http://127.0.0.1:5000" + constants.FullSearchPrefix + "?query=" + url.QueryEscape(query)) - if err != nil || resp.StatusCode() != 200 { - panic(fmt.Errorf("StatusCode: %d Err: %w", resp.StatusCode(), err)) - } - - t.Log("\t*") -} diff --git a/pkg/meta/types/types.go b/pkg/meta/types/types.go index b26c165ccd..5417a62741 100644 --- a/pkg/meta/types/types.go +++ b/pkg/meta/types/types.go @@ -172,9 +172,11 @@ type MetaDB interface { //nolint:interfacebloat ProtoSearchTags(ctx context.Context, searchText string) ([]FullImageData, error) - ProtoFilterTags(ctx context.Context, filterRepoTag FilterRepoTagFunc, filterFunc FilterProtoFunc) ([]FullImageData, error) + ProtoFilterTags(ctx context.Context, filterRepoTag FilterRepoTagFunc, filterFunc FilterProtoFunc, + ) ([]FullImageData, error) - ProtoFilterRepos(ctx context.Context, rankName FilterRepoNameFunc, filterFunc FilterFullRepoFunc) ([]FullRepoMetadata, error) + ProtoFilterRepos(ctx context.Context, rankName FilterRepoNameFunc, filterFunc FilterFullRepoFunc, + ) ([]FullRepoMetadata, error) ProtoGetRepoMeta(repo string) (RepoMetadata2, error) @@ -208,6 +210,8 @@ type MetaDB interface { //nolint:interfacebloat ProtoUpdateSignaturesValidity(repo string, manifestDigest godigest.Digest) error ProtoFilterImageData(ctx context.Context, digests []string) (map[string]ImageData2, error) + + ProtoRemoveRepoReference(repo, reference string, manifestDigest godigest.Digest) error } type UserDB interface { //nolint:interfacebloat @@ -289,7 +293,6 @@ type RepoMetadata2 struct { Stars int } -// used in repo search type RepoStatistics struct { Platforms []ispec.Platform Vendors []string diff --git a/pkg/test/mocks/repo_db_mock.go b/pkg/test/mocks/repo_db_mock.go index 44c7ccd366..2c482045a3 100644 --- a/pkg/test/mocks/repo_db_mock.go +++ b/pkg/test/mocks/repo_db_mock.go @@ -116,27 +116,65 @@ type MetaDBMock struct { SetProtoImageDataFn func(digest godigest.Digest, imageData mTypes.ImageData2) error - ProtoSetReferrerFn func(repo string, referredDigest godigest.Digest, referrer *proto_go.ReferrerInfo) error - ProtoSetRepoReferenceFn func(repo string, reference string, manifestDigest godigest.Digest, mediaType string) error - ProtoSearchReposFn func(ctx context.Context, searchText string) ([]mTypes.RepoMetadata2, map[string]mTypes.ImageData2, error) - ProtoSearchTagsFn func(ctx context.Context, searchText string) ([]mTypes.FullImageData, error) - ProtoFilterTagFn func(ctx context.Context, filterFunc mTypes.FilterProtoFunc) ([]mTypes.RepoMetadata2, map[string]mTypes.ImageData2, error) - ProtoGetRepoMetaFn func(repo string) (mTypes.RepoMetadata2, error) - ProtoGetImageDataFn func(digest godigest.Digest) (mTypes.ImageData2, error) - ProtoGetMultipleRepoMetaFn func(ctx context.Context, filter func(repoMeta mTypes.RepoMetadata2) bool) ([]mTypes.RepoMetadata2, error) - ProtoFilterReposFn func(ctx context.Context, filter mTypes.FilterProtoRepoFunc) ([]mTypes.RepoMetadata2, map[string]mTypes.ImageData2, error) - ProtoIncrementRepoStarsFn func(repo string) error - ProtoDecrementRepoStarsFn func(repo string) error - ProtoGetRepoStarsFn func(repo string) (int, error) - ProtoDeleteRepoTagFn func(repo string, tag string) error - ProtoGetUserRepoMetaFn func(ctx context.Context, repo string) (mTypes.RepoMetadata2, error) - ProtoSetRepoMetaFn func(repo string, repoMeta mTypes.RepoMetadata2) error - ProtoDeleteReferrerFn func(repo string, referredDigest godigest.Digest, referrerDigest godigest.Digest) error - ProtoGetReferrersInfoFn func(repo string, referredDigest godigest.Digest, artifactTypes []string) ([]mTypes.ReferrerInfo, error) - ProtoIncrementImageDownloadsFn func(repo string, reference string) error + ProtoSetReferrerFn func(repo string, referredDigest godigest.Digest, referrer *proto_go.ReferrerInfo) error + + ProtoSetRepoReferenceFn func(repo string, reference string, imageData mTypes.ImageData2) error + + ProtoSearchReposFn func(ctx context.Context, searchText string, + ) ([]mTypes.FullRepoMetadata, error) + + ProtoSearchTagsFn func(ctx context.Context, searchText string) ([]mTypes.FullImageData, error) + + ProtoFilterTagFn func(ctx context.Context, filterFunc mTypes.FilterProtoFunc, + ) ([]mTypes.RepoMetadata2, map[string]mTypes.ImageData2, error) + + ProtoGetRepoMetaFn func(repo string) (mTypes.RepoMetadata2, error) + + ProtoGetImageDataFn func(digest godigest.Digest) (mTypes.ImageData2, error) + + ProtoGetMultipleRepoMetaFn func(ctx context.Context, filter func(repoMeta mTypes.RepoMetadata2) bool, + ) ([]mTypes.RepoMetadata2, error) + + ProtoFilterReposFn func(ctx context.Context, rankName mTypes.FilterRepoNameFunc, + filterFunc mTypes.FilterFullRepoFunc) ([]mTypes.FullRepoMetadata, error) + + ProtoIncrementRepoStarsFn func(repo string) error + + ProtoDecrementRepoStarsFn func(repo string) error + + ProtoGetRepoStarsFn func(repo string) (int, error) + + ProtoDeleteRepoTagFn func(repo string, tag string) error + + ProtoGetUserRepoMetaFn func(ctx context.Context, repo string) (mTypes.RepoMetadata2, error) + + ProtoSetRepoMetaFn func(repo string, repoMeta mTypes.RepoMetadata2) error + + ProtoDeleteReferrerFn func(repo string, referredDigest godigest.Digest, referrerDigest godigest.Digest) error + + ProtoGetReferrersInfoFn func(repo string, referredDigest godigest.Digest, artifactTypes []string, + ) ([]mTypes.ReferrerInfo, error) + + ProtoIncrementImageDownloadsFn func(repo string, reference string) error + ProtoUpdateSignaturesValidityFn func(repo string, manifestDigest godigest.Digest) error - ProtoAddManifestSignatureFn func(repo string, signedManifestDigest godigest.Digest, sygMeta mTypes.SignatureMetadata) error - ProtoDeleteSignatureFn func(repo string, signedManifestDigest godigest.Digest, sigMeta mTypes.SignatureMetadata) error + + ProtoAddManifestSignatureFn func(repo string, signedManifestDigest godigest.Digest, sygMeta mTypes.SignatureMetadata, + ) error + + ProtoDeleteSignatureFn func(repo string, signedManifestDigest godigest.Digest, sigMeta mTypes.SignatureMetadata, + ) error + + ProtoSetImageDataFn func(digest godigest.Digest, imageData mTypes.ImageData2) error + + ProtoFilterTagsFn func(ctx context.Context, filterRepoTag mTypes.FilterRepoTagFunc, + filterFunc mTypes.FilterProtoFunc) ([]mTypes.FullImageData, error) + + ProtoGetFullRepoMetaFn func(ctx context.Context, repo string) (mTypes.FullRepoMetadata, error) + + ProtoFilterImageDataFn func(ctx context.Context, digests []string) (map[string]mTypes.ImageData2, error) + + ProtoRemoveRepoReferenceFn func(repo, reference string, manifestDigest godigest.Digest) error } func (sdm MetaDBMock) ImageTrustStore() mTypes.ImageTrustStore { @@ -524,7 +562,6 @@ func (sdm MetaDBMock) DeleteUserAPIKey(ctx context.Context, id string) error { return nil } -// TODO func (sdm MetaDBMock) SetProtoImageData(digest godigest.Digest, imageData mTypes.ImageData2) error { if sdm.SetProtoImageDataFn != nil { return sdm.SetProtoImageDataFn(digest, imageData) @@ -533,98 +570,198 @@ func (sdm MetaDBMock) SetProtoImageData(digest godigest.Digest, imageData mTypes return nil } -// TODO func (sdm MetaDBMock) ProtoSetImageData(digest godigest.Digest, imageData mTypes.ImageData2) error { + if sdm.ProtoSetImageDataFn != nil { + return sdm.ProtoSetImageDataFn(digest, imageData) + } return nil } -// TODO -func (bdw MetaDBMock) ProtoSetRepoReference(repo string, reference string, imageData mTypes.ImageData2) error { +func (sdm MetaDBMock) ProtoSetRepoReference(repo string, reference string, imageData mTypes.ImageData2) error { + if sdm.ProtoSetRepoReferenceFn != nil { + return sdm.ProtoSetRepoReferenceFn(repo, reference, imageData) + } + return nil } -// TODO -func (bdw MetaDBMock) ProtoSearchRepos(ctx context.Context, searchText string) ([]mTypes.FullRepoMetadata, error) { +func (sdm MetaDBMock) ProtoSearchRepos(ctx context.Context, searchText string) ([]mTypes.FullRepoMetadata, error) { + if sdm.ProtoSearchReposFn != nil { + return sdm.ProtoSearchReposFn(ctx, searchText) + } + return []mTypes.FullRepoMetadata{}, nil } -// TODO -func (bdw MetaDBMock) ProtoSearchTags(ctx context.Context, searchText string) ([]mTypes.FullImageData, error) { +func (sdm MetaDBMock) ProtoSearchTags(ctx context.Context, searchText string) ([]mTypes.FullImageData, error) { + if sdm.ProtoSearchTagsFn != nil { + return sdm.ProtoSearchTagsFn(ctx, searchText) + } + return []mTypes.FullImageData{}, nil } -func (bdw MetaDBMock) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.FilterRepoTagFunc, filterFunc mTypes.FilterProtoFunc, +func (sdm MetaDBMock) ProtoFilterTags(ctx context.Context, filterRepoTag mTypes.FilterRepoTagFunc, + filterFunc mTypes.FilterProtoFunc, ) ([]mTypes.FullImageData, error) { + if sdm.ProtoFilterTagsFn != nil { + return sdm.ProtoFilterTagsFn(ctx, filterRepoTag, filterFunc) + } + return []mTypes.FullImageData{}, nil } -func (bdw MetaDBMock) ProtoGetRepoMeta(repo string) (mTypes.RepoMetadata2, error) { +func (sdm MetaDBMock) ProtoGetRepoMeta(repo string) (mTypes.RepoMetadata2, error) { + if sdm.ProtoGetRepoMetaFn != nil { + return sdm.ProtoGetRepoMetaFn(repo) + } + return mTypes.RepoMetadata2{}, nil } -func (bdw MetaDBMock) ProtoGetFullRepoMeta(ctx context.Context, repo string) (mTypes.FullRepoMetadata, error) { +func (sdm MetaDBMock) ProtoGetFullRepoMeta(ctx context.Context, repo string) (mTypes.FullRepoMetadata, error) { + if sdm.ProtoGetFullRepoMetaFn != nil { + return sdm.ProtoGetFullRepoMetaFn(ctx, repo) + } + return mTypes.FullRepoMetadata{}, nil } -func (bdw MetaDBMock) ProtoGetImageData(digest godigest.Digest) (mTypes.ImageData2, error) { +func (sdm MetaDBMock) ProtoGetImageData(digest godigest.Digest) (mTypes.ImageData2, error) { + if sdm.ProtoGetImageDataFn != nil { + return sdm.ProtoGetImageDataFn(digest) + } + return mTypes.ImageData2{}, nil } -func (bdw MetaDBMock) ProtoGetMultipleRepoMeta(ctx context.Context, filter func(repoMeta mTypes.RepoMetadata2) bool) ([]mTypes.RepoMetadata2, error) { +func (sdm MetaDBMock) ProtoGetMultipleRepoMeta(ctx context.Context, filter func(repoMeta mTypes.RepoMetadata2) bool, +) ([]mTypes.RepoMetadata2, error) { + if sdm.ProtoGetMultipleRepoMetaFn != nil { + return sdm.ProtoGetMultipleRepoMetaFn(ctx, filter) + } + return []mTypes.RepoMetadata2{}, nil } -func (bdw MetaDBMock) ProtoFilterRepos(ctx context.Context, rankName mTypes.FilterRepoNameFunc, filterFunc mTypes.FilterFullRepoFunc, +func (sdm MetaDBMock) ProtoFilterRepos(ctx context.Context, rankName mTypes.FilterRepoNameFunc, + filterFunc mTypes.FilterFullRepoFunc, ) ([]mTypes.FullRepoMetadata, error) { + if sdm.ProtoFilterReposFn != nil { + return sdm.ProtoFilterReposFn(ctx, rankName, filterFunc) + } + return []mTypes.FullRepoMetadata{}, nil } -func (bdw MetaDBMock) ProtoIncrementRepoStars(repo string) error { +func (sdm MetaDBMock) ProtoIncrementRepoStars(repo string) error { + if sdm.ProtoIncrementRepoStarsFn != nil { + return sdm.ProtoIncrementRepoStarsFn(repo) + } + return nil } -func (bdw MetaDBMock) ProtoDecrementRepoStars(repo string) error { +func (sdm MetaDBMock) ProtoDecrementRepoStars(repo string) error { + if sdm.ProtoDecrementRepoStarsFn != nil { + return sdm.ProtoDecrementRepoStarsFn(repo) + } + return nil } -func (bdw MetaDBMock) ProtoGetRepoStars(repo string) (int, error) { +func (sdm MetaDBMock) ProtoGetRepoStars(repo string) (int, error) { + if sdm.ProtoGetRepoStarsFn != nil { + return sdm.ProtoGetRepoStarsFn(repo) + } + return 0, nil } -func (bdw MetaDBMock) ProtoDeleteRepoTag(repo string, tag string) error { +func (sdm MetaDBMock) ProtoDeleteRepoTag(repo string, tag string) error { + if sdm.ProtoDeleteRepoTagFn != nil { + return sdm.ProtoDeleteRepoTagFn(repo, tag) + } + return nil } -func (bdw MetaDBMock) ProtoGetUserRepoMeta(ctx context.Context, repo string) (mTypes.RepoMetadata2, error) { +func (sdm MetaDBMock) ProtoGetUserRepoMeta(ctx context.Context, repo string) (mTypes.RepoMetadata2, error) { + if sdm.ProtoGetUserRepoMetaFn != nil { + return sdm.ProtoGetUserRepoMetaFn(ctx, repo) + } + return mTypes.RepoMetadata2{}, nil } -func (bdw MetaDBMock) ProtoSetRepoMeta(repo string, repoMeta mTypes.RepoMetadata2) error { +func (sdm MetaDBMock) ProtoSetRepoMeta(repo string, repoMeta mTypes.RepoMetadata2) error { + if sdm.ProtoSetRepoMetaFn != nil { + return sdm.ProtoSetRepoMetaFn(repo, repoMeta) + } + return nil } -func (bdw MetaDBMock) ProtoGetReferrersInfo(repo string, referredDigest godigest.Digest, artifactTypes []string) ([]mTypes.ReferrerInfo, error) { +func (sdm MetaDBMock) ProtoGetReferrersInfo(repo string, referredDigest godigest.Digest, + artifactTypes []string, +) ([]mTypes.ReferrerInfo, error) { + if sdm.ProtoGetReferrersInfoFn != nil { + return sdm.ProtoGetReferrersInfoFn(repo, referredDigest, artifactTypes) + } + return []mTypes.ReferrerInfo{}, nil } -func (bdw MetaDBMock) ProtoIncrementImageDownloads(repo string, reference string) error { +func (sdm MetaDBMock) ProtoIncrementImageDownloads(repo string, reference string) error { + if sdm.ProtoIncrementImageDownloadsFn != nil { + return sdm.ProtoIncrementImageDownloadsFn(repo, reference) + } + return nil } -func (bdw MetaDBMock) ProtoUpdateSignaturesValidity(repo string, manifestDigest godigest.Digest) error { +func (sdm MetaDBMock) ProtoUpdateSignaturesValidity(repo string, manifestDigest godigest.Digest) error { + if sdm.ProtoUpdateSignaturesValidityFn != nil { + return sdm.ProtoUpdateSignaturesValidityFn(repo, manifestDigest) + } + return nil } -func (bdw MetaDBMock) ProtoAddManifestSignature(repo string, signedManifestDigest godigest.Digest, sygMeta mTypes.SignatureMetadata) error { +func (sdm MetaDBMock) ProtoAddManifestSignature(repo string, signedManifestDigest godigest.Digest, + sygMeta mTypes.SignatureMetadata, +) error { + if sdm.ProtoAddManifestSignatureFn != nil { + return sdm.ProtoAddManifestSignatureFn(repo, signedManifestDigest, sygMeta) + } + return nil } -func (bdw MetaDBMock) ProtoDeleteSignature(repo string, signedManifestDigest godigest.Digest, sigMeta mTypes.SignatureMetadata) error { +func (sdm MetaDBMock) ProtoDeleteSignature(repo string, signedManifestDigest godigest.Digest, + sigMeta mTypes.SignatureMetadata, +) error { + if sdm.ProtoDeleteSignatureFn != nil { + return sdm.ProtoDeleteSignatureFn(repo, signedManifestDigest, sigMeta) + } + return nil } -func (bdw MetaDBMock) ProtoFilterImageData(ctx context.Context, digests []string, +func (sdm MetaDBMock) ProtoFilterImageData(ctx context.Context, digests []string, ) (map[string]mTypes.ImageData2, error) { + if sdm.ProtoFilterImageDataFn != nil { + return sdm.ProtoFilterImageDataFn(ctx, digests) + } + return map[string]mTypes.ImageData2{}, nil } + +func (sdm MetaDBMock) ProtoRemoveRepoReference(repo, reference string, manifestDigest godigest.Digest) error { + if sdm.ProtoRemoveRepoReferenceFn != nil { + return sdm.ProtoRemoveRepoReferenceFn(repo, reference, manifestDigest) + } + + return nil +}