From eda0b00914d6de0c8c42993271b0dc4a76abaf45 Mon Sep 17 00:00:00 2001 From: "Per G. da Silva" Date: Tue, 12 May 2026 14:24:49 +0200 Subject: [PATCH 1/3] UPSTREAM: : Add ListPackageCustomSchemas gRPC endpoint to opm serve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a streaming gRPC endpoint that allows callers to retrieve raw FBC blobs for non-standard (custom) schemas, scoped to a specific package. Both schema and packageName are required parameters. The endpoint streams all matching blobs as google.protobuf.Struct, leaving it to the caller — who understands the custom schema's semantics — to handle filtering, deduplication, or validation of the results. Standard schemas (olm.package, olm.channel, olm.bundle, olm.deprecations) are excluded since they are already served by existing typed RPCs. Custom schema blobs without a package field are silently skipped during cache build, as they fall outside the scope of this package-scoped endpoint. Custom schema blobs are stored in the cache using a two-field key (schema, packageName) with sequential indices to support multiple blobs per key, backed by both pogreb and JSON cache backends. Signed-off-by: Per G. da Silva Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Per G. da Silva --- staging/operator-registry/AGENTS.md | 1 + staging/operator-registry/Makefile | 4 +- staging/operator-registry/README.md | 1 + .../operator-registry/pkg/api/registry.pb.go | 1058 ++++++----------- .../operator-registry/pkg/api/registry.proto | 11 +- .../pkg/api/registry_grpc.pb.go | 65 + staging/operator-registry/pkg/cache/cache.go | 28 + .../operator-registry/pkg/cache/cache_test.go | 157 +++ staging/operator-registry/pkg/cache/json.go | 40 + .../operator-registry/pkg/cache/meta_key.go | 40 + .../pkg/cache/meta_key_test.go | 110 ++ .../operator-registry/pkg/cache/pogrebv1.go | 36 + .../pkg/client/client_test.go | 4 + .../operator-registry/pkg/server/server.go | 44 + .../pkg/server/server_test.go | 166 ++- .../scripts/ensure-protoc.sh | 2 +- .../operator-registry/pkg/api/registry.pb.go | 1058 ++++++----------- .../operator-registry/pkg/api/registry.proto | 11 +- .../pkg/api/registry_grpc.pb.go | 65 + .../operator-registry/pkg/cache/cache.go | 28 + .../operator-registry/pkg/cache/json.go | 40 + .../operator-registry/pkg/cache/meta_key.go | 40 + .../operator-registry/pkg/cache/pogrebv1.go | 36 + .../operator-registry/pkg/server/server.go | 44 + 24 files changed, 1719 insertions(+), 1370 deletions(-) create mode 100644 staging/operator-registry/pkg/cache/meta_key.go create mode 100644 staging/operator-registry/pkg/cache/meta_key_test.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/cache/meta_key.go diff --git a/staging/operator-registry/AGENTS.md b/staging/operator-registry/AGENTS.md index cf2f88c9ab..dfd91f6565 100644 --- a/staging/operator-registry/AGENTS.md +++ b/staging/operator-registry/AGENTS.md @@ -166,6 +166,7 @@ The server exposes the following gRPC services: - `GetLatestChannelEntriesThatProvide(group, version, kind)` - Stream latest entries providing an API - `GetDefaultBundleThatProvides(group, version, kind)` - Get default bundle providing an API - `ListBundles()` - Stream all bundles +- `ListPackageCustomSchemas(schema, packageName)` - Stream raw FBC blobs for a non-standard schema scoped to a package **Health Service:** - Standard gRPC health check service for monitoring diff --git a/staging/operator-registry/Makefile b/staging/operator-registry/Makefile index 432f7703b8..955decec7d 100644 --- a/staging/operator-registry/Makefile +++ b/staging/operator-registry/Makefile @@ -106,8 +106,8 @@ fix-lint: $(GOLANGCI_LINT) .PHONY: codegen codegen: $(PROTOC) $(PROTOC_GEN_GO_GRPC) - $(PROTOC) --plugin=protoc-gen-go=$(PROTOC_GEN_GO_GRPC) -I pkg/api/ --go_out=pkg/api pkg/api/*.proto - $(PROTOC) --plugin=protoc-gen-go-grpc=$(PROTOC_GEN_GO_GRPC) -I pkg/api/ --go-grpc_out=pkg/api pkg/api/*.proto + $(PROTOC) --plugin=protoc-gen-go=$(PROTOC_GEN_GO_GRPC) -I pkg/api/ -I ./tools/bin/include --go_out=pkg/api pkg/api/*.proto + $(PROTOC) --plugin=protoc-gen-go-grpc=$(PROTOC_GEN_GO_GRPC) -I pkg/api/ -I ./tools/bin/include --go-grpc_out=pkg/api pkg/api/*.proto .PHONY: generate-fakes generate-fakes: diff --git a/staging/operator-registry/README.md b/staging/operator-registry/README.md index 8e1ea563c9..96bf50b87d 100644 --- a/staging/operator-registry/README.md +++ b/staging/operator-registry/README.md @@ -169,6 +169,7 @@ GetBundleForChannel GetBundleThatReplaces GetChannelEntriesThatProvide GetChannelEntriesThatReplace +ListPackageCustomSchemas GetDefaultBundleThatProvides GetLatestChannelEntriesThatProvide GetPackage diff --git a/staging/operator-registry/pkg/api/registry.pb.go b/staging/operator-registry/pkg/api/registry.pb.go index 826e4674f1..7fa58380be 100644 --- a/staging/operator-registry/pkg/api/registry.pb.go +++ b/staging/operator-registry/pkg/api/registry.pb.go @@ -1,17 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc-gen-go v1.36.11 +// protoc v5.27.0 // source: registry.proto package api import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -22,22 +23,19 @@ const ( ) type Channel struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CsvName string `protobuf:"bytes,2,opt,name=csvName,proto3" json:"csvName,omitempty"` + Deprecation *Deprecation `protobuf:"bytes,3,opt,name=deprecation,proto3" json:"deprecation,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - CsvName string `protobuf:"bytes,2,opt,name=csvName,proto3" json:"csvName,omitempty"` - Deprecation *Deprecation `protobuf:"bytes,3,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Channel) Reset() { *x = Channel{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Channel) String() string { @@ -48,7 +46,7 @@ func (*Channel) ProtoMessage() {} func (x *Channel) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -85,20 +83,17 @@ func (x *Channel) GetDeprecation() *Deprecation { } type PackageName struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PackageName) Reset() { *x = PackageName{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PackageName) String() string { @@ -109,7 +104,7 @@ func (*PackageName) ProtoMessage() {} func (x *PackageName) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -132,23 +127,20 @@ func (x *PackageName) GetName() string { } type Package struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Channels []*Channel `protobuf:"bytes,2,rep,name=channels,proto3" json:"channels,omitempty"` - DefaultChannelName string `protobuf:"bytes,3,opt,name=defaultChannelName,proto3" json:"defaultChannelName,omitempty"` - Deprecation *Deprecation `protobuf:"bytes,4,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Channels []*Channel `protobuf:"bytes,2,rep,name=channels,proto3" json:"channels,omitempty"` + DefaultChannelName string `protobuf:"bytes,3,opt,name=defaultChannelName,proto3" json:"defaultChannelName,omitempty"` + Deprecation *Deprecation `protobuf:"bytes,4,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Package) Reset() { *x = Package{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Package) String() string { @@ -159,7 +151,7 @@ func (*Package) ProtoMessage() {} func (x *Package) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -203,23 +195,20 @@ func (x *Package) GetDeprecation() *Deprecation { } type GroupVersionKind struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GroupVersionKind) Reset() { *x = GroupVersionKind{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GroupVersionKind) String() string { @@ -230,7 +219,7 @@ func (*GroupVersionKind) ProtoMessage() {} func (x *GroupVersionKind) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -274,21 +263,18 @@ func (x *GroupVersionKind) GetPlural() string { } type Dependency struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Dependency) Reset() { *x = Dependency{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Dependency) String() string { @@ -299,7 +285,7 @@ func (*Dependency) ProtoMessage() {} func (x *Dependency) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -329,21 +315,18 @@ func (x *Dependency) GetValue() string { } type Property struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Property) Reset() { *x = Property{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Property) String() string { @@ -354,7 +337,7 @@ func (*Property) ProtoMessage() {} func (x *Property) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -384,34 +367,31 @@ func (x *Property) GetValue() string { } type Bundle struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + PackageName string `protobuf:"bytes,2,opt,name=packageName,proto3" json:"packageName,omitempty"` + ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` + CsvJson string `protobuf:"bytes,4,opt,name=csvJson,proto3" json:"csvJson,omitempty"` + Object []string `protobuf:"bytes,5,rep,name=object,proto3" json:"object,omitempty"` + BundlePath string `protobuf:"bytes,6,opt,name=bundlePath,proto3" json:"bundlePath,omitempty"` + ProvidedApis []*GroupVersionKind `protobuf:"bytes,7,rep,name=providedApis,proto3" json:"providedApis,omitempty"` + RequiredApis []*GroupVersionKind `protobuf:"bytes,8,rep,name=requiredApis,proto3" json:"requiredApis,omitempty"` + Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` + SkipRange string `protobuf:"bytes,10,opt,name=skipRange,proto3" json:"skipRange,omitempty"` + Dependencies []*Dependency `protobuf:"bytes,11,rep,name=dependencies,proto3" json:"dependencies,omitempty"` + Properties []*Property `protobuf:"bytes,12,rep,name=properties,proto3" json:"properties,omitempty"` + Replaces string `protobuf:"bytes,13,opt,name=replaces,proto3" json:"replaces,omitempty"` + Skips []string `protobuf:"bytes,14,rep,name=skips,proto3" json:"skips,omitempty"` + Deprecation *Deprecation `protobuf:"bytes,15,opt,name=deprecation,proto3" json:"deprecation,omitempty"` unknownFields protoimpl.UnknownFields - - CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` - PackageName string `protobuf:"bytes,2,opt,name=packageName,proto3" json:"packageName,omitempty"` - ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` - CsvJson string `protobuf:"bytes,4,opt,name=csvJson,proto3" json:"csvJson,omitempty"` - Object []string `protobuf:"bytes,5,rep,name=object,proto3" json:"object,omitempty"` - BundlePath string `protobuf:"bytes,6,opt,name=bundlePath,proto3" json:"bundlePath,omitempty"` - ProvidedApis []*GroupVersionKind `protobuf:"bytes,7,rep,name=providedApis,proto3" json:"providedApis,omitempty"` - RequiredApis []*GroupVersionKind `protobuf:"bytes,8,rep,name=requiredApis,proto3" json:"requiredApis,omitempty"` - Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` - SkipRange string `protobuf:"bytes,10,opt,name=skipRange,proto3" json:"skipRange,omitempty"` - Dependencies []*Dependency `protobuf:"bytes,11,rep,name=dependencies,proto3" json:"dependencies,omitempty"` - Properties []*Property `protobuf:"bytes,12,rep,name=properties,proto3" json:"properties,omitempty"` - Replaces string `protobuf:"bytes,13,opt,name=replaces,proto3" json:"replaces,omitempty"` - Skips []string `protobuf:"bytes,14,rep,name=skips,proto3" json:"skips,omitempty"` - Deprecation *Deprecation `protobuf:"bytes,15,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Bundle) Reset() { *x = Bundle{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Bundle) String() string { @@ -422,7 +402,7 @@ func (*Bundle) ProtoMessage() {} func (x *Bundle) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -543,23 +523,20 @@ func (x *Bundle) GetDeprecation() *Deprecation { } type ChannelEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PackageName string `protobuf:"bytes,1,opt,name=packageName,proto3" json:"packageName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + BundleName string `protobuf:"bytes,3,opt,name=bundleName,proto3" json:"bundleName,omitempty"` + Replaces string `protobuf:"bytes,4,opt,name=replaces,proto3" json:"replaces,omitempty"` unknownFields protoimpl.UnknownFields - - PackageName string `protobuf:"bytes,1,opt,name=packageName,proto3" json:"packageName,omitempty"` - ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` - BundleName string `protobuf:"bytes,3,opt,name=bundleName,proto3" json:"bundleName,omitempty"` - Replaces string `protobuf:"bytes,4,opt,name=replaces,proto3" json:"replaces,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ChannelEntry) Reset() { *x = ChannelEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ChannelEntry) String() string { @@ -570,7 +547,7 @@ func (*ChannelEntry) ProtoMessage() {} func (x *ChannelEntry) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -614,18 +591,16 @@ func (x *ChannelEntry) GetReplaces() string { } type ListPackageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListPackageRequest) Reset() { *x = ListPackageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListPackageRequest) String() string { @@ -636,7 +611,7 @@ func (*ListPackageRequest) ProtoMessage() {} func (x *ListPackageRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -652,18 +627,16 @@ func (*ListPackageRequest) Descriptor() ([]byte, []int) { } type ListBundlesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListBundlesRequest) Reset() { *x = ListBundlesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListBundlesRequest) String() string { @@ -674,7 +647,7 @@ func (*ListBundlesRequest) ProtoMessage() {} func (x *ListBundlesRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -690,20 +663,17 @@ func (*ListBundlesRequest) Descriptor() ([]byte, []int) { } type GetPackageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetPackageRequest) Reset() { *x = GetPackageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetPackageRequest) String() string { @@ -714,7 +684,7 @@ func (*GetPackageRequest) ProtoMessage() {} func (x *GetPackageRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -737,22 +707,19 @@ func (x *GetPackageRequest) GetName() string { } type GetBundleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + CsvName string `protobuf:"bytes,3,opt,name=csvName,proto3" json:"csvName,omitempty"` unknownFields protoimpl.UnknownFields - - PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` - ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` - CsvName string `protobuf:"bytes,3,opt,name=csvName,proto3" json:"csvName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetBundleRequest) Reset() { *x = GetBundleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBundleRequest) String() string { @@ -763,7 +730,7 @@ func (*GetBundleRequest) ProtoMessage() {} func (x *GetBundleRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -800,21 +767,18 @@ func (x *GetBundleRequest) GetCsvName() string { } type GetBundleInChannelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` unknownFields protoimpl.UnknownFields - - PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` - ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetBundleInChannelRequest) Reset() { *x = GetBundleInChannelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBundleInChannelRequest) String() string { @@ -825,7 +789,7 @@ func (*GetBundleInChannelRequest) ProtoMessage() {} func (x *GetBundleInChannelRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -855,20 +819,17 @@ func (x *GetBundleInChannelRequest) GetChannelName() string { } type GetAllReplacementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` unknownFields protoimpl.UnknownFields - - CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetAllReplacementsRequest) Reset() { *x = GetAllReplacementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAllReplacementsRequest) String() string { @@ -879,7 +840,7 @@ func (*GetAllReplacementsRequest) ProtoMessage() {} func (x *GetAllReplacementsRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -902,22 +863,19 @@ func (x *GetAllReplacementsRequest) GetCsvName() string { } type GetReplacementRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + PkgName string `protobuf:"bytes,2,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` unknownFields protoimpl.UnknownFields - - CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` - PkgName string `protobuf:"bytes,2,opt,name=pkgName,proto3" json:"pkgName,omitempty"` - ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetReplacementRequest) Reset() { *x = GetReplacementRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetReplacementRequest) String() string { @@ -928,7 +886,7 @@ func (*GetReplacementRequest) ProtoMessage() {} func (x *GetReplacementRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -965,23 +923,20 @@ func (x *GetReplacementRequest) GetChannelName() string { } type GetAllProvidersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetAllProvidersRequest) Reset() { *x = GetAllProvidersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAllProvidersRequest) String() string { @@ -992,7 +947,7 @@ func (*GetAllProvidersRequest) ProtoMessage() {} func (x *GetAllProvidersRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1036,23 +991,20 @@ func (x *GetAllProvidersRequest) GetPlural() string { } type GetLatestProvidersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetLatestProvidersRequest) Reset() { *x = GetLatestProvidersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetLatestProvidersRequest) String() string { @@ -1063,7 +1015,7 @@ func (*GetLatestProvidersRequest) ProtoMessage() {} func (x *GetLatestProvidersRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1107,23 +1059,20 @@ func (x *GetLatestProvidersRequest) GetPlural() string { } type GetDefaultProviderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetDefaultProviderRequest) Reset() { *x = GetDefaultProviderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetDefaultProviderRequest) String() string { @@ -1134,7 +1083,7 @@ func (*GetDefaultProviderRequest) ProtoMessage() {} func (x *GetDefaultProviderRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1178,20 +1127,17 @@ func (x *GetDefaultProviderRequest) GetPlural() string { } type Deprecation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields - - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Deprecation) Reset() { *x = Deprecation{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Deprecation) String() string { @@ -1202,7 +1148,7 @@ func (*Deprecation) ProtoMessage() {} func (x *Deprecation) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1224,223 +1170,200 @@ func (x *Deprecation) GetMessage() string { return "" } -var File_registry_proto protoreflect.FileDescriptor +type ListPackageCustomSchemasRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Schema string `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` + PackageName string `protobuf:"bytes,2,opt,name=packageName,proto3" json:"packageName,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} -var file_registry_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x03, 0x61, 0x70, 0x69, 0x22, 0x6b, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, - 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x21, 0x0a, 0x0b, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x07, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, - 0x2e, 0x0a, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x32, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x6e, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, - 0x72, 0x61, 0x6c, 0x22, 0x36, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x34, 0x0a, 0x08, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0xb0, 0x04, 0x0a, 0x06, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, - 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, - 0x76, 0x4a, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, - 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, - 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x39, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x41, 0x70, 0x69, 0x73, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x64, 0x41, 0x70, 0x69, 0x73, 0x12, 0x39, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x69, - 0x72, 0x65, 0x64, 0x41, 0x70, 0x69, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x41, 0x70, - 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x6b, 0x69, 0x70, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x6b, 0x69, 0x70, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, - 0x2d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x0c, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, - 0x69, 0x70, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x6b, 0x69, 0x70, 0x73, - 0x12, 0x32, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, - 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, - 0x6c, 0x61, 0x63, 0x65, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4c, - 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x68, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, - 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, - 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x57, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x49, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x35, 0x0a, - 0x19, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, - 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x6d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0x74, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x22, 0x77, 0x0a, 0x19, 0x47, 0x65, 0x74, - 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, - 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x72, - 0x61, 0x6c, 0x22, 0x77, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, - 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x22, 0x27, 0x0a, 0x0b, 0x44, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x32, 0xcf, 0x05, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x12, 0x3d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x73, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x00, 0x30, 0x01, - 0x12, 0x34, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x16, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x13, 0x47, 0x65, 0x74, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x49, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x03, 0x88, - 0x02, 0x01, 0x12, 0x55, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x54, 0x68, 0x61, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x00, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x15, 0x47, 0x65, 0x74, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x61, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, - 0x1c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x54, 0x68, 0x61, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x12, 0x1b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x00, 0x30, - 0x01, 0x12, 0x5b, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x54, 0x68, 0x61, 0x74, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x00, 0x30, 0x01, 0x12, 0x4d, - 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x54, 0x68, 0x61, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, 0x12, 0x1e, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x61, 0x70, 0x69, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +func (x *ListPackageCustomSchemasRequest) Reset() { + *x = ListPackageCustomSchemasRequest{} + mi := &file_registry_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPackageCustomSchemasRequest) String() string { + return protoimpl.X.MessageStringOf(x) } +func (*ListPackageCustomSchemasRequest) ProtoMessage() {} + +func (x *ListPackageCustomSchemasRequest) ProtoReflect() protoreflect.Message { + mi := &file_registry_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPackageCustomSchemasRequest.ProtoReflect.Descriptor instead. +func (*ListPackageCustomSchemasRequest) Descriptor() ([]byte, []int) { + return file_registry_proto_rawDescGZIP(), []int{19} +} + +func (x *ListPackageCustomSchemasRequest) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + +func (x *ListPackageCustomSchemasRequest) GetPackageName() string { + if x != nil { + return x.PackageName + } + return "" +} + +var File_registry_proto protoreflect.FileDescriptor + +const file_registry_proto_rawDesc = "" + + "\n" + + "\x0eregistry.proto\x12\x03api\x1a\x1cgoogle/protobuf/struct.proto\"k\n" + + "\aChannel\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\acsvName\x18\x02 \x01(\tR\acsvName\x122\n" + + "\vdeprecation\x18\x03 \x01(\v2\x10.api.DeprecationR\vdeprecation\"!\n" + + "\vPackageName\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"\xab\x01\n" + + "\aPackage\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12(\n" + + "\bchannels\x18\x02 \x03(\v2\f.api.ChannelR\bchannels\x12.\n" + + "\x12defaultChannelName\x18\x03 \x01(\tR\x12defaultChannelName\x122\n" + + "\vdeprecation\x18\x04 \x01(\v2\x10.api.DeprecationR\vdeprecation\"n\n" + + "\x10GroupVersionKind\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"6\n" + + "\n" + + "Dependency\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"4\n" + + "\bProperty\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"\xb0\x04\n" + + "\x06Bundle\x12\x18\n" + + "\acsvName\x18\x01 \x01(\tR\acsvName\x12 \n" + + "\vpackageName\x18\x02 \x01(\tR\vpackageName\x12 \n" + + "\vchannelName\x18\x03 \x01(\tR\vchannelName\x12\x18\n" + + "\acsvJson\x18\x04 \x01(\tR\acsvJson\x12\x16\n" + + "\x06object\x18\x05 \x03(\tR\x06object\x12\x1e\n" + + "\n" + + "bundlePath\x18\x06 \x01(\tR\n" + + "bundlePath\x129\n" + + "\fprovidedApis\x18\a \x03(\v2\x15.api.GroupVersionKindR\fprovidedApis\x129\n" + + "\frequiredApis\x18\b \x03(\v2\x15.api.GroupVersionKindR\frequiredApis\x12\x18\n" + + "\aversion\x18\t \x01(\tR\aversion\x12\x1c\n" + + "\tskipRange\x18\n" + + " \x01(\tR\tskipRange\x123\n" + + "\fdependencies\x18\v \x03(\v2\x0f.api.DependencyR\fdependencies\x12-\n" + + "\n" + + "properties\x18\f \x03(\v2\r.api.PropertyR\n" + + "properties\x12\x1a\n" + + "\breplaces\x18\r \x01(\tR\breplaces\x12\x14\n" + + "\x05skips\x18\x0e \x03(\tR\x05skips\x122\n" + + "\vdeprecation\x18\x0f \x01(\v2\x10.api.DeprecationR\vdeprecation\"\x8e\x01\n" + + "\fChannelEntry\x12 \n" + + "\vpackageName\x18\x01 \x01(\tR\vpackageName\x12 \n" + + "\vchannelName\x18\x02 \x01(\tR\vchannelName\x12\x1e\n" + + "\n" + + "bundleName\x18\x03 \x01(\tR\n" + + "bundleName\x12\x1a\n" + + "\breplaces\x18\x04 \x01(\tR\breplaces\"\x14\n" + + "\x12ListPackageRequest\"\x14\n" + + "\x12ListBundlesRequest\"'\n" + + "\x11GetPackageRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"h\n" + + "\x10GetBundleRequest\x12\x18\n" + + "\apkgName\x18\x01 \x01(\tR\apkgName\x12 \n" + + "\vchannelName\x18\x02 \x01(\tR\vchannelName\x12\x18\n" + + "\acsvName\x18\x03 \x01(\tR\acsvName\"W\n" + + "\x19GetBundleInChannelRequest\x12\x18\n" + + "\apkgName\x18\x01 \x01(\tR\apkgName\x12 \n" + + "\vchannelName\x18\x02 \x01(\tR\vchannelName\"5\n" + + "\x19GetAllReplacementsRequest\x12\x18\n" + + "\acsvName\x18\x01 \x01(\tR\acsvName\"m\n" + + "\x15GetReplacementRequest\x12\x18\n" + + "\acsvName\x18\x01 \x01(\tR\acsvName\x12\x18\n" + + "\apkgName\x18\x02 \x01(\tR\apkgName\x12 \n" + + "\vchannelName\x18\x03 \x01(\tR\vchannelName\"t\n" + + "\x16GetAllProvidersRequest\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"w\n" + + "\x19GetLatestProvidersRequest\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"w\n" + + "\x19GetDefaultProviderRequest\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"'\n" + + "\vDeprecation\x12\x18\n" + + "\amessage\x18\x01 \x01(\tR\amessage\"[\n" + + "\x1fListPackageCustomSchemasRequest\x12\x16\n" + + "\x06schema\x18\x01 \x01(\tR\x06schema\x12 \n" + + "\vpackageName\x18\x02 \x01(\tR\vpackageName2\xae\x06\n" + + "\bRegistry\x12=\n" + + "\fListPackages\x12\x17.api.ListPackageRequest\x1a\x10.api.PackageName\"\x000\x01\x124\n" + + "\n" + + "GetPackage\x12\x16.api.GetPackageRequest\x1a\f.api.Package\"\x00\x121\n" + + "\tGetBundle\x12\x15.api.GetBundleRequest\x1a\v.api.Bundle\"\x00\x12G\n" + + "\x13GetBundleForChannel\x12\x1e.api.GetBundleInChannelRequest\x1a\v.api.Bundle\"\x03\x88\x02\x01\x12U\n" + + "\x1cGetChannelEntriesThatReplace\x12\x1e.api.GetAllReplacementsRequest\x1a\x11.api.ChannelEntry\"\x000\x01\x12B\n" + + "\x15GetBundleThatReplaces\x12\x1a.api.GetReplacementRequest\x1a\v.api.Bundle\"\x00\x12R\n" + + "\x1cGetChannelEntriesThatProvide\x12\x1b.api.GetAllProvidersRequest\x1a\x11.api.ChannelEntry\"\x000\x01\x12[\n" + + "\"GetLatestChannelEntriesThatProvide\x12\x1e.api.GetLatestProvidersRequest\x1a\x11.api.ChannelEntry\"\x000\x01\x12M\n" + + "\x1cGetDefaultBundleThatProvides\x12\x1e.api.GetDefaultProviderRequest\x1a\v.api.Bundle\"\x00\x127\n" + + "\vListBundles\x12\x17.api.ListBundlesRequest\x1a\v.api.Bundle\"\x000\x01\x12]\n" + + "\x18ListPackageCustomSchemas\x12$.api.ListPackageCustomSchemasRequest\x1a\x17.google.protobuf.Struct\"\x000\x01B\aZ\x05.;apib\x06proto3" + var ( file_registry_proto_rawDescOnce sync.Once - file_registry_proto_rawDescData = file_registry_proto_rawDesc + file_registry_proto_rawDescData []byte ) func file_registry_proto_rawDescGZIP() []byte { file_registry_proto_rawDescOnce.Do(func() { - file_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_registry_proto_rawDescData) + file_registry_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_registry_proto_rawDesc), len(file_registry_proto_rawDesc))) }) return file_registry_proto_rawDescData } -var file_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_registry_proto_goTypes = []interface{}{ - (*Channel)(nil), // 0: api.Channel - (*PackageName)(nil), // 1: api.PackageName - (*Package)(nil), // 2: api.Package - (*GroupVersionKind)(nil), // 3: api.GroupVersionKind - (*Dependency)(nil), // 4: api.Dependency - (*Property)(nil), // 5: api.Property - (*Bundle)(nil), // 6: api.Bundle - (*ChannelEntry)(nil), // 7: api.ChannelEntry - (*ListPackageRequest)(nil), // 8: api.ListPackageRequest - (*ListBundlesRequest)(nil), // 9: api.ListBundlesRequest - (*GetPackageRequest)(nil), // 10: api.GetPackageRequest - (*GetBundleRequest)(nil), // 11: api.GetBundleRequest - (*GetBundleInChannelRequest)(nil), // 12: api.GetBundleInChannelRequest - (*GetAllReplacementsRequest)(nil), // 13: api.GetAllReplacementsRequest - (*GetReplacementRequest)(nil), // 14: api.GetReplacementRequest - (*GetAllProvidersRequest)(nil), // 15: api.GetAllProvidersRequest - (*GetLatestProvidersRequest)(nil), // 16: api.GetLatestProvidersRequest - (*GetDefaultProviderRequest)(nil), // 17: api.GetDefaultProviderRequest - (*Deprecation)(nil), // 18: api.Deprecation +var file_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_registry_proto_goTypes = []any{ + (*Channel)(nil), // 0: api.Channel + (*PackageName)(nil), // 1: api.PackageName + (*Package)(nil), // 2: api.Package + (*GroupVersionKind)(nil), // 3: api.GroupVersionKind + (*Dependency)(nil), // 4: api.Dependency + (*Property)(nil), // 5: api.Property + (*Bundle)(nil), // 6: api.Bundle + (*ChannelEntry)(nil), // 7: api.ChannelEntry + (*ListPackageRequest)(nil), // 8: api.ListPackageRequest + (*ListBundlesRequest)(nil), // 9: api.ListBundlesRequest + (*GetPackageRequest)(nil), // 10: api.GetPackageRequest + (*GetBundleRequest)(nil), // 11: api.GetBundleRequest + (*GetBundleInChannelRequest)(nil), // 12: api.GetBundleInChannelRequest + (*GetAllReplacementsRequest)(nil), // 13: api.GetAllReplacementsRequest + (*GetReplacementRequest)(nil), // 14: api.GetReplacementRequest + (*GetAllProvidersRequest)(nil), // 15: api.GetAllProvidersRequest + (*GetLatestProvidersRequest)(nil), // 16: api.GetLatestProvidersRequest + (*GetDefaultProviderRequest)(nil), // 17: api.GetDefaultProviderRequest + (*Deprecation)(nil), // 18: api.Deprecation + (*ListPackageCustomSchemasRequest)(nil), // 19: api.ListPackageCustomSchemasRequest + (*structpb.Struct)(nil), // 20: google.protobuf.Struct } var file_registry_proto_depIdxs = []int32{ 18, // 0: api.Channel.deprecation:type_name -> api.Deprecation @@ -1461,18 +1384,20 @@ var file_registry_proto_depIdxs = []int32{ 16, // 15: api.Registry.GetLatestChannelEntriesThatProvide:input_type -> api.GetLatestProvidersRequest 17, // 16: api.Registry.GetDefaultBundleThatProvides:input_type -> api.GetDefaultProviderRequest 9, // 17: api.Registry.ListBundles:input_type -> api.ListBundlesRequest - 1, // 18: api.Registry.ListPackages:output_type -> api.PackageName - 2, // 19: api.Registry.GetPackage:output_type -> api.Package - 6, // 20: api.Registry.GetBundle:output_type -> api.Bundle - 6, // 21: api.Registry.GetBundleForChannel:output_type -> api.Bundle - 7, // 22: api.Registry.GetChannelEntriesThatReplace:output_type -> api.ChannelEntry - 6, // 23: api.Registry.GetBundleThatReplaces:output_type -> api.Bundle - 7, // 24: api.Registry.GetChannelEntriesThatProvide:output_type -> api.ChannelEntry - 7, // 25: api.Registry.GetLatestChannelEntriesThatProvide:output_type -> api.ChannelEntry - 6, // 26: api.Registry.GetDefaultBundleThatProvides:output_type -> api.Bundle - 6, // 27: api.Registry.ListBundles:output_type -> api.Bundle - 18, // [18:28] is the sub-list for method output_type - 8, // [8:18] is the sub-list for method input_type + 19, // 18: api.Registry.ListPackageCustomSchemas:input_type -> api.ListPackageCustomSchemasRequest + 1, // 19: api.Registry.ListPackages:output_type -> api.PackageName + 2, // 20: api.Registry.GetPackage:output_type -> api.Package + 6, // 21: api.Registry.GetBundle:output_type -> api.Bundle + 6, // 22: api.Registry.GetBundleForChannel:output_type -> api.Bundle + 7, // 23: api.Registry.GetChannelEntriesThatReplace:output_type -> api.ChannelEntry + 6, // 24: api.Registry.GetBundleThatReplaces:output_type -> api.Bundle + 7, // 25: api.Registry.GetChannelEntriesThatProvide:output_type -> api.ChannelEntry + 7, // 26: api.Registry.GetLatestChannelEntriesThatProvide:output_type -> api.ChannelEntry + 6, // 27: api.Registry.GetDefaultBundleThatProvides:output_type -> api.Bundle + 6, // 28: api.Registry.ListBundles:output_type -> api.Bundle + 20, // 29: api.Registry.ListPackageCustomSchemas:output_type -> google.protobuf.Struct + 19, // [19:30] is the sub-list for method output_type + 8, // [8:19] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name 8, // [8:8] is the sub-list for extension extendee 0, // [0:8] is the sub-list for field type_name @@ -1483,243 +1408,13 @@ func file_registry_proto_init() { if File_registry_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Channel); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackageName); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Package); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupVersionKind); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Dependency); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Property); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bundle); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChannelEntry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPackageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBundlesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPackageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBundleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBundleInChannelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllReplacementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetReplacementRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllProvidersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestProvidersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDefaultProviderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Deprecation); 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_registry_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_registry_proto_rawDesc), len(file_registry_proto_rawDesc)), NumEnums: 0, - NumMessages: 19, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, @@ -1728,7 +1423,6 @@ func file_registry_proto_init() { MessageInfos: file_registry_proto_msgTypes, }.Build() File_registry_proto = out.File - file_registry_proto_rawDesc = nil file_registry_proto_goTypes = nil file_registry_proto_depIdxs = nil } diff --git a/staging/operator-registry/pkg/api/registry.proto b/staging/operator-registry/pkg/api/registry.proto index 5aa54a253b..8b8f82a6c3 100644 --- a/staging/operator-registry/pkg/api/registry.proto +++ b/staging/operator-registry/pkg/api/registry.proto @@ -2,6 +2,8 @@ syntax = "proto3"; option go_package = ".;api"; +import "google/protobuf/struct.proto"; + package api; service Registry { @@ -17,6 +19,7 @@ service Registry { rpc GetLatestChannelEntriesThatProvide(GetLatestProvidersRequest) returns (stream ChannelEntry) {} rpc GetDefaultBundleThatProvides(GetDefaultProviderRequest) returns (Bundle) {} rpc ListBundles(ListBundlesRequest) returns (stream Bundle) {} + rpc ListPackageCustomSchemas(ListPackageCustomSchemasRequest) returns (stream google.protobuf.Struct) {} } message Channel{ @@ -130,4 +133,10 @@ message GetDefaultProviderRequest{ message Deprecation{ string message = 1; -} \ No newline at end of file +} + +message ListPackageCustomSchemasRequest{ + string schema = 1; + string packageName = 2; +} + diff --git a/staging/operator-registry/pkg/api/registry_grpc.pb.go b/staging/operator-registry/pkg/api/registry_grpc.pb.go index b5a62b3dfb..336d44f124 100644 --- a/staging/operator-registry/pkg/api/registry_grpc.pb.go +++ b/staging/operator-registry/pkg/api/registry_grpc.pb.go @@ -11,6 +11,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + structpb "google.golang.org/protobuf/types/known/structpb" ) // This is a compile-time assertion to ensure that this generated file @@ -29,6 +30,7 @@ const ( Registry_GetLatestChannelEntriesThatProvide_FullMethodName = "/api.Registry/GetLatestChannelEntriesThatProvide" Registry_GetDefaultBundleThatProvides_FullMethodName = "/api.Registry/GetDefaultBundleThatProvides" Registry_ListBundles_FullMethodName = "/api.Registry/ListBundles" + Registry_ListPackageCustomSchemas_FullMethodName = "/api.Registry/ListPackageCustomSchemas" ) // RegistryClient is the client API for Registry service. @@ -46,6 +48,7 @@ type RegistryClient interface { GetLatestChannelEntriesThatProvide(ctx context.Context, in *GetLatestProvidersRequest, opts ...grpc.CallOption) (Registry_GetLatestChannelEntriesThatProvideClient, error) GetDefaultBundleThatProvides(ctx context.Context, in *GetDefaultProviderRequest, opts ...grpc.CallOption) (*Bundle, error) ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (Registry_ListBundlesClient, error) + ListPackageCustomSchemas(ctx context.Context, in *ListPackageCustomSchemasRequest, opts ...grpc.CallOption) (Registry_ListPackageCustomSchemasClient, error) } type registryClient struct { @@ -262,6 +265,38 @@ func (x *registryListBundlesClient) Recv() (*Bundle, error) { return m, nil } +func (c *registryClient) ListPackageCustomSchemas(ctx context.Context, in *ListPackageCustomSchemasRequest, opts ...grpc.CallOption) (Registry_ListPackageCustomSchemasClient, error) { + stream, err := c.cc.NewStream(ctx, &Registry_ServiceDesc.Streams[5], Registry_ListPackageCustomSchemas_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := ®istryListPackageCustomSchemasClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Registry_ListPackageCustomSchemasClient interface { + Recv() (*structpb.Struct, error) + grpc.ClientStream +} + +type registryListPackageCustomSchemasClient struct { + grpc.ClientStream +} + +func (x *registryListPackageCustomSchemasClient) Recv() (*structpb.Struct, error) { + m := new(structpb.Struct) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // RegistryServer is the server API for Registry service. // All implementations must embed UnimplementedRegistryServer // for forward compatibility @@ -277,6 +312,7 @@ type RegistryServer interface { GetLatestChannelEntriesThatProvide(*GetLatestProvidersRequest, Registry_GetLatestChannelEntriesThatProvideServer) error GetDefaultBundleThatProvides(context.Context, *GetDefaultProviderRequest) (*Bundle, error) ListBundles(*ListBundlesRequest, Registry_ListBundlesServer) error + ListPackageCustomSchemas(*ListPackageCustomSchemasRequest, Registry_ListPackageCustomSchemasServer) error mustEmbedUnimplementedRegistryServer() } @@ -314,6 +350,9 @@ func (UnimplementedRegistryServer) GetDefaultBundleThatProvides(context.Context, func (UnimplementedRegistryServer) ListBundles(*ListBundlesRequest, Registry_ListBundlesServer) error { return status.Errorf(codes.Unimplemented, "method ListBundles not implemented") } +func (UnimplementedRegistryServer) ListPackageCustomSchemas(*ListPackageCustomSchemasRequest, Registry_ListPackageCustomSchemasServer) error { + return status.Errorf(codes.Unimplemented, "method ListPackageCustomSchemas not implemented") +} func (UnimplementedRegistryServer) mustEmbedUnimplementedRegistryServer() {} // UnsafeRegistryServer may be embedded to opt out of forward compatibility for this service. @@ -522,6 +561,27 @@ func (x *registryListBundlesServer) Send(m *Bundle) error { return x.ServerStream.SendMsg(m) } +func _Registry_ListPackageCustomSchemas_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListPackageCustomSchemasRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RegistryServer).ListPackageCustomSchemas(m, ®istryListPackageCustomSchemasServer{stream}) +} + +type Registry_ListPackageCustomSchemasServer interface { + Send(*structpb.Struct) error + grpc.ServerStream +} + +type registryListPackageCustomSchemasServer struct { + grpc.ServerStream +} + +func (x *registryListPackageCustomSchemasServer) Send(m *structpb.Struct) error { + return x.ServerStream.SendMsg(m) +} + // Registry_ServiceDesc is the grpc.ServiceDesc for Registry service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -576,6 +636,11 @@ var Registry_ServiceDesc = grpc.ServiceDesc{ Handler: _Registry_ListBundles_Handler, ServerStreams: true, }, + { + StreamName: "ListPackageCustomSchemas", + Handler: _Registry_ListPackageCustomSchemas_Handler, + ServerStreams: true, + }, }, Metadata: "registry.proto", } diff --git a/staging/operator-registry/pkg/cache/cache.go b/staging/operator-registry/pkg/cache/cache.go index a02297b36d..7e3baf4a89 100644 --- a/staging/operator-registry/pkg/cache/cache.go +++ b/staging/operator-registry/pkg/cache/cache.go @@ -28,6 +28,8 @@ type Cache interface { Build(ctx context.Context, fbc fs.FS) error Load(ctc context.Context) error Close() error + + ListPackageCustomSchemas(ctx context.Context, schema, packageName string, sender func([]byte) error) error } type backend interface { @@ -45,6 +47,9 @@ type backend interface { GetBundle(context.Context, bundleKey) (*api.Bundle, error) PutBundle(context.Context, bundleKey, *api.Bundle) error + PutMeta(context.Context, metaKey, []byte) error + SendMetas(context.Context, metaKey, func([]byte) error) error + GetDigest(context.Context) (string, error) ComputeDigest(context.Context, fs.FS) (string, error) PutDigest(context.Context, string) error @@ -237,6 +242,14 @@ func (c *cache) GetBundleThatProvides(ctx context.Context, group, version, kind return c.packageIndex.GetBundleThatProvides(ctx, c, group, version, kind) } +func (c *cache) ListPackageCustomSchemas(ctx context.Context, schema, packageName string, sender func([]byte) error) error { + mk, err := newValidatedMetaKey(schema, packageName) + if err != nil { + return fmt.Errorf("invalid custom schema query: %w", err) + } + return c.backend.SendMetas(ctx, mk, sender) +} + func (c *cache) CheckIntegrity(ctx context.Context, fbc fs.FS) error { existingDigest, err := c.backend.GetDigest(ctx) if err != nil { @@ -290,6 +303,21 @@ func (c *cache) Build(ctx context.Context, fbcFsys fs.FS) error { walkMu.Lock() defer walkMu.Unlock() + + switch meta.Schema { + case declcfg.SchemaPackage, declcfg.SchemaChannel, declcfg.SchemaBundle, declcfg.SchemaDeprecation: + default: + mk, err := newValidatedMetaKey(meta.Schema, packageName) + if err != nil { + return fmt.Errorf("invalid custom schema meta: %v", err) + } + if err := c.backend.PutMeta(ctx, mk, meta.Blob); err != nil { + return fmt.Errorf("store custom schema meta %v: %v", mk, err) + } + if packageName == "" { + return nil + } + } if _, err := tmpFile.Write(meta.Blob); err != nil { return err } diff --git a/staging/operator-registry/pkg/cache/cache_test.go b/staging/operator-registry/pkg/cache/cache_test.go index 8c35a58f90..58a09d7457 100644 --- a/staging/operator-registry/pkg/cache/cache_test.go +++ b/staging/operator-registry/pkg/cache/cache_test.go @@ -219,6 +219,163 @@ func TestCache_ListPackages(t *testing.T) { } } +var customSchemaFS = fstest.MapFS{ + ".": &fstest.MapFile{ + Mode: fs.ModeDir, + }, + "catalog.json": &fstest.MapFile{ + Data: []byte(`{ + "schema": "olm.package", + "name": "testpkg", + "defaultChannel": "stable" +} +{ + "schema": "olm.channel", + "package": "testpkg", + "name": "stable", + "entries": [{"name": "testpkg.v1.0.0"}] +} +{ + "schema": "olm.bundle", + "name": "testpkg.v1.0.0", + "package": "testpkg", + "image": "quay.io/test/testpkg:v1.0.0", + "properties": [{"type": "olm.package", "value": {"packageName": "testpkg", "version": "1.0.0"}}] +} +{ + "schema": "custom.operator.io", + "package": "testpkg", + "name": "my-custom-resource", + "customField": "customValue" +} +{ + "schema": "custom.operator.io", + "package": "testpkg", + "name": "another-custom-resource", + "data": {"key": "value"} +} +{ + "schema": "other.custom.schema", + "package": "testpkg", + "name": "other-custom", + "info": "test" +} +`), + }, +} + +func TestCache_ListPackageCustomSchemas(t *testing.T) { + for name, testCache := range genTestCaches(t, customSchemaFS) { + t.Run(name, func(t *testing.T) { + collect := func(schema, pkg string) []string { + t.Helper() + var blobs []string + err := testCache.ListPackageCustomSchemas(context.TODO(), schema, pkg, + func(blob []byte) error { + blobs = append(blobs, string(blob)) + return nil + }) + require.NoError(t, err) + return blobs + } + + // Multiple blobs for same (schema, package) + blobs := collect("custom.operator.io", "testpkg") + require.Len(t, blobs, 2) + + // Different schema + blobs = collect("other.custom.schema", "testpkg") + require.Len(t, blobs, 1) + require.Contains(t, blobs[0], `"info"`) + + // Nonexistent schema returns empty + blobs = collect("nonexistent.schema", "testpkg") + require.Empty(t, blobs) + + // Nonexistent package returns empty + blobs = collect("custom.operator.io", "nonexistent") + require.Empty(t, blobs) + }) + } +} + +func TestCache_ListPackageCustomSchemas_PackagelessBlob(t *testing.T) { + packagelessFS := fstest.MapFS{ + ".": &fstest.MapFile{ + Mode: fs.ModeDir, + }, + "catalog.json": &fstest.MapFile{ + Data: []byte(`{ + "schema": "olm.package", + "name": "testpkg", + "defaultChannel": "stable" +} +{ + "schema": "olm.channel", + "package": "testpkg", + "name": "stable", + "entries": [{"name": "testpkg.v1.0.0"}] +} +{ + "schema": "olm.bundle", + "name": "testpkg.v1.0.0", + "package": "testpkg", + "image": "quay.io/test/testpkg:v1.0.0", + "properties": [{"type": "olm.package", "value": {"packageName": "testpkg", "version": "1.0.0"}}] +} +{ + "schema": "custom.packageless", + "data": "no-package-blob" +} +`), + }, + } + for name, testCache := range genTestCaches(t, packagelessFS) { + t.Run(name, func(t *testing.T) { + // Querying with empty packageName returns packageless blobs + var blobs []string + err := testCache.ListPackageCustomSchemas(context.TODO(), "custom.packageless", "", + func(blob []byte) error { + blobs = append(blobs, string(blob)) + return nil + }) + require.NoError(t, err) + require.Len(t, blobs, 1) + require.Contains(t, blobs[0], `"no-package-blob"`) + + // Querying with a specific packageName does not return packageless blobs + var blobs2 []string + err = testCache.ListPackageCustomSchemas(context.TODO(), "custom.packageless", "testpkg", + func(blob []byte) error { + blobs2 = append(blobs2, string(blob)) + return nil + }) + require.NoError(t, err) + require.Empty(t, blobs2) + + // Packageless blobs must not leak into the package index + packages, err := testCache.ListPackages(context.TODO()) + require.NoError(t, err) + require.Equal(t, []string{"testpkg"}, packages) + }) + } +} + +func TestCache_ListPackageCustomSchemas_NoCustomSchemas(t *testing.T) { + for name, testCache := range genTestCaches(t, validFS) { + t.Run(name, func(t *testing.T) { + var blobs []string + err := testCache.ListPackageCustomSchemas(context.TODO(), "custom.operator.io", "cockroachdb", + func(blob []byte) error { + blobs = append(blobs, string(blob)) + return nil + }) + require.NoError(t, err) + require.Empty(t, blobs) + }) + } +} + func genTestCaches(t *testing.T, fbcFS fs.FS) map[string]Cache { t.Helper() diff --git a/staging/operator-registry/pkg/cache/json.go b/staging/operator-registry/pkg/cache/json.go index 92b17f7525..cfa600046b 100644 --- a/staging/operator-registry/pkg/cache/json.go +++ b/staging/operator-registry/pkg/cache/json.go @@ -101,6 +101,8 @@ func (q *jsonBackend) GetPackageIndex(_ context.Context) (packageIndex, error) { return pi, nil } +const jsonMetasDir = jsonDir + string(filepath.Separator) + "metas" + func (q *jsonBackend) PutPackageIndex(_ context.Context, pi packageIndex) error { packageJSON, err := json.Marshal(pi) if err != nil { @@ -140,6 +142,44 @@ func (q *jsonBackend) PutBundle(_ context.Context, key bundleKey, bundle *api.Bu return nil } +func (q *jsonBackend) metaDir(in metaKey) string { + return filepath.Join(q.baseDir, jsonMetasDir, in.Schema, in.PackageName) +} + +func (q *jsonBackend) PutMeta(_ context.Context, key metaKey, blob []byte) error { + dir := q.metaDir(key) + if err := os.MkdirAll(dir, jsonCacheModeDir); err != nil { + return err + } + h := fnv.New64a() + h.Write(blob) + return os.WriteFile(filepath.Join(dir, fmt.Sprintf("%x.json", h.Sum64())), blob, jsonCacheModeFile) +} + +func (q *jsonBackend) SendMetas(_ context.Context, key metaKey, sender func([]byte) error) error { + dir := q.metaDir(key) + entries, err := os.ReadDir(dir) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil + } + return err + } + for _, entry := range entries { + if entry.IsDir() || filepath.Ext(entry.Name()) != ".json" { + continue + } + data, err := os.ReadFile(filepath.Join(dir, entry.Name())) + if err != nil { + return err + } + if err := sender(data); err != nil { + return err + } + } + return nil +} + func (q *jsonBackend) GetDigest(_ context.Context) (string, error) { return readDigestFile(filepath.Join(q.baseDir, jsonDigestFile)) } diff --git a/staging/operator-registry/pkg/cache/meta_key.go b/staging/operator-registry/pkg/cache/meta_key.go new file mode 100644 index 0000000000..3a2233bbee --- /dev/null +++ b/staging/operator-registry/pkg/cache/meta_key.go @@ -0,0 +1,40 @@ +package cache + +import ( + "fmt" + "strings" +) + +type ValidationError struct { + Err error +} + +func (e *ValidationError) Error() string { return e.Err.Error() } +func (e *ValidationError) Unwrap() error { return e.Err } + +func validateMetaKeyComponent(name, value string) error { + if value == "" { + return &ValidationError{fmt.Errorf("invalid %s: must not be empty", name)} + } + if strings.ContainsAny(value, "/\\") || value == "." || value == ".." { + return &ValidationError{fmt.Errorf("invalid %s %q: must not contain path separators, '.', or '..'", name, value)} + } + return nil +} + +func newValidatedMetaKey(schema, packageName string) (metaKey, error) { + if err := validateMetaKeyComponent("schema", schema); err != nil { + return metaKey{}, err + } + if packageName != "" { + if err := validateMetaKeyComponent("packageName", packageName); err != nil { + return metaKey{}, err + } + } + return metaKey{Schema: schema, PackageName: packageName}, nil +} + +type metaKey struct { + Schema string + PackageName string +} diff --git a/staging/operator-registry/pkg/cache/meta_key_test.go b/staging/operator-registry/pkg/cache/meta_key_test.go new file mode 100644 index 0000000000..94dabfe050 --- /dev/null +++ b/staging/operator-registry/pkg/cache/meta_key_test.go @@ -0,0 +1,110 @@ +package cache + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestValidateMetaKeyComponent(t *testing.T) { + for _, tt := range []struct { + name string + value string + wantErr bool + }{ + {"valid simple", "my-schema", false}, + {"valid dotted", "custom.operator.io", false}, + {"empty", "", true}, + {"dot-dot", "..", true}, + {"dot-dot prefix", "../foo", true}, + {"dot-dot suffix", "foo/..", true}, + {"forward slash", "foo/bar", true}, + {"backslash", "foo\\bar", true}, + {"dot-dot-prefix no slash", "..foo", false}, + {"dot-dot-suffix no slash", "foo..", false}, + {"single dot", ".", true}, + } { + t.Run(tt.name, func(t *testing.T) { + err := validateMetaKeyComponent("test", tt.value) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestNewValidatedMetaKey(t *testing.T) { + for _, tt := range []struct { + name string + schema string + packageName string + wantErr bool + wantKey metaKey + }{ + { + name: "both populated", + schema: "custom.operator.io", + packageName: "testpkg", + wantKey: metaKey{Schema: "custom.operator.io", PackageName: "testpkg"}, + }, + { + name: "empty packageName allowed", + schema: "custom.operator.io", + packageName: "", + wantKey: metaKey{Schema: "custom.operator.io", PackageName: ""}, + }, + { + name: "empty schema rejected", + schema: "", + wantErr: true, + }, + { + name: "schema with slash rejected", + schema: "foo/bar", + packageName: "pkg", + wantErr: true, + }, + { + name: "packageName with slash rejected", + schema: "custom.io", + packageName: "foo/bar", + wantErr: true, + }, + { + name: "schema dot-dot rejected", + schema: "..", + packageName: "pkg", + wantErr: true, + }, + { + name: "packageName dot-dot rejected", + schema: "custom.io", + packageName: "..", + wantErr: true, + }, + { + name: "schema dot rejected", + schema: ".", + packageName: "pkg", + wantErr: true, + }, + { + name: "packageName dot rejected", + schema: "custom.io", + packageName: ".", + wantErr: true, + }, + } { + t.Run(tt.name, func(t *testing.T) { + got, err := newValidatedMetaKey(tt.schema, tt.packageName) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.wantKey, got) + } + }) + } +} diff --git a/staging/operator-registry/pkg/cache/pogrebv1.go b/staging/operator-registry/pkg/cache/pogrebv1.go index a590832cbb..8e6ea33db7 100644 --- a/staging/operator-registry/pkg/cache/pogrebv1.go +++ b/staging/operator-registry/pkg/cache/pogrebv1.go @@ -1,6 +1,7 @@ package cache import ( + "bytes" "context" "encoding/json" "errors" @@ -127,6 +128,8 @@ func (q *pogrebV1Backend) GetPackageIndex(_ context.Context) (packageIndex, erro return pi, nil } +const metaKeyPrefix = "metas/" + func (q *pogrebV1Backend) PutPackageIndex(_ context.Context, index packageIndex) error { packageJSON, err := json.Marshal(index) if err != nil { @@ -163,6 +166,39 @@ func (q *pogrebV1Backend) PutBundle(_ context.Context, key bundleKey, bundle *ap return nil } +func (q *pogrebV1Backend) metaDBKey(in metaKey, blob []byte) []byte { + h := fnv.New64a() + h.Write(blob) + return []byte(fmt.Sprintf("%s%s/%s/%x", metaKeyPrefix, in.Schema, in.PackageName, h.Sum64())) +} + +func (q *pogrebV1Backend) metaDBKeyPrefix(in metaKey) string { + return fmt.Sprintf("%s%s/%s/", metaKeyPrefix, in.Schema, in.PackageName) +} + +func (q *pogrebV1Backend) PutMeta(_ context.Context, key metaKey, blob []byte) error { + return q.db.Put(q.metaDBKey(key, blob), blob) +} + +func (q *pogrebV1Backend) SendMetas(_ context.Context, key metaKey, sender func([]byte) error) error { + prefix := []byte(q.metaDBKeyPrefix(key)) + it := q.db.Items() + for { + k, v, err := it.Next() + if errors.Is(err, pogreb.ErrIterationDone) { + return nil + } + if err != nil { + return err + } + if bytes.HasPrefix(k, prefix) { + if err := sender(v); err != nil { + return err + } + } + } +} + func (q *pogrebV1Backend) GetDigest(_ context.Context) (string, error) { return readDigestFile(filepath.Join(q.baseDir, pogrebDigestFile)) } diff --git a/staging/operator-registry/pkg/client/client_test.go b/staging/operator-registry/pkg/client/client_test.go index e214afafa9..ab89835d0a 100644 --- a/staging/operator-registry/pkg/client/client_test.go +++ b/staging/operator-registry/pkg/client/client_test.go @@ -65,6 +65,10 @@ func (s *RegistryClientStub) ListBundles(ctx context.Context, in *api.ListBundle return s.ListBundlesClient, s.Error } +func (s *RegistryClientStub) ListPackageCustomSchemas(ctx context.Context, in *api.ListPackageCustomSchemasRequest, opts ...grpc.CallOption) (api.Registry_ListPackageCustomSchemasClient, error) { + return nil, nil +} + func (s *RegistryClientStub) Check(ctx context.Context, in *grpc_health_v1.HealthCheckRequest, opts ...grpc.CallOption) (*grpc_health_v1.HealthCheckResponse, error) { return nil, nil } diff --git a/staging/operator-registry/pkg/server/server.go b/staging/operator-registry/pkg/server/server.go index 56b09e2258..91706f68c0 100644 --- a/staging/operator-registry/pkg/server/server.go +++ b/staging/operator-registry/pkg/server/server.go @@ -2,8 +2,15 @@ package server import ( "context" + "encoding/json" + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/structpb" "github.com/operator-framework/operator-registry/pkg/api" + fbccache "github.com/operator-framework/operator-registry/pkg/cache" "github.com/operator-framework/operator-registry/pkg/registry" ) @@ -98,3 +105,40 @@ func (s *RegistryServer) GetLatestChannelEntriesThatProvide(req *api.GetLatestPr func (s *RegistryServer) GetDefaultBundleThatProvides(ctx context.Context, req *api.GetDefaultProviderRequest) (*api.Bundle, error) { return s.store.GetBundleThatProvides(ctx, req.GetGroup(), req.GetVersion(), req.GetKind()) } + +func (s *RegistryServer) ListPackageCustomSchemas(req *api.ListPackageCustomSchemasRequest, stream api.Registry_ListPackageCustomSchemasServer) error { + schema, pkgName := req.GetSchema(), req.GetPackageName() + if schema == "" { + return status.Errorf(codes.InvalidArgument, "schema is required") + } + type customSchemaQuerier interface { + ListPackageCustomSchemas(ctx context.Context, schema, packageName string, sender func([]byte) error) error + } + mq, ok := s.store.(customSchemaQuerier) + if !ok { + return status.Errorf(codes.Unimplemented, "store does not support custom schema queries") + } + err := mq.ListPackageCustomSchemas(stream.Context(), schema, pkgName, + func(blob []byte) error { + var m map[string]interface{} + if err := json.Unmarshal(blob, &m); err != nil { + return status.Errorf(codes.Internal, "unmarshal custom schema blob: %v", err) + } + st, err := structpb.NewStruct(m) + if err != nil { + return status.Errorf(codes.Internal, "convert custom schema blob to struct: %v", err) + } + return stream.Send(st) + }) + if err != nil { + if _, ok := status.FromError(err); ok { + return err + } + var ve *fbccache.ValidationError + if errors.As(err, &ve) { + return status.Errorf(codes.InvalidArgument, "%v", err) + } + return status.Errorf(codes.Internal, "%v", err) + } + return nil +} diff --git a/staging/operator-registry/pkg/server/server_test.go b/staging/operator-registry/pkg/server/server_test.go index e74b941f97..dfb75774da 100644 --- a/staging/operator-registry/pkg/server/server_test.go +++ b/staging/operator-registry/pkg/server/server_test.go @@ -19,7 +19,9 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/status" "github.com/operator-framework/operator-registry/alpha/action" "github.com/operator-framework/operator-registry/alpha/declcfg" @@ -39,6 +41,9 @@ const ( deprecationCachePort = ":50054" deprecationCacheAddress = "localhost" + deprecationCachePort + + customSchemaCachePort = ":50055" + customSchemaCacheAddress = "localhost" + customSchemaCachePort ) func createDBStore(dbPath string) *sqlite.SQLQuerier { @@ -144,8 +149,14 @@ func TestMain(m *testing.M) { } fbcServerDeprecations := server(fbcDeprecationStore) + fbcCustomSchemaStore, err := fbcCacheFromFs(customSchemaFS, filepath.Join(tmpDir, "custom-schema-cache")) + if err != nil { + logrus.Fatalf("failed to create custom schema cache: %v", err) + } + fbcServerCustomSchemas := server(fbcCustomSchemaStore) + var wg sync.WaitGroup - wg.Add(3) + wg.Add(4) go func() { lis, err := net.Listen("tcp", fmt.Sprintf("localhost%s", dbPort)) if err != nil { @@ -176,6 +187,16 @@ func TestMain(m *testing.M) { logrus.Fatalf("failed to serve fbc cache: %v", err) } }() + go func() { + lis, err := net.Listen("tcp", customSchemaCacheAddress) + if err != nil { + logrus.Fatalf("failed to listen: %v", err) + } + wg.Done() + if err := fbcServerCustomSchemas.Serve(lis); err != nil { + logrus.Fatalf("failed to serve fbc custom schema cache: %v", err) + } + }() wg.Wait() exit := m.Run() os.Exit(exit) @@ -790,6 +811,108 @@ func testListBundles(addr string, etcdAlpha *api.Bundle, etcdStable *api.Bundle) } } +func TestListPackageCustomSchemas(t *testing.T) { + t.Run("FBCCacheWithCustomSchemas", testListPackageCustomSchemas(customSchemaCacheAddress)) + t.Run("FBCCacheNoResults", testListPackageCustomSchemasEmpty(cacheAddress)) + t.Run("FBCCacheInvalidArgument", testListPackageCustomSchemasInvalidArgument(customSchemaCacheAddress)) + t.Run("FBCCachePackageless", testListPackageCustomSchemasPackageless(customSchemaCacheAddress)) +} + +func testListPackageCustomSchemas(addr string) func(*testing.T) { + return func(t *testing.T) { + c, conn := client(t, addr) + defer conn.Close() + + stream, err := c.ListPackageCustomSchemas(context.TODO(), &api.ListPackageCustomSchemasRequest{ + Schema: "custom.operator.io", + PackageName: "testpkg", + }) + require.NoError(t, err) + + var results []map[string]interface{} + for { + s, err := stream.Recv() + if errors.Is(err, io.EOF) { + break + } + require.NoError(t, err) + results = append(results, s.AsMap()) + } + + require.Len(t, results, 2) + for _, r := range results { + require.Equal(t, "custom.operator.io", r["schema"]) + require.Equal(t, "testpkg", r["package"]) + } + } +} + +func testListPackageCustomSchemasEmpty(addr string) func(*testing.T) { + return func(t *testing.T) { + c, conn := client(t, addr) + defer conn.Close() + + stream, err := c.ListPackageCustomSchemas(context.TODO(), &api.ListPackageCustomSchemasRequest{ + Schema: "custom.operator.io", + PackageName: "nonexistent", + }) + require.NoError(t, err) + + count := 0 + for { + _, err := stream.Recv() + if errors.Is(err, io.EOF) { + break + } + require.NoError(t, err) + count++ + } + require.Zero(t, count) + } +} + +func testListPackageCustomSchemasPackageless(addr string) func(*testing.T) { + return func(t *testing.T) { + c, conn := client(t, addr) + defer conn.Close() + + stream, err := c.ListPackageCustomSchemas(context.TODO(), &api.ListPackageCustomSchemasRequest{ + Schema: "custom.packageless", + PackageName: "", + }) + require.NoError(t, err) + + var results []map[string]interface{} + for { + s, err := stream.Recv() + if errors.Is(err, io.EOF) { + break + } + require.NoError(t, err) + results = append(results, s.AsMap()) + } + + require.Len(t, results, 1) + require.Equal(t, "custom.packageless", results[0]["schema"]) + require.Equal(t, "global-config", results[0]["name"]) + } +} + +func testListPackageCustomSchemasInvalidArgument(addr string) func(*testing.T) { + return func(t *testing.T) { + c, conn := client(t, addr) + defer conn.Close() + + stream, err := c.ListPackageCustomSchemas(context.TODO(), &api.ListPackageCustomSchemasRequest{}) + require.NoError(t, err) + _, err = stream.Recv() + require.Error(t, err) + st, ok := status.FromError(err) + require.True(t, ok) + require.Equal(t, codes.InvalidArgument, st.Code()) + } +} + func EqualBundles(t *testing.T, expected, actual api.Bundle) { t.Helper() stripPlural(actual.ProvidedApis) @@ -1067,4 +1190,45 @@ entries: "cockroachdb.json": cockroachdb, "deprecations.yaml": deprecations, } + + customSchemaFS = fstest.MapFS{ + "catalog.json": &fstest.MapFile{ + Data: []byte(`{ + "schema": "olm.package", + "name": "testpkg", + "defaultChannel": "stable" +} +{ + "schema": "olm.channel", + "package": "testpkg", + "name": "stable", + "entries": [{"name": "testpkg.v1.0.0"}] +} +{ + "schema": "olm.bundle", + "name": "testpkg.v1.0.0", + "package": "testpkg", + "image": "quay.io/test/testpkg:v1.0.0", + "properties": [{"type": "olm.package", "value": {"packageName": "testpkg", "version": "1.0.0"}}] +} +{ + "schema": "custom.operator.io", + "package": "testpkg", + "name": "my-custom-resource", + "customField": "customValue" +} +{ + "schema": "custom.operator.io", + "package": "testpkg", + "name": "another-custom-resource", + "data": {"key": "value"} +} +{ + "schema": "custom.packageless", + "name": "global-config", + "data": "packageless-value" +} +`), + }, + } ) diff --git a/staging/operator-registry/scripts/ensure-protoc.sh b/staging/operator-registry/scripts/ensure-protoc.sh index eb7f20c4e3..aea04b8d03 100755 --- a/staging/operator-registry/scripts/ensure-protoc.sh +++ b/staging/operator-registry/scripts/ensure-protoc.sh @@ -8,7 +8,7 @@ ver=$1; shift ver_cmd="${DEST}/protoc --version 2>/dev/null | cut -d' ' -f2" os="$(uname -s | sed 's/Darwin/osx/')" arch="$(uname -m | sed 's/arm64/aarch_64/')" -fetch_cmd="(curl -sSfLo '${DEST}/protoc-${ver}.zip' 'https://github.com/protocolbuffers/protobuf/releases/download/v${ver}/protoc-${ver}-${os}-${arch}.zip' && unzip -o -j -d '${DEST}' '${DEST}/protoc-${ver}.zip' bin/protoc && rm ${DEST}/protoc-${ver}.zip)" +fetch_cmd="(curl -sSfLo '${DEST}/protoc-${ver}.zip' 'https://github.com/protocolbuffers/protobuf/releases/download/v${ver}/protoc-${ver}-${os}-${arch}.zip' && unzip -o -j -d '${DEST}' '${DEST}/protoc-${ver}.zip' bin/protoc && unzip -o -d '${DEST}' '${DEST}/protoc-${ver}.zip' 'include/*' && rm ${DEST}/protoc-${ver}.zip)" if [[ "${ver}" != "$(eval ${ver_cmd})" ]]; then echo "protoc missing or not version '${ver}', downloading..." diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go index 826e4674f1..7fa58380be 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go @@ -1,17 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.4 +// protoc-gen-go v1.36.11 +// protoc v5.27.0 // source: registry.proto package api import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -22,22 +23,19 @@ const ( ) type Channel struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CsvName string `protobuf:"bytes,2,opt,name=csvName,proto3" json:"csvName,omitempty"` + Deprecation *Deprecation `protobuf:"bytes,3,opt,name=deprecation,proto3" json:"deprecation,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - CsvName string `protobuf:"bytes,2,opt,name=csvName,proto3" json:"csvName,omitempty"` - Deprecation *Deprecation `protobuf:"bytes,3,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Channel) Reset() { *x = Channel{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Channel) String() string { @@ -48,7 +46,7 @@ func (*Channel) ProtoMessage() {} func (x *Channel) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -85,20 +83,17 @@ func (x *Channel) GetDeprecation() *Deprecation { } type PackageName struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PackageName) Reset() { *x = PackageName{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PackageName) String() string { @@ -109,7 +104,7 @@ func (*PackageName) ProtoMessage() {} func (x *PackageName) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -132,23 +127,20 @@ func (x *PackageName) GetName() string { } type Package struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Channels []*Channel `protobuf:"bytes,2,rep,name=channels,proto3" json:"channels,omitempty"` - DefaultChannelName string `protobuf:"bytes,3,opt,name=defaultChannelName,proto3" json:"defaultChannelName,omitempty"` - Deprecation *Deprecation `protobuf:"bytes,4,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Channels []*Channel `protobuf:"bytes,2,rep,name=channels,proto3" json:"channels,omitempty"` + DefaultChannelName string `protobuf:"bytes,3,opt,name=defaultChannelName,proto3" json:"defaultChannelName,omitempty"` + Deprecation *Deprecation `protobuf:"bytes,4,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Package) Reset() { *x = Package{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Package) String() string { @@ -159,7 +151,7 @@ func (*Package) ProtoMessage() {} func (x *Package) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -203,23 +195,20 @@ func (x *Package) GetDeprecation() *Deprecation { } type GroupVersionKind struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GroupVersionKind) Reset() { *x = GroupVersionKind{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GroupVersionKind) String() string { @@ -230,7 +219,7 @@ func (*GroupVersionKind) ProtoMessage() {} func (x *GroupVersionKind) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -274,21 +263,18 @@ func (x *GroupVersionKind) GetPlural() string { } type Dependency struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Dependency) Reset() { *x = Dependency{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Dependency) String() string { @@ -299,7 +285,7 @@ func (*Dependency) ProtoMessage() {} func (x *Dependency) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -329,21 +315,18 @@ func (x *Dependency) GetValue() string { } type Property struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Property) Reset() { *x = Property{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Property) String() string { @@ -354,7 +337,7 @@ func (*Property) ProtoMessage() {} func (x *Property) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -384,34 +367,31 @@ func (x *Property) GetValue() string { } type Bundle struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + PackageName string `protobuf:"bytes,2,opt,name=packageName,proto3" json:"packageName,omitempty"` + ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` + CsvJson string `protobuf:"bytes,4,opt,name=csvJson,proto3" json:"csvJson,omitempty"` + Object []string `protobuf:"bytes,5,rep,name=object,proto3" json:"object,omitempty"` + BundlePath string `protobuf:"bytes,6,opt,name=bundlePath,proto3" json:"bundlePath,omitempty"` + ProvidedApis []*GroupVersionKind `protobuf:"bytes,7,rep,name=providedApis,proto3" json:"providedApis,omitempty"` + RequiredApis []*GroupVersionKind `protobuf:"bytes,8,rep,name=requiredApis,proto3" json:"requiredApis,omitempty"` + Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` + SkipRange string `protobuf:"bytes,10,opt,name=skipRange,proto3" json:"skipRange,omitempty"` + Dependencies []*Dependency `protobuf:"bytes,11,rep,name=dependencies,proto3" json:"dependencies,omitempty"` + Properties []*Property `protobuf:"bytes,12,rep,name=properties,proto3" json:"properties,omitempty"` + Replaces string `protobuf:"bytes,13,opt,name=replaces,proto3" json:"replaces,omitempty"` + Skips []string `protobuf:"bytes,14,rep,name=skips,proto3" json:"skips,omitempty"` + Deprecation *Deprecation `protobuf:"bytes,15,opt,name=deprecation,proto3" json:"deprecation,omitempty"` unknownFields protoimpl.UnknownFields - - CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` - PackageName string `protobuf:"bytes,2,opt,name=packageName,proto3" json:"packageName,omitempty"` - ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` - CsvJson string `protobuf:"bytes,4,opt,name=csvJson,proto3" json:"csvJson,omitempty"` - Object []string `protobuf:"bytes,5,rep,name=object,proto3" json:"object,omitempty"` - BundlePath string `protobuf:"bytes,6,opt,name=bundlePath,proto3" json:"bundlePath,omitempty"` - ProvidedApis []*GroupVersionKind `protobuf:"bytes,7,rep,name=providedApis,proto3" json:"providedApis,omitempty"` - RequiredApis []*GroupVersionKind `protobuf:"bytes,8,rep,name=requiredApis,proto3" json:"requiredApis,omitempty"` - Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` - SkipRange string `protobuf:"bytes,10,opt,name=skipRange,proto3" json:"skipRange,omitempty"` - Dependencies []*Dependency `protobuf:"bytes,11,rep,name=dependencies,proto3" json:"dependencies,omitempty"` - Properties []*Property `protobuf:"bytes,12,rep,name=properties,proto3" json:"properties,omitempty"` - Replaces string `protobuf:"bytes,13,opt,name=replaces,proto3" json:"replaces,omitempty"` - Skips []string `protobuf:"bytes,14,rep,name=skips,proto3" json:"skips,omitempty"` - Deprecation *Deprecation `protobuf:"bytes,15,opt,name=deprecation,proto3" json:"deprecation,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Bundle) Reset() { *x = Bundle{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Bundle) String() string { @@ -422,7 +402,7 @@ func (*Bundle) ProtoMessage() {} func (x *Bundle) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -543,23 +523,20 @@ func (x *Bundle) GetDeprecation() *Deprecation { } type ChannelEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PackageName string `protobuf:"bytes,1,opt,name=packageName,proto3" json:"packageName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + BundleName string `protobuf:"bytes,3,opt,name=bundleName,proto3" json:"bundleName,omitempty"` + Replaces string `protobuf:"bytes,4,opt,name=replaces,proto3" json:"replaces,omitempty"` unknownFields protoimpl.UnknownFields - - PackageName string `protobuf:"bytes,1,opt,name=packageName,proto3" json:"packageName,omitempty"` - ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` - BundleName string `protobuf:"bytes,3,opt,name=bundleName,proto3" json:"bundleName,omitempty"` - Replaces string `protobuf:"bytes,4,opt,name=replaces,proto3" json:"replaces,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ChannelEntry) Reset() { *x = ChannelEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ChannelEntry) String() string { @@ -570,7 +547,7 @@ func (*ChannelEntry) ProtoMessage() {} func (x *ChannelEntry) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -614,18 +591,16 @@ func (x *ChannelEntry) GetReplaces() string { } type ListPackageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListPackageRequest) Reset() { *x = ListPackageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListPackageRequest) String() string { @@ -636,7 +611,7 @@ func (*ListPackageRequest) ProtoMessage() {} func (x *ListPackageRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -652,18 +627,16 @@ func (*ListPackageRequest) Descriptor() ([]byte, []int) { } type ListBundlesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListBundlesRequest) Reset() { *x = ListBundlesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListBundlesRequest) String() string { @@ -674,7 +647,7 @@ func (*ListBundlesRequest) ProtoMessage() {} func (x *ListBundlesRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -690,20 +663,17 @@ func (*ListBundlesRequest) Descriptor() ([]byte, []int) { } type GetPackageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetPackageRequest) Reset() { *x = GetPackageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetPackageRequest) String() string { @@ -714,7 +684,7 @@ func (*GetPackageRequest) ProtoMessage() {} func (x *GetPackageRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -737,22 +707,19 @@ func (x *GetPackageRequest) GetName() string { } type GetBundleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + CsvName string `protobuf:"bytes,3,opt,name=csvName,proto3" json:"csvName,omitempty"` unknownFields protoimpl.UnknownFields - - PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` - ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` - CsvName string `protobuf:"bytes,3,opt,name=csvName,proto3" json:"csvName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetBundleRequest) Reset() { *x = GetBundleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBundleRequest) String() string { @@ -763,7 +730,7 @@ func (*GetBundleRequest) ProtoMessage() {} func (x *GetBundleRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -800,21 +767,18 @@ func (x *GetBundleRequest) GetCsvName() string { } type GetBundleInChannelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` unknownFields protoimpl.UnknownFields - - PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` - ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetBundleInChannelRequest) Reset() { *x = GetBundleInChannelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBundleInChannelRequest) String() string { @@ -825,7 +789,7 @@ func (*GetBundleInChannelRequest) ProtoMessage() {} func (x *GetBundleInChannelRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -855,20 +819,17 @@ func (x *GetBundleInChannelRequest) GetChannelName() string { } type GetAllReplacementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` unknownFields protoimpl.UnknownFields - - CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetAllReplacementsRequest) Reset() { *x = GetAllReplacementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAllReplacementsRequest) String() string { @@ -879,7 +840,7 @@ func (*GetAllReplacementsRequest) ProtoMessage() {} func (x *GetAllReplacementsRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -902,22 +863,19 @@ func (x *GetAllReplacementsRequest) GetCsvName() string { } type GetReplacementRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + PkgName string `protobuf:"bytes,2,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` unknownFields protoimpl.UnknownFields - - CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` - PkgName string `protobuf:"bytes,2,opt,name=pkgName,proto3" json:"pkgName,omitempty"` - ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetReplacementRequest) Reset() { *x = GetReplacementRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetReplacementRequest) String() string { @@ -928,7 +886,7 @@ func (*GetReplacementRequest) ProtoMessage() {} func (x *GetReplacementRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -965,23 +923,20 @@ func (x *GetReplacementRequest) GetChannelName() string { } type GetAllProvidersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetAllProvidersRequest) Reset() { *x = GetAllProvidersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAllProvidersRequest) String() string { @@ -992,7 +947,7 @@ func (*GetAllProvidersRequest) ProtoMessage() {} func (x *GetAllProvidersRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1036,23 +991,20 @@ func (x *GetAllProvidersRequest) GetPlural() string { } type GetLatestProvidersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetLatestProvidersRequest) Reset() { *x = GetLatestProvidersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetLatestProvidersRequest) String() string { @@ -1063,7 +1015,7 @@ func (*GetLatestProvidersRequest) ProtoMessage() {} func (x *GetLatestProvidersRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1107,23 +1059,20 @@ func (x *GetLatestProvidersRequest) GetPlural() string { } type GetDefaultProviderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` unknownFields protoimpl.UnknownFields - - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetDefaultProviderRequest) Reset() { *x = GetDefaultProviderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetDefaultProviderRequest) String() string { @@ -1134,7 +1083,7 @@ func (*GetDefaultProviderRequest) ProtoMessage() {} func (x *GetDefaultProviderRequest) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1178,20 +1127,17 @@ func (x *GetDefaultProviderRequest) GetPlural() string { } type Deprecation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields - - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Deprecation) Reset() { *x = Deprecation{} - if protoimpl.UnsafeEnabled { - mi := &file_registry_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_registry_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Deprecation) String() string { @@ -1202,7 +1148,7 @@ func (*Deprecation) ProtoMessage() {} func (x *Deprecation) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1224,223 +1170,200 @@ func (x *Deprecation) GetMessage() string { return "" } -var File_registry_proto protoreflect.FileDescriptor +type ListPackageCustomSchemasRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Schema string `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` + PackageName string `protobuf:"bytes,2,opt,name=packageName,proto3" json:"packageName,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} -var file_registry_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x03, 0x61, 0x70, 0x69, 0x22, 0x6b, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, - 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x21, 0x0a, 0x0b, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x07, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, - 0x2e, 0x0a, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x32, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x6e, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, - 0x72, 0x61, 0x6c, 0x22, 0x36, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x34, 0x0a, 0x08, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0xb0, 0x04, 0x0a, 0x06, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, - 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, - 0x76, 0x4a, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, - 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, - 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x39, 0x0a, 0x0c, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x41, 0x70, 0x69, 0x73, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x64, 0x41, 0x70, 0x69, 0x73, 0x12, 0x39, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x69, - 0x72, 0x65, 0x64, 0x41, 0x70, 0x69, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x41, 0x70, - 0x69, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x6b, 0x69, 0x70, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x6b, 0x69, 0x70, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, - 0x2d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x0c, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, - 0x69, 0x70, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x6b, 0x69, 0x70, 0x73, - 0x12, 0x32, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, - 0x6c, 0x61, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, - 0x6c, 0x61, 0x63, 0x65, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4c, - 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x68, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, - 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, - 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x57, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x49, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x35, 0x0a, - 0x19, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x73, - 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x73, 0x76, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x6d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x73, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6b, 0x67, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0x74, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x22, 0x77, 0x0a, 0x19, 0x47, 0x65, 0x74, - 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, - 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x72, - 0x61, 0x6c, 0x22, 0x77, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, - 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x22, 0x27, 0x0a, 0x0b, 0x44, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x32, 0xcf, 0x05, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x12, 0x3d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x73, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x00, 0x30, 0x01, - 0x12, 0x34, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x16, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x13, 0x47, 0x65, 0x74, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x49, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x03, 0x88, - 0x02, 0x01, 0x12, 0x55, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x54, 0x68, 0x61, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x00, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x15, 0x47, 0x65, 0x74, - 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x61, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, - 0x1c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x54, 0x68, 0x61, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x12, 0x1b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x00, 0x30, - 0x01, 0x12, 0x5b, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x54, 0x68, 0x61, 0x74, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x00, 0x30, 0x01, 0x12, 0x4d, - 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x54, 0x68, 0x61, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, 0x12, 0x1e, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x61, 0x70, 0x69, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +func (x *ListPackageCustomSchemasRequest) Reset() { + *x = ListPackageCustomSchemasRequest{} + mi := &file_registry_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPackageCustomSchemasRequest) String() string { + return protoimpl.X.MessageStringOf(x) } +func (*ListPackageCustomSchemasRequest) ProtoMessage() {} + +func (x *ListPackageCustomSchemasRequest) ProtoReflect() protoreflect.Message { + mi := &file_registry_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPackageCustomSchemasRequest.ProtoReflect.Descriptor instead. +func (*ListPackageCustomSchemasRequest) Descriptor() ([]byte, []int) { + return file_registry_proto_rawDescGZIP(), []int{19} +} + +func (x *ListPackageCustomSchemasRequest) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + +func (x *ListPackageCustomSchemasRequest) GetPackageName() string { + if x != nil { + return x.PackageName + } + return "" +} + +var File_registry_proto protoreflect.FileDescriptor + +const file_registry_proto_rawDesc = "" + + "\n" + + "\x0eregistry.proto\x12\x03api\x1a\x1cgoogle/protobuf/struct.proto\"k\n" + + "\aChannel\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\acsvName\x18\x02 \x01(\tR\acsvName\x122\n" + + "\vdeprecation\x18\x03 \x01(\v2\x10.api.DeprecationR\vdeprecation\"!\n" + + "\vPackageName\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"\xab\x01\n" + + "\aPackage\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12(\n" + + "\bchannels\x18\x02 \x03(\v2\f.api.ChannelR\bchannels\x12.\n" + + "\x12defaultChannelName\x18\x03 \x01(\tR\x12defaultChannelName\x122\n" + + "\vdeprecation\x18\x04 \x01(\v2\x10.api.DeprecationR\vdeprecation\"n\n" + + "\x10GroupVersionKind\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"6\n" + + "\n" + + "Dependency\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"4\n" + + "\bProperty\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"\xb0\x04\n" + + "\x06Bundle\x12\x18\n" + + "\acsvName\x18\x01 \x01(\tR\acsvName\x12 \n" + + "\vpackageName\x18\x02 \x01(\tR\vpackageName\x12 \n" + + "\vchannelName\x18\x03 \x01(\tR\vchannelName\x12\x18\n" + + "\acsvJson\x18\x04 \x01(\tR\acsvJson\x12\x16\n" + + "\x06object\x18\x05 \x03(\tR\x06object\x12\x1e\n" + + "\n" + + "bundlePath\x18\x06 \x01(\tR\n" + + "bundlePath\x129\n" + + "\fprovidedApis\x18\a \x03(\v2\x15.api.GroupVersionKindR\fprovidedApis\x129\n" + + "\frequiredApis\x18\b \x03(\v2\x15.api.GroupVersionKindR\frequiredApis\x12\x18\n" + + "\aversion\x18\t \x01(\tR\aversion\x12\x1c\n" + + "\tskipRange\x18\n" + + " \x01(\tR\tskipRange\x123\n" + + "\fdependencies\x18\v \x03(\v2\x0f.api.DependencyR\fdependencies\x12-\n" + + "\n" + + "properties\x18\f \x03(\v2\r.api.PropertyR\n" + + "properties\x12\x1a\n" + + "\breplaces\x18\r \x01(\tR\breplaces\x12\x14\n" + + "\x05skips\x18\x0e \x03(\tR\x05skips\x122\n" + + "\vdeprecation\x18\x0f \x01(\v2\x10.api.DeprecationR\vdeprecation\"\x8e\x01\n" + + "\fChannelEntry\x12 \n" + + "\vpackageName\x18\x01 \x01(\tR\vpackageName\x12 \n" + + "\vchannelName\x18\x02 \x01(\tR\vchannelName\x12\x1e\n" + + "\n" + + "bundleName\x18\x03 \x01(\tR\n" + + "bundleName\x12\x1a\n" + + "\breplaces\x18\x04 \x01(\tR\breplaces\"\x14\n" + + "\x12ListPackageRequest\"\x14\n" + + "\x12ListBundlesRequest\"'\n" + + "\x11GetPackageRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"h\n" + + "\x10GetBundleRequest\x12\x18\n" + + "\apkgName\x18\x01 \x01(\tR\apkgName\x12 \n" + + "\vchannelName\x18\x02 \x01(\tR\vchannelName\x12\x18\n" + + "\acsvName\x18\x03 \x01(\tR\acsvName\"W\n" + + "\x19GetBundleInChannelRequest\x12\x18\n" + + "\apkgName\x18\x01 \x01(\tR\apkgName\x12 \n" + + "\vchannelName\x18\x02 \x01(\tR\vchannelName\"5\n" + + "\x19GetAllReplacementsRequest\x12\x18\n" + + "\acsvName\x18\x01 \x01(\tR\acsvName\"m\n" + + "\x15GetReplacementRequest\x12\x18\n" + + "\acsvName\x18\x01 \x01(\tR\acsvName\x12\x18\n" + + "\apkgName\x18\x02 \x01(\tR\apkgName\x12 \n" + + "\vchannelName\x18\x03 \x01(\tR\vchannelName\"t\n" + + "\x16GetAllProvidersRequest\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"w\n" + + "\x19GetLatestProvidersRequest\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"w\n" + + "\x19GetDefaultProviderRequest\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x16\n" + + "\x06plural\x18\x04 \x01(\tR\x06plural\"'\n" + + "\vDeprecation\x12\x18\n" + + "\amessage\x18\x01 \x01(\tR\amessage\"[\n" + + "\x1fListPackageCustomSchemasRequest\x12\x16\n" + + "\x06schema\x18\x01 \x01(\tR\x06schema\x12 \n" + + "\vpackageName\x18\x02 \x01(\tR\vpackageName2\xae\x06\n" + + "\bRegistry\x12=\n" + + "\fListPackages\x12\x17.api.ListPackageRequest\x1a\x10.api.PackageName\"\x000\x01\x124\n" + + "\n" + + "GetPackage\x12\x16.api.GetPackageRequest\x1a\f.api.Package\"\x00\x121\n" + + "\tGetBundle\x12\x15.api.GetBundleRequest\x1a\v.api.Bundle\"\x00\x12G\n" + + "\x13GetBundleForChannel\x12\x1e.api.GetBundleInChannelRequest\x1a\v.api.Bundle\"\x03\x88\x02\x01\x12U\n" + + "\x1cGetChannelEntriesThatReplace\x12\x1e.api.GetAllReplacementsRequest\x1a\x11.api.ChannelEntry\"\x000\x01\x12B\n" + + "\x15GetBundleThatReplaces\x12\x1a.api.GetReplacementRequest\x1a\v.api.Bundle\"\x00\x12R\n" + + "\x1cGetChannelEntriesThatProvide\x12\x1b.api.GetAllProvidersRequest\x1a\x11.api.ChannelEntry\"\x000\x01\x12[\n" + + "\"GetLatestChannelEntriesThatProvide\x12\x1e.api.GetLatestProvidersRequest\x1a\x11.api.ChannelEntry\"\x000\x01\x12M\n" + + "\x1cGetDefaultBundleThatProvides\x12\x1e.api.GetDefaultProviderRequest\x1a\v.api.Bundle\"\x00\x127\n" + + "\vListBundles\x12\x17.api.ListBundlesRequest\x1a\v.api.Bundle\"\x000\x01\x12]\n" + + "\x18ListPackageCustomSchemas\x12$.api.ListPackageCustomSchemasRequest\x1a\x17.google.protobuf.Struct\"\x000\x01B\aZ\x05.;apib\x06proto3" + var ( file_registry_proto_rawDescOnce sync.Once - file_registry_proto_rawDescData = file_registry_proto_rawDesc + file_registry_proto_rawDescData []byte ) func file_registry_proto_rawDescGZIP() []byte { file_registry_proto_rawDescOnce.Do(func() { - file_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_registry_proto_rawDescData) + file_registry_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_registry_proto_rawDesc), len(file_registry_proto_rawDesc))) }) return file_registry_proto_rawDescData } -var file_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_registry_proto_goTypes = []interface{}{ - (*Channel)(nil), // 0: api.Channel - (*PackageName)(nil), // 1: api.PackageName - (*Package)(nil), // 2: api.Package - (*GroupVersionKind)(nil), // 3: api.GroupVersionKind - (*Dependency)(nil), // 4: api.Dependency - (*Property)(nil), // 5: api.Property - (*Bundle)(nil), // 6: api.Bundle - (*ChannelEntry)(nil), // 7: api.ChannelEntry - (*ListPackageRequest)(nil), // 8: api.ListPackageRequest - (*ListBundlesRequest)(nil), // 9: api.ListBundlesRequest - (*GetPackageRequest)(nil), // 10: api.GetPackageRequest - (*GetBundleRequest)(nil), // 11: api.GetBundleRequest - (*GetBundleInChannelRequest)(nil), // 12: api.GetBundleInChannelRequest - (*GetAllReplacementsRequest)(nil), // 13: api.GetAllReplacementsRequest - (*GetReplacementRequest)(nil), // 14: api.GetReplacementRequest - (*GetAllProvidersRequest)(nil), // 15: api.GetAllProvidersRequest - (*GetLatestProvidersRequest)(nil), // 16: api.GetLatestProvidersRequest - (*GetDefaultProviderRequest)(nil), // 17: api.GetDefaultProviderRequest - (*Deprecation)(nil), // 18: api.Deprecation +var file_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_registry_proto_goTypes = []any{ + (*Channel)(nil), // 0: api.Channel + (*PackageName)(nil), // 1: api.PackageName + (*Package)(nil), // 2: api.Package + (*GroupVersionKind)(nil), // 3: api.GroupVersionKind + (*Dependency)(nil), // 4: api.Dependency + (*Property)(nil), // 5: api.Property + (*Bundle)(nil), // 6: api.Bundle + (*ChannelEntry)(nil), // 7: api.ChannelEntry + (*ListPackageRequest)(nil), // 8: api.ListPackageRequest + (*ListBundlesRequest)(nil), // 9: api.ListBundlesRequest + (*GetPackageRequest)(nil), // 10: api.GetPackageRequest + (*GetBundleRequest)(nil), // 11: api.GetBundleRequest + (*GetBundleInChannelRequest)(nil), // 12: api.GetBundleInChannelRequest + (*GetAllReplacementsRequest)(nil), // 13: api.GetAllReplacementsRequest + (*GetReplacementRequest)(nil), // 14: api.GetReplacementRequest + (*GetAllProvidersRequest)(nil), // 15: api.GetAllProvidersRequest + (*GetLatestProvidersRequest)(nil), // 16: api.GetLatestProvidersRequest + (*GetDefaultProviderRequest)(nil), // 17: api.GetDefaultProviderRequest + (*Deprecation)(nil), // 18: api.Deprecation + (*ListPackageCustomSchemasRequest)(nil), // 19: api.ListPackageCustomSchemasRequest + (*structpb.Struct)(nil), // 20: google.protobuf.Struct } var file_registry_proto_depIdxs = []int32{ 18, // 0: api.Channel.deprecation:type_name -> api.Deprecation @@ -1461,18 +1384,20 @@ var file_registry_proto_depIdxs = []int32{ 16, // 15: api.Registry.GetLatestChannelEntriesThatProvide:input_type -> api.GetLatestProvidersRequest 17, // 16: api.Registry.GetDefaultBundleThatProvides:input_type -> api.GetDefaultProviderRequest 9, // 17: api.Registry.ListBundles:input_type -> api.ListBundlesRequest - 1, // 18: api.Registry.ListPackages:output_type -> api.PackageName - 2, // 19: api.Registry.GetPackage:output_type -> api.Package - 6, // 20: api.Registry.GetBundle:output_type -> api.Bundle - 6, // 21: api.Registry.GetBundleForChannel:output_type -> api.Bundle - 7, // 22: api.Registry.GetChannelEntriesThatReplace:output_type -> api.ChannelEntry - 6, // 23: api.Registry.GetBundleThatReplaces:output_type -> api.Bundle - 7, // 24: api.Registry.GetChannelEntriesThatProvide:output_type -> api.ChannelEntry - 7, // 25: api.Registry.GetLatestChannelEntriesThatProvide:output_type -> api.ChannelEntry - 6, // 26: api.Registry.GetDefaultBundleThatProvides:output_type -> api.Bundle - 6, // 27: api.Registry.ListBundles:output_type -> api.Bundle - 18, // [18:28] is the sub-list for method output_type - 8, // [8:18] is the sub-list for method input_type + 19, // 18: api.Registry.ListPackageCustomSchemas:input_type -> api.ListPackageCustomSchemasRequest + 1, // 19: api.Registry.ListPackages:output_type -> api.PackageName + 2, // 20: api.Registry.GetPackage:output_type -> api.Package + 6, // 21: api.Registry.GetBundle:output_type -> api.Bundle + 6, // 22: api.Registry.GetBundleForChannel:output_type -> api.Bundle + 7, // 23: api.Registry.GetChannelEntriesThatReplace:output_type -> api.ChannelEntry + 6, // 24: api.Registry.GetBundleThatReplaces:output_type -> api.Bundle + 7, // 25: api.Registry.GetChannelEntriesThatProvide:output_type -> api.ChannelEntry + 7, // 26: api.Registry.GetLatestChannelEntriesThatProvide:output_type -> api.ChannelEntry + 6, // 27: api.Registry.GetDefaultBundleThatProvides:output_type -> api.Bundle + 6, // 28: api.Registry.ListBundles:output_type -> api.Bundle + 20, // 29: api.Registry.ListPackageCustomSchemas:output_type -> google.protobuf.Struct + 19, // [19:30] is the sub-list for method output_type + 8, // [8:19] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name 8, // [8:8] is the sub-list for extension extendee 0, // [0:8] is the sub-list for field type_name @@ -1483,243 +1408,13 @@ func file_registry_proto_init() { if File_registry_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Channel); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackageName); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Package); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupVersionKind); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Dependency); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Property); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bundle); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChannelEntry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPackageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBundlesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPackageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBundleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBundleInChannelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllReplacementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetReplacementRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllProvidersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestProvidersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDefaultProviderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Deprecation); 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_registry_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_registry_proto_rawDesc), len(file_registry_proto_rawDesc)), NumEnums: 0, - NumMessages: 19, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, @@ -1728,7 +1423,6 @@ func file_registry_proto_init() { MessageInfos: file_registry_proto_msgTypes, }.Build() File_registry_proto = out.File - file_registry_proto_rawDesc = nil file_registry_proto_goTypes = nil file_registry_proto_depIdxs = nil } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto index 5aa54a253b..8b8f82a6c3 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto +++ b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto @@ -2,6 +2,8 @@ syntax = "proto3"; option go_package = ".;api"; +import "google/protobuf/struct.proto"; + package api; service Registry { @@ -17,6 +19,7 @@ service Registry { rpc GetLatestChannelEntriesThatProvide(GetLatestProvidersRequest) returns (stream ChannelEntry) {} rpc GetDefaultBundleThatProvides(GetDefaultProviderRequest) returns (Bundle) {} rpc ListBundles(ListBundlesRequest) returns (stream Bundle) {} + rpc ListPackageCustomSchemas(ListPackageCustomSchemasRequest) returns (stream google.protobuf.Struct) {} } message Channel{ @@ -130,4 +133,10 @@ message GetDefaultProviderRequest{ message Deprecation{ string message = 1; -} \ No newline at end of file +} + +message ListPackageCustomSchemasRequest{ + string schema = 1; + string packageName = 2; +} + diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry_grpc.pb.go b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry_grpc.pb.go index b5a62b3dfb..336d44f124 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry_grpc.pb.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry_grpc.pb.go @@ -11,6 +11,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + structpb "google.golang.org/protobuf/types/known/structpb" ) // This is a compile-time assertion to ensure that this generated file @@ -29,6 +30,7 @@ const ( Registry_GetLatestChannelEntriesThatProvide_FullMethodName = "/api.Registry/GetLatestChannelEntriesThatProvide" Registry_GetDefaultBundleThatProvides_FullMethodName = "/api.Registry/GetDefaultBundleThatProvides" Registry_ListBundles_FullMethodName = "/api.Registry/ListBundles" + Registry_ListPackageCustomSchemas_FullMethodName = "/api.Registry/ListPackageCustomSchemas" ) // RegistryClient is the client API for Registry service. @@ -46,6 +48,7 @@ type RegistryClient interface { GetLatestChannelEntriesThatProvide(ctx context.Context, in *GetLatestProvidersRequest, opts ...grpc.CallOption) (Registry_GetLatestChannelEntriesThatProvideClient, error) GetDefaultBundleThatProvides(ctx context.Context, in *GetDefaultProviderRequest, opts ...grpc.CallOption) (*Bundle, error) ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (Registry_ListBundlesClient, error) + ListPackageCustomSchemas(ctx context.Context, in *ListPackageCustomSchemasRequest, opts ...grpc.CallOption) (Registry_ListPackageCustomSchemasClient, error) } type registryClient struct { @@ -262,6 +265,38 @@ func (x *registryListBundlesClient) Recv() (*Bundle, error) { return m, nil } +func (c *registryClient) ListPackageCustomSchemas(ctx context.Context, in *ListPackageCustomSchemasRequest, opts ...grpc.CallOption) (Registry_ListPackageCustomSchemasClient, error) { + stream, err := c.cc.NewStream(ctx, &Registry_ServiceDesc.Streams[5], Registry_ListPackageCustomSchemas_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := ®istryListPackageCustomSchemasClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Registry_ListPackageCustomSchemasClient interface { + Recv() (*structpb.Struct, error) + grpc.ClientStream +} + +type registryListPackageCustomSchemasClient struct { + grpc.ClientStream +} + +func (x *registryListPackageCustomSchemasClient) Recv() (*structpb.Struct, error) { + m := new(structpb.Struct) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // RegistryServer is the server API for Registry service. // All implementations must embed UnimplementedRegistryServer // for forward compatibility @@ -277,6 +312,7 @@ type RegistryServer interface { GetLatestChannelEntriesThatProvide(*GetLatestProvidersRequest, Registry_GetLatestChannelEntriesThatProvideServer) error GetDefaultBundleThatProvides(context.Context, *GetDefaultProviderRequest) (*Bundle, error) ListBundles(*ListBundlesRequest, Registry_ListBundlesServer) error + ListPackageCustomSchemas(*ListPackageCustomSchemasRequest, Registry_ListPackageCustomSchemasServer) error mustEmbedUnimplementedRegistryServer() } @@ -314,6 +350,9 @@ func (UnimplementedRegistryServer) GetDefaultBundleThatProvides(context.Context, func (UnimplementedRegistryServer) ListBundles(*ListBundlesRequest, Registry_ListBundlesServer) error { return status.Errorf(codes.Unimplemented, "method ListBundles not implemented") } +func (UnimplementedRegistryServer) ListPackageCustomSchemas(*ListPackageCustomSchemasRequest, Registry_ListPackageCustomSchemasServer) error { + return status.Errorf(codes.Unimplemented, "method ListPackageCustomSchemas not implemented") +} func (UnimplementedRegistryServer) mustEmbedUnimplementedRegistryServer() {} // UnsafeRegistryServer may be embedded to opt out of forward compatibility for this service. @@ -522,6 +561,27 @@ func (x *registryListBundlesServer) Send(m *Bundle) error { return x.ServerStream.SendMsg(m) } +func _Registry_ListPackageCustomSchemas_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListPackageCustomSchemasRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RegistryServer).ListPackageCustomSchemas(m, ®istryListPackageCustomSchemasServer{stream}) +} + +type Registry_ListPackageCustomSchemasServer interface { + Send(*structpb.Struct) error + grpc.ServerStream +} + +type registryListPackageCustomSchemasServer struct { + grpc.ServerStream +} + +func (x *registryListPackageCustomSchemasServer) Send(m *structpb.Struct) error { + return x.ServerStream.SendMsg(m) +} + // Registry_ServiceDesc is the grpc.ServiceDesc for Registry service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -576,6 +636,11 @@ var Registry_ServiceDesc = grpc.ServiceDesc{ Handler: _Registry_ListBundles_Handler, ServerStreams: true, }, + { + StreamName: "ListPackageCustomSchemas", + Handler: _Registry_ListPackageCustomSchemas_Handler, + ServerStreams: true, + }, }, Metadata: "registry.proto", } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/cache/cache.go b/vendor/github.com/operator-framework/operator-registry/pkg/cache/cache.go index a02297b36d..7e3baf4a89 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/cache/cache.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/cache/cache.go @@ -28,6 +28,8 @@ type Cache interface { Build(ctx context.Context, fbc fs.FS) error Load(ctc context.Context) error Close() error + + ListPackageCustomSchemas(ctx context.Context, schema, packageName string, sender func([]byte) error) error } type backend interface { @@ -45,6 +47,9 @@ type backend interface { GetBundle(context.Context, bundleKey) (*api.Bundle, error) PutBundle(context.Context, bundleKey, *api.Bundle) error + PutMeta(context.Context, metaKey, []byte) error + SendMetas(context.Context, metaKey, func([]byte) error) error + GetDigest(context.Context) (string, error) ComputeDigest(context.Context, fs.FS) (string, error) PutDigest(context.Context, string) error @@ -237,6 +242,14 @@ func (c *cache) GetBundleThatProvides(ctx context.Context, group, version, kind return c.packageIndex.GetBundleThatProvides(ctx, c, group, version, kind) } +func (c *cache) ListPackageCustomSchemas(ctx context.Context, schema, packageName string, sender func([]byte) error) error { + mk, err := newValidatedMetaKey(schema, packageName) + if err != nil { + return fmt.Errorf("invalid custom schema query: %w", err) + } + return c.backend.SendMetas(ctx, mk, sender) +} + func (c *cache) CheckIntegrity(ctx context.Context, fbc fs.FS) error { existingDigest, err := c.backend.GetDigest(ctx) if err != nil { @@ -290,6 +303,21 @@ func (c *cache) Build(ctx context.Context, fbcFsys fs.FS) error { walkMu.Lock() defer walkMu.Unlock() + + switch meta.Schema { + case declcfg.SchemaPackage, declcfg.SchemaChannel, declcfg.SchemaBundle, declcfg.SchemaDeprecation: + default: + mk, err := newValidatedMetaKey(meta.Schema, packageName) + if err != nil { + return fmt.Errorf("invalid custom schema meta: %v", err) + } + if err := c.backend.PutMeta(ctx, mk, meta.Blob); err != nil { + return fmt.Errorf("store custom schema meta %v: %v", mk, err) + } + if packageName == "" { + return nil + } + } if _, err := tmpFile.Write(meta.Blob); err != nil { return err } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/cache/json.go b/vendor/github.com/operator-framework/operator-registry/pkg/cache/json.go index 92b17f7525..cfa600046b 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/cache/json.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/cache/json.go @@ -101,6 +101,8 @@ func (q *jsonBackend) GetPackageIndex(_ context.Context) (packageIndex, error) { return pi, nil } +const jsonMetasDir = jsonDir + string(filepath.Separator) + "metas" + func (q *jsonBackend) PutPackageIndex(_ context.Context, pi packageIndex) error { packageJSON, err := json.Marshal(pi) if err != nil { @@ -140,6 +142,44 @@ func (q *jsonBackend) PutBundle(_ context.Context, key bundleKey, bundle *api.Bu return nil } +func (q *jsonBackend) metaDir(in metaKey) string { + return filepath.Join(q.baseDir, jsonMetasDir, in.Schema, in.PackageName) +} + +func (q *jsonBackend) PutMeta(_ context.Context, key metaKey, blob []byte) error { + dir := q.metaDir(key) + if err := os.MkdirAll(dir, jsonCacheModeDir); err != nil { + return err + } + h := fnv.New64a() + h.Write(blob) + return os.WriteFile(filepath.Join(dir, fmt.Sprintf("%x.json", h.Sum64())), blob, jsonCacheModeFile) +} + +func (q *jsonBackend) SendMetas(_ context.Context, key metaKey, sender func([]byte) error) error { + dir := q.metaDir(key) + entries, err := os.ReadDir(dir) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil + } + return err + } + for _, entry := range entries { + if entry.IsDir() || filepath.Ext(entry.Name()) != ".json" { + continue + } + data, err := os.ReadFile(filepath.Join(dir, entry.Name())) + if err != nil { + return err + } + if err := sender(data); err != nil { + return err + } + } + return nil +} + func (q *jsonBackend) GetDigest(_ context.Context) (string, error) { return readDigestFile(filepath.Join(q.baseDir, jsonDigestFile)) } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/cache/meta_key.go b/vendor/github.com/operator-framework/operator-registry/pkg/cache/meta_key.go new file mode 100644 index 0000000000..3a2233bbee --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/cache/meta_key.go @@ -0,0 +1,40 @@ +package cache + +import ( + "fmt" + "strings" +) + +type ValidationError struct { + Err error +} + +func (e *ValidationError) Error() string { return e.Err.Error() } +func (e *ValidationError) Unwrap() error { return e.Err } + +func validateMetaKeyComponent(name, value string) error { + if value == "" { + return &ValidationError{fmt.Errorf("invalid %s: must not be empty", name)} + } + if strings.ContainsAny(value, "/\\") || value == "." || value == ".." { + return &ValidationError{fmt.Errorf("invalid %s %q: must not contain path separators, '.', or '..'", name, value)} + } + return nil +} + +func newValidatedMetaKey(schema, packageName string) (metaKey, error) { + if err := validateMetaKeyComponent("schema", schema); err != nil { + return metaKey{}, err + } + if packageName != "" { + if err := validateMetaKeyComponent("packageName", packageName); err != nil { + return metaKey{}, err + } + } + return metaKey{Schema: schema, PackageName: packageName}, nil +} + +type metaKey struct { + Schema string + PackageName string +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/cache/pogrebv1.go b/vendor/github.com/operator-framework/operator-registry/pkg/cache/pogrebv1.go index a590832cbb..8e6ea33db7 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/cache/pogrebv1.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/cache/pogrebv1.go @@ -1,6 +1,7 @@ package cache import ( + "bytes" "context" "encoding/json" "errors" @@ -127,6 +128,8 @@ func (q *pogrebV1Backend) GetPackageIndex(_ context.Context) (packageIndex, erro return pi, nil } +const metaKeyPrefix = "metas/" + func (q *pogrebV1Backend) PutPackageIndex(_ context.Context, index packageIndex) error { packageJSON, err := json.Marshal(index) if err != nil { @@ -163,6 +166,39 @@ func (q *pogrebV1Backend) PutBundle(_ context.Context, key bundleKey, bundle *ap return nil } +func (q *pogrebV1Backend) metaDBKey(in metaKey, blob []byte) []byte { + h := fnv.New64a() + h.Write(blob) + return []byte(fmt.Sprintf("%s%s/%s/%x", metaKeyPrefix, in.Schema, in.PackageName, h.Sum64())) +} + +func (q *pogrebV1Backend) metaDBKeyPrefix(in metaKey) string { + return fmt.Sprintf("%s%s/%s/", metaKeyPrefix, in.Schema, in.PackageName) +} + +func (q *pogrebV1Backend) PutMeta(_ context.Context, key metaKey, blob []byte) error { + return q.db.Put(q.metaDBKey(key, blob), blob) +} + +func (q *pogrebV1Backend) SendMetas(_ context.Context, key metaKey, sender func([]byte) error) error { + prefix := []byte(q.metaDBKeyPrefix(key)) + it := q.db.Items() + for { + k, v, err := it.Next() + if errors.Is(err, pogreb.ErrIterationDone) { + return nil + } + if err != nil { + return err + } + if bytes.HasPrefix(k, prefix) { + if err := sender(v); err != nil { + return err + } + } + } +} + func (q *pogrebV1Backend) GetDigest(_ context.Context) (string, error) { return readDigestFile(filepath.Join(q.baseDir, pogrebDigestFile)) } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/server/server.go b/vendor/github.com/operator-framework/operator-registry/pkg/server/server.go index 56b09e2258..91706f68c0 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/server/server.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/server/server.go @@ -2,8 +2,15 @@ package server import ( "context" + "encoding/json" + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/structpb" "github.com/operator-framework/operator-registry/pkg/api" + fbccache "github.com/operator-framework/operator-registry/pkg/cache" "github.com/operator-framework/operator-registry/pkg/registry" ) @@ -98,3 +105,40 @@ func (s *RegistryServer) GetLatestChannelEntriesThatProvide(req *api.GetLatestPr func (s *RegistryServer) GetDefaultBundleThatProvides(ctx context.Context, req *api.GetDefaultProviderRequest) (*api.Bundle, error) { return s.store.GetBundleThatProvides(ctx, req.GetGroup(), req.GetVersion(), req.GetKind()) } + +func (s *RegistryServer) ListPackageCustomSchemas(req *api.ListPackageCustomSchemasRequest, stream api.Registry_ListPackageCustomSchemasServer) error { + schema, pkgName := req.GetSchema(), req.GetPackageName() + if schema == "" { + return status.Errorf(codes.InvalidArgument, "schema is required") + } + type customSchemaQuerier interface { + ListPackageCustomSchemas(ctx context.Context, schema, packageName string, sender func([]byte) error) error + } + mq, ok := s.store.(customSchemaQuerier) + if !ok { + return status.Errorf(codes.Unimplemented, "store does not support custom schema queries") + } + err := mq.ListPackageCustomSchemas(stream.Context(), schema, pkgName, + func(blob []byte) error { + var m map[string]interface{} + if err := json.Unmarshal(blob, &m); err != nil { + return status.Errorf(codes.Internal, "unmarshal custom schema blob: %v", err) + } + st, err := structpb.NewStruct(m) + if err != nil { + return status.Errorf(codes.Internal, "convert custom schema blob to struct: %v", err) + } + return stream.Send(st) + }) + if err != nil { + if _, ok := status.FromError(err); ok { + return err + } + var ve *fbccache.ValidationError + if errors.As(err, &ve) { + return status.Errorf(codes.InvalidArgument, "%v", err) + } + return status.Errorf(codes.Internal, "%v", err) + } + return nil +} From a3d0eb46db8145921ebd8806303edf6432e993bb Mon Sep 17 00:00:00 2001 From: "Per G. da Silva" Date: Tue, 19 May 2026 13:59:47 +0200 Subject: [PATCH 2/3] UPSTREAM: : Add CustomSchemas field to PackageManifest and fetch lifecycle metadata via ListPackageCustomSchemas Adds support for fetching custom schema FBC blobs (e.g., lifecycle metadata) in the package-server. For each catalog source, the provider calls ListPackageCustomSchemas via the gRPC client and populates a new CustomSchemas field on PackageManifestStatus. Key changes: - Add CustomSchemas field to internal and v1 PackageManifestStatus - Add deepcopy, conversion, and OpenAPI schema updates - Fetch custom schemas in provider with configurable --custom-schemas flag - Add tests for custom schema fetching - Update operator-registry vendor for ListPackageCustomSchemas RPC Co-Authored-By: Claude Opus 4.6 (1M context) --- go.mod | 2 +- go.sum | 4 +- .../_packageserver.deployment-spec.yaml | 4 + staging/operator-lifecycle-manager/go.mod | 14 +- staging/operator-lifecycle-manager/go.sum | 8 +- .../catalog/fakes/fake_registry_client.go | 171 ++++-- .../apis/operators/packagemanifest_types.go | 4 + .../operators/v1/packagemanifest_types.go | 4 + .../operators/v1/zz_generated.conversion.go | 2 + .../operators/v1/zz_generated.deepcopy.go | 15 + .../apis/operators/zz_generated.deepcopy.go | 15 + ...fake_list_package_custom_schemas_client.go | 509 ++++++++++++++++++ .../client/fakes/fake_registry_client.go | 81 +++ .../client/openapi/zz_generated.openapi.go | 23 +- .../pkg/package-server/provider/registry.go | 79 ++- .../package-server/provider/registry_test.go | 121 ++++- .../pkg/package-server/server/server.go | 6 +- .../apis/operators/packagemanifest_types.go | 4 + .../operators/v1/packagemanifest_types.go | 4 + .../operators/v1/zz_generated.conversion.go | 2 + .../operators/v1/zz_generated.deepcopy.go | 15 + .../apis/operators/zz_generated.deepcopy.go | 15 + .../client/openapi/zz_generated.openapi.go | 23 +- .../pkg/package-server/provider/registry.go | 79 ++- .../pkg/package-server/server/server.go | 6 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/modules.txt | 2 +- 27 files changed, 1140 insertions(+), 74 deletions(-) create mode 100644 staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_list_package_custom_schemas_client.go diff --git a/go.mod b/go.mod index 5af7ccc8ba..bc057e4534 100644 --- a/go.mod +++ b/go.mod @@ -221,7 +221,7 @@ require ( google.golang.org/genproto v0.0.0-20260203192932-546029d2fa20 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect - google.golang.org/grpc v1.81.0 // indirect + google.golang.org/grpc v1.81.1 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/go.sum b/go.sum index 94a591cb66..5d09d0c318 100644 --- a/go.sum +++ b/go.sum @@ -830,8 +830,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.81.0 h1:W3G9N3KQf3BU+YuCtGKJk0CmxQNbAISICD/9AORxLIw= -google.golang.org/grpc v1.81.0/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= +google.golang.org/grpc v1.81.1 h1:VnnIIZ88UzOOKLukQi+ImGz8O1Wdp8nAGGnvOfEIWQQ= +google.golang.org/grpc v1.81.1/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 h1:rgSNvqscFZ1JgV/4wH5GOsZFSFkR2Eua9As3KIr2LlM= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2/go.mod h1:iMEtFwDlAhjDU9L5mY6U1XLwlIId/G3h+QcBHDIvrJ8= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/staging/operator-lifecycle-manager/deploy/chart/templates/_packageserver.deployment-spec.yaml b/staging/operator-lifecycle-manager/deploy/chart/templates/_packageserver.deployment-spec.yaml index d3c791df4a..61783e50a9 100644 --- a/staging/operator-lifecycle-manager/deploy/chart/templates/_packageserver.deployment-spec.yaml +++ b/staging/operator-lifecycle-manager/deploy/chart/templates/_packageserver.deployment-spec.yaml @@ -52,6 +52,10 @@ spec: - --interval - {{ .Values.package.interval }} {{- end }} + {{- if .Values.package.customSchemas }} + - --custom-schemas + - {{ .Values.package.customSchemas }} + {{- end }} {{- if .Values.package.commandArgs }} - {{ .Values.package.commandArgs }} {{- end }} diff --git a/staging/operator-lifecycle-manager/go.mod b/staging/operator-lifecycle-manager/go.mod index c0a9d55a5c..7925ea2934 100644 --- a/staging/operator-lifecycle-manager/go.mod +++ b/staging/operator-lifecycle-manager/go.mod @@ -37,7 +37,8 @@ require ( golang.org/x/net v0.54.0 golang.org/x/sync v0.20.0 golang.org/x/time v0.15.0 - google.golang.org/grpc v1.81.0 + google.golang.org/grpc v1.81.1 + google.golang.org/protobuf v1.36.11 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.35.4 k8s.io/apiextensions-apiserver v0.35.4 @@ -62,6 +63,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Microsoft/hcsshim v0.13.0 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect + github.com/akrylysov/pogreb v0.10.2 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect @@ -91,6 +93,9 @@ require ( github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.7.0 // indirect + github.com/go-git/go-git/v5 v5.16.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.22.4 // indirect @@ -125,6 +130,8 @@ require ( github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/itchyny/timefmt-go v0.1.8 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/joelanford/ignore v0.1.1 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.18.4 // indirect github.com/kylelemons/godebug v1.1.0 // indirect @@ -146,6 +153,7 @@ require ( github.com/otiai10/mint v1.6.3 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/procfs v0.20.1 // indirect + github.com/tidwall/btree v1.8.1 // indirect github.com/x448/float16 v0.8.4 // indirect go.etcd.io/bbolt v1.4.3 // indirect go.etcd.io/etcd/api/v3 v3.6.7 // indirect @@ -180,10 +188,10 @@ require ( google.golang.org/genproto v0.0.0-20260203192932-546029d2fa20 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect - google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b // indirect k8s.io/kms v0.35.4 // indirect @@ -195,3 +203,5 @@ require ( ) retract v3.11.0+incompatible // https://github.com/operator-framework/operator-lifecycle-manager/issues/2253 + +replace github.com/operator-framework/operator-registry => github.com/perdasilva/operator-registry v1.23.2-0.20260518074945-e87fce41ba01 diff --git a/staging/operator-lifecycle-manager/go.sum b/staging/operator-lifecycle-manager/go.sum index b85c9dff7b..db62b94f54 100644 --- a/staging/operator-lifecycle-manager/go.sum +++ b/staging/operator-lifecycle-manager/go.sum @@ -344,12 +344,12 @@ github.com/openshift/library-go v0.0.0-20260204111611-b7d4fa0e292a h1:YLnZtVfqGU github.com/openshift/library-go v0.0.0-20260204111611-b7d4fa0e292a/go.mod h1:DCRz1EgdayEmr9b6KXKDL+DWBN0rGHu/VYADeHzPoOk= github.com/operator-framework/api v0.42.0 h1:rkc5V3zW8RxZMjePAe12jdL7Co/hwsYo1pLnkkhuR7s= github.com/operator-framework/api v0.42.0/go.mod h1:bMEj+wl/8tGqcGNtxt38cLUYagu9chNsbYzb/5HQaUQ= -github.com/operator-framework/operator-registry v1.68.0 h1:hsWR4o2a508xrc3DAalY4D/JGg7wnv6wjX+BTqXxSLI= -github.com/operator-framework/operator-registry v1.68.0/go.mod h1:QuIAkmWIo0Kc03iVjybiI148AEQhBPdnrnAzFcDDR3Q= github.com/otiai10/copy v1.14.1 h1:5/7E6qsUMBaH5AnQ0sSLzzTg1oTECmcCmT6lvF45Na8= github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3DoZm9I= github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs= github.com/otiai10/mint v1.6.3/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= +github.com/perdasilva/operator-registry v1.23.2-0.20260518074945-e87fce41ba01 h1:EMm2cns+s95PdlJD5ssNwzr6nhUk59/Cmio3DE9AgIk= +github.com/perdasilva/operator-registry v1.23.2-0.20260518074945-e87fce41ba01/go.mod h1:NtJvZw1fIJr6OonnFbwXbBDMCjoRuSMV3iqWeAriA6s= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -607,8 +607,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.81.0 h1:W3G9N3KQf3BU+YuCtGKJk0CmxQNbAISICD/9AORxLIw= -google.golang.org/grpc v1.81.0/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= +google.golang.org/grpc v1.81.1 h1:VnnIIZ88UzOOKLukQi+ImGz8O1Wdp8nAGGnvOfEIWQQ= +google.golang.org/grpc v1.81.1/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/staging/operator-lifecycle-manager/pkg/controller/operators/catalog/fakes/fake_registry_client.go b/staging/operator-lifecycle-manager/pkg/controller/operators/catalog/fakes/fake_registry_client.go index ff5b4119a6..bd436c0a1f 100644 --- a/staging/operator-lifecycle-manager/pkg/controller/operators/catalog/fakes/fake_registry_client.go +++ b/staging/operator-lifecycle-manager/pkg/controller/operators/catalog/fakes/fake_registry_client.go @@ -145,6 +145,21 @@ type FakeRegistryClient struct { result1 api.Registry_ListBundlesClient result2 error } + ListPackageCustomSchemasStub func(context.Context, *api.ListPackageCustomSchemasRequest, ...grpc.CallOption) (api.Registry_ListPackageCustomSchemasClient, error) + listPackageCustomSchemasMutex sync.RWMutex + listPackageCustomSchemasArgsForCall []struct { + arg1 context.Context + arg2 *api.ListPackageCustomSchemasRequest + arg3 []grpc.CallOption + } + listPackageCustomSchemasReturns struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + } + listPackageCustomSchemasReturnsOnCall map[int]struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + } ListPackagesStub func(context.Context, *api.ListPackageRequest, ...grpc.CallOption) (api.Registry_ListPackagesClient, error) listPackagesMutex sync.RWMutex listPackagesArgsForCall []struct { @@ -172,15 +187,16 @@ func (fake *FakeRegistryClient) GetBundle(arg1 context.Context, arg2 *api.GetBun arg2 *api.GetBundleRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetBundleStub + fakeReturns := fake.getBundleReturns fake.recordInvocation("GetBundle", []interface{}{arg1, arg2, arg3}) fake.getBundleMutex.Unlock() - if fake.GetBundleStub != nil { - return fake.GetBundleStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleReturns return fakeReturns.result1, fakeReturns.result2 } @@ -237,15 +253,16 @@ func (fake *FakeRegistryClient) GetBundleForChannel(arg1 context.Context, arg2 * arg2 *api.GetBundleInChannelRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetBundleForChannelStub + fakeReturns := fake.getBundleForChannelReturns fake.recordInvocation("GetBundleForChannel", []interface{}{arg1, arg2, arg3}) fake.getBundleForChannelMutex.Unlock() - if fake.GetBundleForChannelStub != nil { - return fake.GetBundleForChannelStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleForChannelReturns return fakeReturns.result1, fakeReturns.result2 } @@ -302,15 +319,16 @@ func (fake *FakeRegistryClient) GetBundleThatReplaces(arg1 context.Context, arg2 arg2 *api.GetReplacementRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetBundleThatReplacesStub + fakeReturns := fake.getBundleThatReplacesReturns fake.recordInvocation("GetBundleThatReplaces", []interface{}{arg1, arg2, arg3}) fake.getBundleThatReplacesMutex.Unlock() - if fake.GetBundleThatReplacesStub != nil { - return fake.GetBundleThatReplacesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getBundleThatReplacesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -367,15 +385,16 @@ func (fake *FakeRegistryClient) GetChannelEntriesThatProvide(arg1 context.Contex arg2 *api.GetAllProvidersRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetChannelEntriesThatProvideStub + fakeReturns := fake.getChannelEntriesThatProvideReturns fake.recordInvocation("GetChannelEntriesThatProvide", []interface{}{arg1, arg2, arg3}) fake.getChannelEntriesThatProvideMutex.Unlock() - if fake.GetChannelEntriesThatProvideStub != nil { - return fake.GetChannelEntriesThatProvideStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getChannelEntriesThatProvideReturns return fakeReturns.result1, fakeReturns.result2 } @@ -432,15 +451,16 @@ func (fake *FakeRegistryClient) GetChannelEntriesThatReplace(arg1 context.Contex arg2 *api.GetAllReplacementsRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetChannelEntriesThatReplaceStub + fakeReturns := fake.getChannelEntriesThatReplaceReturns fake.recordInvocation("GetChannelEntriesThatReplace", []interface{}{arg1, arg2, arg3}) fake.getChannelEntriesThatReplaceMutex.Unlock() - if fake.GetChannelEntriesThatReplaceStub != nil { - return fake.GetChannelEntriesThatReplaceStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getChannelEntriesThatReplaceReturns return fakeReturns.result1, fakeReturns.result2 } @@ -497,15 +517,16 @@ func (fake *FakeRegistryClient) GetDefaultBundleThatProvides(arg1 context.Contex arg2 *api.GetDefaultProviderRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetDefaultBundleThatProvidesStub + fakeReturns := fake.getDefaultBundleThatProvidesReturns fake.recordInvocation("GetDefaultBundleThatProvides", []interface{}{arg1, arg2, arg3}) fake.getDefaultBundleThatProvidesMutex.Unlock() - if fake.GetDefaultBundleThatProvidesStub != nil { - return fake.GetDefaultBundleThatProvidesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getDefaultBundleThatProvidesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -562,15 +583,16 @@ func (fake *FakeRegistryClient) GetLatestChannelEntriesThatProvide(arg1 context. arg2 *api.GetLatestProvidersRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetLatestChannelEntriesThatProvideStub + fakeReturns := fake.getLatestChannelEntriesThatProvideReturns fake.recordInvocation("GetLatestChannelEntriesThatProvide", []interface{}{arg1, arg2, arg3}) fake.getLatestChannelEntriesThatProvideMutex.Unlock() - if fake.GetLatestChannelEntriesThatProvideStub != nil { - return fake.GetLatestChannelEntriesThatProvideStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getLatestChannelEntriesThatProvideReturns return fakeReturns.result1, fakeReturns.result2 } @@ -627,15 +649,16 @@ func (fake *FakeRegistryClient) GetPackage(arg1 context.Context, arg2 *api.GetPa arg2 *api.GetPackageRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GetPackageStub + fakeReturns := fake.getPackageReturns fake.recordInvocation("GetPackage", []interface{}{arg1, arg2, arg3}) fake.getPackageMutex.Unlock() - if fake.GetPackageStub != nil { - return fake.GetPackageStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.getPackageReturns return fakeReturns.result1, fakeReturns.result2 } @@ -692,15 +715,16 @@ func (fake *FakeRegistryClient) ListBundles(arg1 context.Context, arg2 *api.List arg2 *api.ListBundlesRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.ListBundlesStub + fakeReturns := fake.listBundlesReturns fake.recordInvocation("ListBundles", []interface{}{arg1, arg2, arg3}) fake.listBundlesMutex.Unlock() - if fake.ListBundlesStub != nil { - return fake.ListBundlesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listBundlesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -749,6 +773,72 @@ func (fake *FakeRegistryClient) ListBundlesReturnsOnCall(i int, result1 api.Regi }{result1, result2} } +func (fake *FakeRegistryClient) ListPackageCustomSchemas(arg1 context.Context, arg2 *api.ListPackageCustomSchemasRequest, arg3 ...grpc.CallOption) (api.Registry_ListPackageCustomSchemasClient, error) { + fake.listPackageCustomSchemasMutex.Lock() + ret, specificReturn := fake.listPackageCustomSchemasReturnsOnCall[len(fake.listPackageCustomSchemasArgsForCall)] + fake.listPackageCustomSchemasArgsForCall = append(fake.listPackageCustomSchemasArgsForCall, struct { + arg1 context.Context + arg2 *api.ListPackageCustomSchemasRequest + arg3 []grpc.CallOption + }{arg1, arg2, arg3}) + stub := fake.ListPackageCustomSchemasStub + fakeReturns := fake.listPackageCustomSchemasReturns + fake.recordInvocation("ListPackageCustomSchemas", []interface{}{arg1, arg2, arg3}) + fake.listPackageCustomSchemasMutex.Unlock() + if stub != nil { + return stub(arg1, arg2, arg3...) + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasCallCount() int { + fake.listPackageCustomSchemasMutex.RLock() + defer fake.listPackageCustomSchemasMutex.RUnlock() + return len(fake.listPackageCustomSchemasArgsForCall) +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasCalls(stub func(context.Context, *api.ListPackageCustomSchemasRequest, ...grpc.CallOption) (api.Registry_ListPackageCustomSchemasClient, error)) { + fake.listPackageCustomSchemasMutex.Lock() + defer fake.listPackageCustomSchemasMutex.Unlock() + fake.ListPackageCustomSchemasStub = stub +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasArgsForCall(i int) (context.Context, *api.ListPackageCustomSchemasRequest, []grpc.CallOption) { + fake.listPackageCustomSchemasMutex.RLock() + defer fake.listPackageCustomSchemasMutex.RUnlock() + argsForCall := fake.listPackageCustomSchemasArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasReturns(result1 api.Registry_ListPackageCustomSchemasClient, result2 error) { + fake.listPackageCustomSchemasMutex.Lock() + defer fake.listPackageCustomSchemasMutex.Unlock() + fake.ListPackageCustomSchemasStub = nil + fake.listPackageCustomSchemasReturns = struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + }{result1, result2} +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasReturnsOnCall(i int, result1 api.Registry_ListPackageCustomSchemasClient, result2 error) { + fake.listPackageCustomSchemasMutex.Lock() + defer fake.listPackageCustomSchemasMutex.Unlock() + fake.ListPackageCustomSchemasStub = nil + if fake.listPackageCustomSchemasReturnsOnCall == nil { + fake.listPackageCustomSchemasReturnsOnCall = make(map[int]struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + }) + } + fake.listPackageCustomSchemasReturnsOnCall[i] = struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + }{result1, result2} +} + func (fake *FakeRegistryClient) ListPackages(arg1 context.Context, arg2 *api.ListPackageRequest, arg3 ...grpc.CallOption) (api.Registry_ListPackagesClient, error) { fake.listPackagesMutex.Lock() ret, specificReturn := fake.listPackagesReturnsOnCall[len(fake.listPackagesArgsForCall)] @@ -757,15 +847,16 @@ func (fake *FakeRegistryClient) ListPackages(arg1 context.Context, arg2 *api.Lis arg2 *api.ListPackageRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.ListPackagesStub + fakeReturns := fake.listPackagesReturns fake.recordInvocation("ListPackages", []interface{}{arg1, arg2, arg3}) fake.listPackagesMutex.Unlock() - if fake.ListPackagesStub != nil { - return fake.ListPackagesStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.listPackagesReturns return fakeReturns.result1, fakeReturns.result2 } @@ -817,26 +908,6 @@ func (fake *FakeRegistryClient) ListPackagesReturnsOnCall(i int, result1 api.Reg func (fake *FakeRegistryClient) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.getBundleMutex.RLock() - defer fake.getBundleMutex.RUnlock() - fake.getBundleForChannelMutex.RLock() - defer fake.getBundleForChannelMutex.RUnlock() - fake.getBundleThatReplacesMutex.RLock() - defer fake.getBundleThatReplacesMutex.RUnlock() - fake.getChannelEntriesThatProvideMutex.RLock() - defer fake.getChannelEntriesThatProvideMutex.RUnlock() - fake.getChannelEntriesThatReplaceMutex.RLock() - defer fake.getChannelEntriesThatReplaceMutex.RUnlock() - fake.getDefaultBundleThatProvidesMutex.RLock() - defer fake.getDefaultBundleThatProvidesMutex.RUnlock() - fake.getLatestChannelEntriesThatProvideMutex.RLock() - defer fake.getLatestChannelEntriesThatProvideMutex.RUnlock() - fake.getPackageMutex.RLock() - defer fake.getPackageMutex.RUnlock() - fake.listBundlesMutex.RLock() - defer fake.listBundlesMutex.RUnlock() - fake.listPackagesMutex.RLock() - defer fake.listPackagesMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go index 657a887ad9..e9b6ae1ecd 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go @@ -4,6 +4,7 @@ import ( "github.com/operator-framework/api/pkg/lib/version" operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" ) // PackageManifestList is a list of PackageManifest objects. @@ -49,6 +50,9 @@ type PackageManifestStatus struct { // Deprecation is an optional field which contains information if the package is deprecated. Deprecation *Deprecation + // CustomSchemas contains raw custom schema data from the catalog, keyed by schema name. + CustomSchemas map[string][]runtime.RawExtension + // Channels are the declared channels for the package, ala . // +listType=set Channels []PackageChannel diff --git a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go index e9cf6a1c16..3fa6cf217a 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go @@ -4,6 +4,7 @@ import ( "github.com/operator-framework/api/pkg/lib/version" operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" ) // PackageManifestList is a list of PackageManifest objects. @@ -49,6 +50,9 @@ type PackageManifestStatus struct { // Deprecation is an optional field which contains information if the package is deprecated. Deprecation *Deprecation `json:"deprecation,omitempty"` + // CustomSchemas contains raw custom schema data from the catalog, keyed by schema name. + CustomSchemas map[string][]runtime.RawExtension `json:"customSchemas,omitempty"` + // Channels are the declared channels for the package, ala `stable` or `alpha`. // +listType=set Channels []PackageChannel `json:"channels"` diff --git a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go index 5ae5b1c988..cb50f1b594 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go @@ -429,6 +429,7 @@ func autoConvert_v1_PackageManifestStatus_To_operators_PackageManifestStatus(in } out.PackageName = in.PackageName out.Deprecation = (*operators.Deprecation)(unsafe.Pointer(in.Deprecation)) + out.CustomSchemas = *(*map[string][]runtime.RawExtension)(unsafe.Pointer(&in.CustomSchemas)) out.Channels = *(*[]operators.PackageChannel)(unsafe.Pointer(&in.Channels)) out.DefaultChannel = in.DefaultChannel return nil @@ -449,6 +450,7 @@ func autoConvert_operators_PackageManifestStatus_To_v1_PackageManifestStatus(in } out.PackageName = in.PackageName out.Deprecation = (*Deprecation)(unsafe.Pointer(in.Deprecation)) + out.CustomSchemas = *(*map[string][]runtime.RawExtension)(unsafe.Pointer(&in.CustomSchemas)) out.Channels = *(*[]PackageChannel)(unsafe.Pointer(&in.Channels)) out.DefaultChannel = in.DefaultChannel return nil diff --git a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go index 45a63e69a1..ab8abeb5c7 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go @@ -289,6 +289,21 @@ func (in *PackageManifestStatus) DeepCopyInto(out *PackageManifestStatus) { *out = new(Deprecation) **out = **in } + if in.CustomSchemas != nil { + in, out := &in.CustomSchemas, &out.CustomSchemas + *out = make(map[string][]runtime.RawExtension, len(*in)) + for key, val := range *in { + var outVal []runtime.RawExtension + if val != nil { + in, out := &val, &outVal + *out = make([]runtime.RawExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + (*out)[key] = outVal + } + } if in.Channels != nil { in, out := &in.Channels, &out.Channels *out = make([]PackageChannel, len(*in)) diff --git a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go index 33a333b2d6..407aeeb53a 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go @@ -289,6 +289,21 @@ func (in *PackageManifestStatus) DeepCopyInto(out *PackageManifestStatus) { *out = new(Deprecation) **out = **in } + if in.CustomSchemas != nil { + in, out := &in.CustomSchemas, &out.CustomSchemas + *out = make(map[string][]runtime.RawExtension, len(*in)) + for key, val := range *in { + var outVal []runtime.RawExtension + if val != nil { + in, out := &val, &outVal + *out = make([]runtime.RawExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + (*out)[key] = outVal + } + } if in.Channels != nil { in, out := &in.Channels, &out.Channels *out = make([]PackageChannel, len(*in)) diff --git a/staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_list_package_custom_schemas_client.go b/staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_list_package_custom_schemas_client.go new file mode 100644 index 0000000000..b0c32e613b --- /dev/null +++ b/staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_list_package_custom_schemas_client.go @@ -0,0 +1,509 @@ +// Code generated by counterfeiter. DO NOT EDIT. +package fakes + +import ( + "context" + "sync" + + "github.com/operator-framework/operator-registry/pkg/api" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/types/known/structpb" +) + +type FakeRegistry_ListPackageCustomSchemasClient struct { + CloseSendStub func() error + closeSendMutex sync.RWMutex + closeSendArgsForCall []struct { + } + closeSendReturns struct { + result1 error + } + closeSendReturnsOnCall map[int]struct { + result1 error + } + ContextStub func() context.Context + contextMutex sync.RWMutex + contextArgsForCall []struct { + } + contextReturns struct { + result1 context.Context + } + contextReturnsOnCall map[int]struct { + result1 context.Context + } + HeaderStub func() (metadata.MD, error) + headerMutex sync.RWMutex + headerArgsForCall []struct { + } + headerReturns struct { + result1 metadata.MD + result2 error + } + headerReturnsOnCall map[int]struct { + result1 metadata.MD + result2 error + } + RecvStub func() (*structpb.Struct, error) + recvMutex sync.RWMutex + recvArgsForCall []struct { + } + recvReturns struct { + result1 *structpb.Struct + result2 error + } + recvReturnsOnCall map[int]struct { + result1 *structpb.Struct + result2 error + } + RecvMsgStub func(any) error + recvMsgMutex sync.RWMutex + recvMsgArgsForCall []struct { + arg1 any + } + recvMsgReturns struct { + result1 error + } + recvMsgReturnsOnCall map[int]struct { + result1 error + } + SendMsgStub func(any) error + sendMsgMutex sync.RWMutex + sendMsgArgsForCall []struct { + arg1 any + } + sendMsgReturns struct { + result1 error + } + sendMsgReturnsOnCall map[int]struct { + result1 error + } + TrailerStub func() metadata.MD + trailerMutex sync.RWMutex + trailerArgsForCall []struct { + } + trailerReturns struct { + result1 metadata.MD + } + trailerReturnsOnCall map[int]struct { + result1 metadata.MD + } + invocations map[string][][]interface{} + invocationsMutex sync.RWMutex +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) CloseSend() error { + fake.closeSendMutex.Lock() + ret, specificReturn := fake.closeSendReturnsOnCall[len(fake.closeSendArgsForCall)] + fake.closeSendArgsForCall = append(fake.closeSendArgsForCall, struct { + }{}) + stub := fake.CloseSendStub + fakeReturns := fake.closeSendReturns + fake.recordInvocation("CloseSend", []interface{}{}) + fake.closeSendMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) CloseSendCallCount() int { + fake.closeSendMutex.RLock() + defer fake.closeSendMutex.RUnlock() + return len(fake.closeSendArgsForCall) +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) CloseSendCalls(stub func() error) { + fake.closeSendMutex.Lock() + defer fake.closeSendMutex.Unlock() + fake.CloseSendStub = stub +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) CloseSendReturns(result1 error) { + fake.closeSendMutex.Lock() + defer fake.closeSendMutex.Unlock() + fake.CloseSendStub = nil + fake.closeSendReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) CloseSendReturnsOnCall(i int, result1 error) { + fake.closeSendMutex.Lock() + defer fake.closeSendMutex.Unlock() + fake.CloseSendStub = nil + if fake.closeSendReturnsOnCall == nil { + fake.closeSendReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.closeSendReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) Context() context.Context { + fake.contextMutex.Lock() + ret, specificReturn := fake.contextReturnsOnCall[len(fake.contextArgsForCall)] + fake.contextArgsForCall = append(fake.contextArgsForCall, struct { + }{}) + stub := fake.ContextStub + fakeReturns := fake.contextReturns + fake.recordInvocation("Context", []interface{}{}) + fake.contextMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) ContextCallCount() int { + fake.contextMutex.RLock() + defer fake.contextMutex.RUnlock() + return len(fake.contextArgsForCall) +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) ContextCalls(stub func() context.Context) { + fake.contextMutex.Lock() + defer fake.contextMutex.Unlock() + fake.ContextStub = stub +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) ContextReturns(result1 context.Context) { + fake.contextMutex.Lock() + defer fake.contextMutex.Unlock() + fake.ContextStub = nil + fake.contextReturns = struct { + result1 context.Context + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) ContextReturnsOnCall(i int, result1 context.Context) { + fake.contextMutex.Lock() + defer fake.contextMutex.Unlock() + fake.ContextStub = nil + if fake.contextReturnsOnCall == nil { + fake.contextReturnsOnCall = make(map[int]struct { + result1 context.Context + }) + } + fake.contextReturnsOnCall[i] = struct { + result1 context.Context + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) Header() (metadata.MD, error) { + fake.headerMutex.Lock() + ret, specificReturn := fake.headerReturnsOnCall[len(fake.headerArgsForCall)] + fake.headerArgsForCall = append(fake.headerArgsForCall, struct { + }{}) + stub := fake.HeaderStub + fakeReturns := fake.headerReturns + fake.recordInvocation("Header", []interface{}{}) + fake.headerMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) HeaderCallCount() int { + fake.headerMutex.RLock() + defer fake.headerMutex.RUnlock() + return len(fake.headerArgsForCall) +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) HeaderCalls(stub func() (metadata.MD, error)) { + fake.headerMutex.Lock() + defer fake.headerMutex.Unlock() + fake.HeaderStub = stub +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) HeaderReturns(result1 metadata.MD, result2 error) { + fake.headerMutex.Lock() + defer fake.headerMutex.Unlock() + fake.HeaderStub = nil + fake.headerReturns = struct { + result1 metadata.MD + result2 error + }{result1, result2} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) HeaderReturnsOnCall(i int, result1 metadata.MD, result2 error) { + fake.headerMutex.Lock() + defer fake.headerMutex.Unlock() + fake.HeaderStub = nil + if fake.headerReturnsOnCall == nil { + fake.headerReturnsOnCall = make(map[int]struct { + result1 metadata.MD + result2 error + }) + } + fake.headerReturnsOnCall[i] = struct { + result1 metadata.MD + result2 error + }{result1, result2} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) Recv() (*structpb.Struct, error) { + fake.recvMutex.Lock() + ret, specificReturn := fake.recvReturnsOnCall[len(fake.recvArgsForCall)] + fake.recvArgsForCall = append(fake.recvArgsForCall, struct { + }{}) + stub := fake.RecvStub + fakeReturns := fake.recvReturns + fake.recordInvocation("Recv", []interface{}{}) + fake.recvMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvCallCount() int { + fake.recvMutex.RLock() + defer fake.recvMutex.RUnlock() + return len(fake.recvArgsForCall) +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvCalls(stub func() (*structpb.Struct, error)) { + fake.recvMutex.Lock() + defer fake.recvMutex.Unlock() + fake.RecvStub = stub +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvReturns(result1 *structpb.Struct, result2 error) { + fake.recvMutex.Lock() + defer fake.recvMutex.Unlock() + fake.RecvStub = nil + fake.recvReturns = struct { + result1 *structpb.Struct + result2 error + }{result1, result2} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvReturnsOnCall(i int, result1 *structpb.Struct, result2 error) { + fake.recvMutex.Lock() + defer fake.recvMutex.Unlock() + fake.RecvStub = nil + if fake.recvReturnsOnCall == nil { + fake.recvReturnsOnCall = make(map[int]struct { + result1 *structpb.Struct + result2 error + }) + } + fake.recvReturnsOnCall[i] = struct { + result1 *structpb.Struct + result2 error + }{result1, result2} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvMsg(arg1 any) error { + fake.recvMsgMutex.Lock() + ret, specificReturn := fake.recvMsgReturnsOnCall[len(fake.recvMsgArgsForCall)] + fake.recvMsgArgsForCall = append(fake.recvMsgArgsForCall, struct { + arg1 any + }{arg1}) + stub := fake.RecvMsgStub + fakeReturns := fake.recvMsgReturns + fake.recordInvocation("RecvMsg", []interface{}{arg1}) + fake.recvMsgMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvMsgCallCount() int { + fake.recvMsgMutex.RLock() + defer fake.recvMsgMutex.RUnlock() + return len(fake.recvMsgArgsForCall) +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvMsgCalls(stub func(any) error) { + fake.recvMsgMutex.Lock() + defer fake.recvMsgMutex.Unlock() + fake.RecvMsgStub = stub +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvMsgArgsForCall(i int) any { + fake.recvMsgMutex.RLock() + defer fake.recvMsgMutex.RUnlock() + argsForCall := fake.recvMsgArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvMsgReturns(result1 error) { + fake.recvMsgMutex.Lock() + defer fake.recvMsgMutex.Unlock() + fake.RecvMsgStub = nil + fake.recvMsgReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) RecvMsgReturnsOnCall(i int, result1 error) { + fake.recvMsgMutex.Lock() + defer fake.recvMsgMutex.Unlock() + fake.RecvMsgStub = nil + if fake.recvMsgReturnsOnCall == nil { + fake.recvMsgReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.recvMsgReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) SendMsg(arg1 any) error { + fake.sendMsgMutex.Lock() + ret, specificReturn := fake.sendMsgReturnsOnCall[len(fake.sendMsgArgsForCall)] + fake.sendMsgArgsForCall = append(fake.sendMsgArgsForCall, struct { + arg1 any + }{arg1}) + stub := fake.SendMsgStub + fakeReturns := fake.sendMsgReturns + fake.recordInvocation("SendMsg", []interface{}{arg1}) + fake.sendMsgMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) SendMsgCallCount() int { + fake.sendMsgMutex.RLock() + defer fake.sendMsgMutex.RUnlock() + return len(fake.sendMsgArgsForCall) +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) SendMsgCalls(stub func(any) error) { + fake.sendMsgMutex.Lock() + defer fake.sendMsgMutex.Unlock() + fake.SendMsgStub = stub +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) SendMsgArgsForCall(i int) any { + fake.sendMsgMutex.RLock() + defer fake.sendMsgMutex.RUnlock() + argsForCall := fake.sendMsgArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) SendMsgReturns(result1 error) { + fake.sendMsgMutex.Lock() + defer fake.sendMsgMutex.Unlock() + fake.SendMsgStub = nil + fake.sendMsgReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) SendMsgReturnsOnCall(i int, result1 error) { + fake.sendMsgMutex.Lock() + defer fake.sendMsgMutex.Unlock() + fake.SendMsgStub = nil + if fake.sendMsgReturnsOnCall == nil { + fake.sendMsgReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.sendMsgReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) Trailer() metadata.MD { + fake.trailerMutex.Lock() + ret, specificReturn := fake.trailerReturnsOnCall[len(fake.trailerArgsForCall)] + fake.trailerArgsForCall = append(fake.trailerArgsForCall, struct { + }{}) + stub := fake.TrailerStub + fakeReturns := fake.trailerReturns + fake.recordInvocation("Trailer", []interface{}{}) + fake.trailerMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) TrailerCallCount() int { + fake.trailerMutex.RLock() + defer fake.trailerMutex.RUnlock() + return len(fake.trailerArgsForCall) +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) TrailerCalls(stub func() metadata.MD) { + fake.trailerMutex.Lock() + defer fake.trailerMutex.Unlock() + fake.TrailerStub = stub +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) TrailerReturns(result1 metadata.MD) { + fake.trailerMutex.Lock() + defer fake.trailerMutex.Unlock() + fake.TrailerStub = nil + fake.trailerReturns = struct { + result1 metadata.MD + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) TrailerReturnsOnCall(i int, result1 metadata.MD) { + fake.trailerMutex.Lock() + defer fake.trailerMutex.Unlock() + fake.TrailerStub = nil + if fake.trailerReturnsOnCall == nil { + fake.trailerReturnsOnCall = make(map[int]struct { + result1 metadata.MD + }) + } + fake.trailerReturnsOnCall[i] = struct { + result1 metadata.MD + }{result1} +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) Invocations() map[string][][]interface{} { + fake.invocationsMutex.RLock() + defer fake.invocationsMutex.RUnlock() + copiedInvocations := map[string][][]interface{}{} + for key, value := range fake.invocations { + copiedInvocations[key] = value + } + return copiedInvocations +} + +func (fake *FakeRegistry_ListPackageCustomSchemasClient) recordInvocation(key string, args []interface{}) { + fake.invocationsMutex.Lock() + defer fake.invocationsMutex.Unlock() + if fake.invocations == nil { + fake.invocations = map[string][][]interface{}{} + } + if fake.invocations[key] == nil { + fake.invocations[key] = [][]interface{}{} + } + fake.invocations[key] = append(fake.invocations[key], args) +} + +var _ api.Registry_ListPackageCustomSchemasClient = new(FakeRegistry_ListPackageCustomSchemasClient) diff --git a/staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_registry_client.go b/staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_registry_client.go index 30416a2bc1..bd436c0a1f 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_registry_client.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_registry_client.go @@ -145,6 +145,21 @@ type FakeRegistryClient struct { result1 api.Registry_ListBundlesClient result2 error } + ListPackageCustomSchemasStub func(context.Context, *api.ListPackageCustomSchemasRequest, ...grpc.CallOption) (api.Registry_ListPackageCustomSchemasClient, error) + listPackageCustomSchemasMutex sync.RWMutex + listPackageCustomSchemasArgsForCall []struct { + arg1 context.Context + arg2 *api.ListPackageCustomSchemasRequest + arg3 []grpc.CallOption + } + listPackageCustomSchemasReturns struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + } + listPackageCustomSchemasReturnsOnCall map[int]struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + } ListPackagesStub func(context.Context, *api.ListPackageRequest, ...grpc.CallOption) (api.Registry_ListPackagesClient, error) listPackagesMutex sync.RWMutex listPackagesArgsForCall []struct { @@ -758,6 +773,72 @@ func (fake *FakeRegistryClient) ListBundlesReturnsOnCall(i int, result1 api.Regi }{result1, result2} } +func (fake *FakeRegistryClient) ListPackageCustomSchemas(arg1 context.Context, arg2 *api.ListPackageCustomSchemasRequest, arg3 ...grpc.CallOption) (api.Registry_ListPackageCustomSchemasClient, error) { + fake.listPackageCustomSchemasMutex.Lock() + ret, specificReturn := fake.listPackageCustomSchemasReturnsOnCall[len(fake.listPackageCustomSchemasArgsForCall)] + fake.listPackageCustomSchemasArgsForCall = append(fake.listPackageCustomSchemasArgsForCall, struct { + arg1 context.Context + arg2 *api.ListPackageCustomSchemasRequest + arg3 []grpc.CallOption + }{arg1, arg2, arg3}) + stub := fake.ListPackageCustomSchemasStub + fakeReturns := fake.listPackageCustomSchemasReturns + fake.recordInvocation("ListPackageCustomSchemas", []interface{}{arg1, arg2, arg3}) + fake.listPackageCustomSchemasMutex.Unlock() + if stub != nil { + return stub(arg1, arg2, arg3...) + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasCallCount() int { + fake.listPackageCustomSchemasMutex.RLock() + defer fake.listPackageCustomSchemasMutex.RUnlock() + return len(fake.listPackageCustomSchemasArgsForCall) +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasCalls(stub func(context.Context, *api.ListPackageCustomSchemasRequest, ...grpc.CallOption) (api.Registry_ListPackageCustomSchemasClient, error)) { + fake.listPackageCustomSchemasMutex.Lock() + defer fake.listPackageCustomSchemasMutex.Unlock() + fake.ListPackageCustomSchemasStub = stub +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasArgsForCall(i int) (context.Context, *api.ListPackageCustomSchemasRequest, []grpc.CallOption) { + fake.listPackageCustomSchemasMutex.RLock() + defer fake.listPackageCustomSchemasMutex.RUnlock() + argsForCall := fake.listPackageCustomSchemasArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasReturns(result1 api.Registry_ListPackageCustomSchemasClient, result2 error) { + fake.listPackageCustomSchemasMutex.Lock() + defer fake.listPackageCustomSchemasMutex.Unlock() + fake.ListPackageCustomSchemasStub = nil + fake.listPackageCustomSchemasReturns = struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + }{result1, result2} +} + +func (fake *FakeRegistryClient) ListPackageCustomSchemasReturnsOnCall(i int, result1 api.Registry_ListPackageCustomSchemasClient, result2 error) { + fake.listPackageCustomSchemasMutex.Lock() + defer fake.listPackageCustomSchemasMutex.Unlock() + fake.ListPackageCustomSchemasStub = nil + if fake.listPackageCustomSchemasReturnsOnCall == nil { + fake.listPackageCustomSchemasReturnsOnCall = make(map[int]struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + }) + } + fake.listPackageCustomSchemasReturnsOnCall[i] = struct { + result1 api.Registry_ListPackageCustomSchemasClient + result2 error + }{result1, result2} +} + func (fake *FakeRegistryClient) ListPackages(arg1 context.Context, arg2 *api.ListPackageRequest, arg3 ...grpc.CallOption) (api.Registry_ListPackagesClient, error) { fake.listPackagesMutex.Lock() ret, specificReturn := fake.listPackagesReturnsOnCall[len(fake.listPackagesArgsForCall)] diff --git a/staging/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go b/staging/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go index 38cf1b474e..c0bcded225 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go @@ -4018,6 +4018,27 @@ func schema_package_server_apis_operators_v1_PackageManifestStatus(ref common.Re Ref: ref(v1.Deprecation{}.OpenAPIModelName()), }, }, + "customSchemas": { + SchemaProps: spec.SchemaProps{ + Description: "CustomSchemas contains raw custom schema data from the catalog, keyed by schema name.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref(runtime.RawExtension{}.OpenAPIModelName()), + }, + }, + }, + }, + }, + }, + }, + }, "channels": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -4050,7 +4071,7 @@ func schema_package_server_apis_operators_v1_PackageManifestStatus(ref common.Re }, }, Dependencies: []string{ - v1.AppLink{}.OpenAPIModelName(), v1.Deprecation{}.OpenAPIModelName(), v1.PackageChannel{}.OpenAPIModelName()}, + v1.AppLink{}.OpenAPIModelName(), v1.Deprecation{}.OpenAPIModelName(), v1.PackageChannel{}.OpenAPIModelName(), runtime.RawExtension{}.OpenAPIModelName()}, } } diff --git a/staging/operator-lifecycle-manager/pkg/package-server/provider/registry.go b/staging/operator-lifecycle-manager/pkg/package-server/provider/registry.go index 1dad37c048..388748adc3 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/provider/registry.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/provider/registry.go @@ -17,7 +17,9 @@ import ( "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/connectivity" + "google.golang.org/protobuf/encoding/protojson" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/labels" utilerrors "k8s.io/apimachinery/pkg/util/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -119,6 +121,7 @@ type RegistryProvider struct { runOnce sync.Once globalNamespace string + customSchemas []string sources *registrygrpc.SourceStore cache cache.Indexer pkgLister pkglisters.PackageManifestLister @@ -127,11 +130,12 @@ type RegistryProvider struct { var _ PackageManifestProvider = &RegistryProvider{} -func NewRegistryProvider(ctx context.Context, crClient versioned.Interface, operator queueinformer.Operator, wakeupInterval time.Duration, globalNamespace string) (*RegistryProvider, error) { +func NewRegistryProvider(ctx context.Context, crClient versioned.Interface, operator queueinformer.Operator, wakeupInterval time.Duration, globalNamespace string, customSchemas []string) (*RegistryProvider, error) { p := &RegistryProvider{ Operator: operator, globalNamespace: globalNamespace, + customSchemas: customSchemas, cache: cache.NewIndexer(PackageManifestKeyFunc, cache.Indexers{ cache.NamespaceIndex: cache.MetaNamespaceIndexFunc, catalogIndex: catalogIndexFunc, @@ -342,6 +346,34 @@ func (p *RegistryProvider) refreshCache(ctx context.Context, client *registryCli } } + // Pre-fetch custom schemas per package. On first error (e.g. Unimplemented), log once and skip the rest. + var customSchemasByPkg map[string]map[string][]runtime.RawExtension + if len(p.customSchemas) > 0 { + customSchemasByPkg = map[string]map[string][]runtime.RawExtension{} + for pkgName := range bundles { + for _, schema := range p.customSchemas { + schemas, err := fetchCustomSchemas(ctx, client, pkgName, schema) + if err != nil { + logger.WithError(err).Warn("registry does not support custom schemas, skipping for this source") + customSchemasByPkg = nil + break + } + if len(schemas) > 0 { + if customSchemasByPkg[pkgName] == nil { + customSchemasByPkg[pkgName] = schemas + } else { + for k, v := range schemas { + customSchemasByPkg[pkgName][k] = v + } + } + } + } + if customSchemasByPkg == nil { + break + } + } + } + var ( added = map[string]struct{}{} mu sync.Mutex @@ -366,7 +398,7 @@ func (p *RegistryProvider) refreshCache(ctx context.Context, client *registryCli return } - newPkg, err := newPackageManifest(ctx, logger, pkg, client, bundles[pkg.GetName()]) + newPkg, err := newPackageManifest(ctx, logger, pkg, client, bundles[pkg.GetName()], customSchemasByPkg[pkg.GetName()]) if err != nil { logger.WithField("err", err.Error()).Warnf("eliding package: error converting to packagemanifest") return @@ -400,6 +432,42 @@ func isDeprecated(b *api.Bundle) bool { return false } +func fetchCustomSchemas(ctx context.Context, client *registryClient, packageName, schema string) (map[string][]runtime.RawExtension, error) { + stream, err := client.ListPackageCustomSchemas(ctx, &api.ListPackageCustomSchemasRequest{ + Schema: schema, + PackageName: packageName, + }) + if err != nil { + return nil, err + } + if stream == nil { + return nil, nil + } + + var result map[string][]runtime.RawExtension + for { + obj, err := stream.Recv() + if err == io.EOF { + break + } + if err != nil { + return nil, err + } + + raw, err := protojson.Marshal(obj) + if err != nil { + return nil, fmt.Errorf("failed to marshal custom schema object: %w", err) + } + + if result == nil { + result = make(map[string][]runtime.RawExtension) + } + result[schema] = append(result[schema], runtime.RawExtension{Raw: raw}) + } + + return result, nil +} + func (p *RegistryProvider) gcPackages(key registry.CatalogKey, keep map[string]struct{}) error { logger := logrus.WithFields(logrus.Fields{ "action": "gc cache", @@ -522,7 +590,7 @@ func (p *RegistryProvider) List(namespace string, selector labels.Selector) (*op return pkgList, nil } -func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Package, client *registryClient, entriesByChannel map[string][]operators.ChannelEntry) (*operators.PackageManifest, error) { +func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Package, client *registryClient, entriesByChannel map[string][]operators.ChannelEntry, customSchemas map[string][]runtime.RawExtension) (*operators.PackageManifest, error) { pkgChannels := pkg.GetChannels() sort.Slice(pkgChannels, func(i, j int) bool { return pkgChannels[i].Name < pkgChannels[j].Name @@ -600,6 +668,11 @@ func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Pack logger.Warn("default channel elided, setting as first in packagemanifest") manifest.Status.DefaultChannel = manifest.Status.Channels[0].Name } + + if len(customSchemas) > 0 { + manifest.Status.CustomSchemas = customSchemas + } + manifestLabels := manifest.GetLabels() for k, v := range defaultCsv.GetLabels() { manifestLabels[k] = v diff --git a/staging/operator-lifecycle-manager/pkg/package-server/provider/registry_test.go b/staging/operator-lifecycle-manager/pkg/package-server/provider/registry_test.go index 342bc82793..686fd8899c 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/provider/registry_test.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/provider/registry_test.go @@ -1,6 +1,7 @@ //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -o ../client/fakes/fake_registry_client.go github.com/operator-framework/operator-registry/pkg/api.RegistryClient //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -o ../client/fakes/fake_list_packages_client.go github.com/operator-framework/operator-registry/pkg/api.Registry_ListPackagesClient //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -o ../client/fakes/fake_list_bundles_client.go github.com/operator-framework/operator-registry/pkg/api.Registry_ListBundlesClient +//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -o ../client/fakes/fake_list_package_custom_schemas_client.go github.com/operator-framework/operator-registry/pkg/api.Registry_ListPackageCustomSchemasClient package provider import ( @@ -23,6 +24,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/types/known/structpb" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -100,7 +103,7 @@ func NewFakeRegistryProvider(ctx context.Context, clientObjs []runtime.Object, k resyncInterval := 5 * time.Minute - return NewRegistryProvider(ctx, clientFake, op, resyncInterval, globalNamespace) + return NewRegistryProvider(ctx, clientFake, op, resyncInterval, globalNamespace, nil) } func catalogSource(name, namespace string) *operatorsv1alpha1.CatalogSource { @@ -827,7 +830,7 @@ func TestToPackageManifest(t *testing.T) { catsrc: test.catalogSource, } - packageManifest, err := newPackageManifest(context.Background(), logrus.NewEntry(logrus.New()), test.apiPkg, client, test.channelEntries) + packageManifest, err := newPackageManifest(context.Background(), logrus.NewEntry(logrus.New()), test.apiPkg, client, test.channelEntries, nil) if test.expectedErr != "" { require.Error(t, err) require.Equal(t, test.expectedErr, err.Error()) @@ -839,6 +842,118 @@ func TestToPackageManifest(t *testing.T) { } } +func TestFetchCustomSchemas(t *testing.T) { + tests := []struct { + name string + schema string + packageName string + streamObjs []*structpb.Struct + rpcErr error + expected map[string][]runtime.RawExtension + expectedErr bool + }{ + { + name: "HappyPath/SingleObject", + schema: "io.openshift.operators.lifecycles.v1alpha1", + packageName: "testpkg", + streamObjs: []*structpb.Struct{ + {Fields: map[string]*structpb.Value{ + "schema": structpb.NewStringValue("io.openshift.operators.lifecycles.v1alpha1"), + "package": structpb.NewStringValue("testpkg"), + }}, + }, + expected: func() map[string][]runtime.RawExtension { + obj := &structpb.Struct{Fields: map[string]*structpb.Value{ + "schema": structpb.NewStringValue("io.openshift.operators.lifecycles.v1alpha1"), + "package": structpb.NewStringValue("testpkg"), + }} + raw, _ := protojson.Marshal(obj) + return map[string][]runtime.RawExtension{ + "io.openshift.operators.lifecycles.v1alpha1": {{Raw: raw}}, + } + }(), + }, + { + name: "HappyPath/MultipleObjects", + schema: "io.openshift.operators.lifecycles.v1alpha1", + packageName: "testpkg", + streamObjs: []*structpb.Struct{ + {Fields: map[string]*structpb.Value{ + "schema": structpb.NewStringValue("io.openshift.operators.lifecycles.v1alpha1"), + "name": structpb.NewStringValue("obj1"), + }}, + {Fields: map[string]*structpb.Value{ + "schema": structpb.NewStringValue("io.openshift.operators.lifecycles.v1alpha1"), + "name": structpb.NewStringValue("obj2"), + }}, + }, + expected: func() map[string][]runtime.RawExtension { + obj1 := &structpb.Struct{Fields: map[string]*structpb.Value{ + "schema": structpb.NewStringValue("io.openshift.operators.lifecycles.v1alpha1"), + "name": structpb.NewStringValue("obj1"), + }} + obj2 := &structpb.Struct{Fields: map[string]*structpb.Value{ + "schema": structpb.NewStringValue("io.openshift.operators.lifecycles.v1alpha1"), + "name": structpb.NewStringValue("obj2"), + }} + raw1, _ := protojson.Marshal(obj1) + raw2, _ := protojson.Marshal(obj2) + return map[string][]runtime.RawExtension{ + "io.openshift.operators.lifecycles.v1alpha1": {{Raw: raw1}, {Raw: raw2}}, + } + }(), + }, + { + name: "EmptyStream", + schema: "io.openshift.operators.lifecycles.v1alpha1", + packageName: "testpkg", + streamObjs: nil, + expected: nil, + }, + { + name: "RPCError", + schema: "io.openshift.operators.lifecycles.v1alpha1", + packageName: "testpkg", + rpcErr: fmt.Errorf("rpc error: unimplemented"), + expectedErr: true, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + clientFake := &fakes.FakeRegistryClient{} + streamFake := &fakes.FakeRegistry_ListPackageCustomSchemasClient{} + + if test.rpcErr != nil { + clientFake.ListPackageCustomSchemasReturns(nil, test.rpcErr) + } else { + clientFake.ListPackageCustomSchemasReturns(streamFake, nil) + callCount := 0 + streamFake.RecvStub = func() (*structpb.Struct, error) { + if callCount >= len(test.streamObjs) { + return nil, io.EOF + } + obj := test.streamObjs[callCount] + callCount++ + return obj, nil + } + } + + client := ®istryClient{ + RegistryClient: clientFake, + } + + result, err := fetchCustomSchemas(context.Background(), client, test.packageName, test.schema) + if test.expectedErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, test.expected, result) + } + }) + } +} + func TestPackageManifestChannelsDisplayOrder(t *testing.T) { apiPkg := &api.Package{ Name: "etcd", @@ -885,7 +1000,7 @@ func TestPackageManifestChannelsDisplayOrder(t *testing.T) { catsrc: catalogSource("cool-operators", "ns"), } - packageManifest, err := newPackageManifest(context.Background(), logrus.NewEntry(logrus.New()), apiPkg, client, nil) + packageManifest, err := newPackageManifest(context.Background(), logrus.NewEntry(logrus.New()), apiPkg, client, nil, nil) require.NoError(t, err) require.Equal(t, &operators.PackageManifest{ ObjectMeta: metav1.ObjectMeta{ diff --git a/staging/operator-lifecycle-manager/pkg/package-server/server/server.go b/staging/operator-lifecycle-manager/pkg/package-server/server/server.go index 81ea882c78..665f5d24ae 100644 --- a/staging/operator-lifecycle-manager/pkg/package-server/server/server.go +++ b/staging/operator-lifecycle-manager/pkg/package-server/server/server.go @@ -59,6 +59,7 @@ func NewCommandStartPackageServer(ctx context.Context, defaults *PackageServerOp flags.StringVar(&defaults.GlobalNamespace, "global-namespace", defaults.GlobalNamespace, "Name of the namespace where the global CatalogSources are located") flags.StringVar(&defaults.Kubeconfig, "kubeconfig", defaults.Kubeconfig, "path to the kubeconfig used to connect to the Kubernetes API server and the Kubelets (defaults to in-cluster config)") flags.BoolVar(&defaults.Debug, "debug", defaults.Debug, "use debug log level") + flags.StringSliceVar(&defaults.CustomSchemas, "custom-schemas", defaults.CustomSchemas, "comma-separated list of custom schema names to query from catalog registries") defaults.SecureServing.AddFlags(flags) defaults.Authentication.AddFlags(flags) @@ -81,6 +82,9 @@ type PackageServerOptions struct { Kubeconfig string RegistryAddr string + // Custom schemas to query from CatalogSource registries + CustomSchemas []string + // Only to be used to for testing DisableAuthForTesting bool @@ -281,7 +285,7 @@ func (o *PackageServerOptions) Run(ctx context.Context) error { } } - sourceProvider, err := provider.NewRegistryProvider(ctx, crClient, queueOperator, o.CurrentSyncInterval, o.GlobalNamespace) + sourceProvider, err := provider.NewRegistryProvider(ctx, crClient, queueOperator, o.CurrentSyncInterval, o.GlobalNamespace, o.CustomSchemas) if err != nil { return err } diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go index 657a887ad9..e9b6ae1ecd 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/packagemanifest_types.go @@ -4,6 +4,7 @@ import ( "github.com/operator-framework/api/pkg/lib/version" operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" ) // PackageManifestList is a list of PackageManifest objects. @@ -49,6 +50,9 @@ type PackageManifestStatus struct { // Deprecation is an optional field which contains information if the package is deprecated. Deprecation *Deprecation + // CustomSchemas contains raw custom schema data from the catalog, keyed by schema name. + CustomSchemas map[string][]runtime.RawExtension + // Channels are the declared channels for the package, ala . // +listType=set Channels []PackageChannel diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go index e9cf6a1c16..3fa6cf217a 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/packagemanifest_types.go @@ -4,6 +4,7 @@ import ( "github.com/operator-framework/api/pkg/lib/version" operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" ) // PackageManifestList is a list of PackageManifest objects. @@ -49,6 +50,9 @@ type PackageManifestStatus struct { // Deprecation is an optional field which contains information if the package is deprecated. Deprecation *Deprecation `json:"deprecation,omitempty"` + // CustomSchemas contains raw custom schema data from the catalog, keyed by schema name. + CustomSchemas map[string][]runtime.RawExtension `json:"customSchemas,omitempty"` + // Channels are the declared channels for the package, ala `stable` or `alpha`. // +listType=set Channels []PackageChannel `json:"channels"` diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go index 5ae5b1c988..cb50f1b594 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.conversion.go @@ -429,6 +429,7 @@ func autoConvert_v1_PackageManifestStatus_To_operators_PackageManifestStatus(in } out.PackageName = in.PackageName out.Deprecation = (*operators.Deprecation)(unsafe.Pointer(in.Deprecation)) + out.CustomSchemas = *(*map[string][]runtime.RawExtension)(unsafe.Pointer(&in.CustomSchemas)) out.Channels = *(*[]operators.PackageChannel)(unsafe.Pointer(&in.Channels)) out.DefaultChannel = in.DefaultChannel return nil @@ -449,6 +450,7 @@ func autoConvert_operators_PackageManifestStatus_To_v1_PackageManifestStatus(in } out.PackageName = in.PackageName out.Deprecation = (*Deprecation)(unsafe.Pointer(in.Deprecation)) + out.CustomSchemas = *(*map[string][]runtime.RawExtension)(unsafe.Pointer(&in.CustomSchemas)) out.Channels = *(*[]PackageChannel)(unsafe.Pointer(&in.Channels)) out.DefaultChannel = in.DefaultChannel return nil diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go index 45a63e69a1..ab8abeb5c7 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go @@ -289,6 +289,21 @@ func (in *PackageManifestStatus) DeepCopyInto(out *PackageManifestStatus) { *out = new(Deprecation) **out = **in } + if in.CustomSchemas != nil { + in, out := &in.CustomSchemas, &out.CustomSchemas + *out = make(map[string][]runtime.RawExtension, len(*in)) + for key, val := range *in { + var outVal []runtime.RawExtension + if val != nil { + in, out := &val, &outVal + *out = make([]runtime.RawExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + (*out)[key] = outVal + } + } if in.Channels != nil { in, out := &in.Channels, &out.Channels *out = make([]PackageChannel, len(*in)) diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go index 33a333b2d6..407aeeb53a 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/zz_generated.deepcopy.go @@ -289,6 +289,21 @@ func (in *PackageManifestStatus) DeepCopyInto(out *PackageManifestStatus) { *out = new(Deprecation) **out = **in } + if in.CustomSchemas != nil { + in, out := &in.CustomSchemas, &out.CustomSchemas + *out = make(map[string][]runtime.RawExtension, len(*in)) + for key, val := range *in { + var outVal []runtime.RawExtension + if val != nil { + in, out := &val, &outVal + *out = make([]runtime.RawExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + (*out)[key] = outVal + } + } if in.Channels != nil { in, out := &in.Channels, &out.Channels *out = make([]PackageChannel, len(*in)) diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go index 38cf1b474e..c0bcded225 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/openapi/zz_generated.openapi.go @@ -4018,6 +4018,27 @@ func schema_package_server_apis_operators_v1_PackageManifestStatus(ref common.Re Ref: ref(v1.Deprecation{}.OpenAPIModelName()), }, }, + "customSchemas": { + SchemaProps: spec.SchemaProps{ + Description: "CustomSchemas contains raw custom schema data from the catalog, keyed by schema name.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref(runtime.RawExtension{}.OpenAPIModelName()), + }, + }, + }, + }, + }, + }, + }, + }, "channels": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -4050,7 +4071,7 @@ func schema_package_server_apis_operators_v1_PackageManifestStatus(ref common.Re }, }, Dependencies: []string{ - v1.AppLink{}.OpenAPIModelName(), v1.Deprecation{}.OpenAPIModelName(), v1.PackageChannel{}.OpenAPIModelName()}, + v1.AppLink{}.OpenAPIModelName(), v1.Deprecation{}.OpenAPIModelName(), v1.PackageChannel{}.OpenAPIModelName(), runtime.RawExtension{}.OpenAPIModelName()}, } } diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go index 1dad37c048..388748adc3 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go @@ -17,7 +17,9 @@ import ( "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/connectivity" + "google.golang.org/protobuf/encoding/protojson" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/labels" utilerrors "k8s.io/apimachinery/pkg/util/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -119,6 +121,7 @@ type RegistryProvider struct { runOnce sync.Once globalNamespace string + customSchemas []string sources *registrygrpc.SourceStore cache cache.Indexer pkgLister pkglisters.PackageManifestLister @@ -127,11 +130,12 @@ type RegistryProvider struct { var _ PackageManifestProvider = &RegistryProvider{} -func NewRegistryProvider(ctx context.Context, crClient versioned.Interface, operator queueinformer.Operator, wakeupInterval time.Duration, globalNamespace string) (*RegistryProvider, error) { +func NewRegistryProvider(ctx context.Context, crClient versioned.Interface, operator queueinformer.Operator, wakeupInterval time.Duration, globalNamespace string, customSchemas []string) (*RegistryProvider, error) { p := &RegistryProvider{ Operator: operator, globalNamespace: globalNamespace, + customSchemas: customSchemas, cache: cache.NewIndexer(PackageManifestKeyFunc, cache.Indexers{ cache.NamespaceIndex: cache.MetaNamespaceIndexFunc, catalogIndex: catalogIndexFunc, @@ -342,6 +346,34 @@ func (p *RegistryProvider) refreshCache(ctx context.Context, client *registryCli } } + // Pre-fetch custom schemas per package. On first error (e.g. Unimplemented), log once and skip the rest. + var customSchemasByPkg map[string]map[string][]runtime.RawExtension + if len(p.customSchemas) > 0 { + customSchemasByPkg = map[string]map[string][]runtime.RawExtension{} + for pkgName := range bundles { + for _, schema := range p.customSchemas { + schemas, err := fetchCustomSchemas(ctx, client, pkgName, schema) + if err != nil { + logger.WithError(err).Warn("registry does not support custom schemas, skipping for this source") + customSchemasByPkg = nil + break + } + if len(schemas) > 0 { + if customSchemasByPkg[pkgName] == nil { + customSchemasByPkg[pkgName] = schemas + } else { + for k, v := range schemas { + customSchemasByPkg[pkgName][k] = v + } + } + } + } + if customSchemasByPkg == nil { + break + } + } + } + var ( added = map[string]struct{}{} mu sync.Mutex @@ -366,7 +398,7 @@ func (p *RegistryProvider) refreshCache(ctx context.Context, client *registryCli return } - newPkg, err := newPackageManifest(ctx, logger, pkg, client, bundles[pkg.GetName()]) + newPkg, err := newPackageManifest(ctx, logger, pkg, client, bundles[pkg.GetName()], customSchemasByPkg[pkg.GetName()]) if err != nil { logger.WithField("err", err.Error()).Warnf("eliding package: error converting to packagemanifest") return @@ -400,6 +432,42 @@ func isDeprecated(b *api.Bundle) bool { return false } +func fetchCustomSchemas(ctx context.Context, client *registryClient, packageName, schema string) (map[string][]runtime.RawExtension, error) { + stream, err := client.ListPackageCustomSchemas(ctx, &api.ListPackageCustomSchemasRequest{ + Schema: schema, + PackageName: packageName, + }) + if err != nil { + return nil, err + } + if stream == nil { + return nil, nil + } + + var result map[string][]runtime.RawExtension + for { + obj, err := stream.Recv() + if err == io.EOF { + break + } + if err != nil { + return nil, err + } + + raw, err := protojson.Marshal(obj) + if err != nil { + return nil, fmt.Errorf("failed to marshal custom schema object: %w", err) + } + + if result == nil { + result = make(map[string][]runtime.RawExtension) + } + result[schema] = append(result[schema], runtime.RawExtension{Raw: raw}) + } + + return result, nil +} + func (p *RegistryProvider) gcPackages(key registry.CatalogKey, keep map[string]struct{}) error { logger := logrus.WithFields(logrus.Fields{ "action": "gc cache", @@ -522,7 +590,7 @@ func (p *RegistryProvider) List(namespace string, selector labels.Selector) (*op return pkgList, nil } -func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Package, client *registryClient, entriesByChannel map[string][]operators.ChannelEntry) (*operators.PackageManifest, error) { +func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Package, client *registryClient, entriesByChannel map[string][]operators.ChannelEntry, customSchemas map[string][]runtime.RawExtension) (*operators.PackageManifest, error) { pkgChannels := pkg.GetChannels() sort.Slice(pkgChannels, func(i, j int) bool { return pkgChannels[i].Name < pkgChannels[j].Name @@ -600,6 +668,11 @@ func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Pack logger.Warn("default channel elided, setting as first in packagemanifest") manifest.Status.DefaultChannel = manifest.Status.Channels[0].Name } + + if len(customSchemas) > 0 { + manifest.Status.CustomSchemas = customSchemas + } + manifestLabels := manifest.GetLabels() for k, v := range defaultCsv.GetLabels() { manifestLabels[k] = v diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/server/server.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/server/server.go index 81ea882c78..665f5d24ae 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/server/server.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/server/server.go @@ -59,6 +59,7 @@ func NewCommandStartPackageServer(ctx context.Context, defaults *PackageServerOp flags.StringVar(&defaults.GlobalNamespace, "global-namespace", defaults.GlobalNamespace, "Name of the namespace where the global CatalogSources are located") flags.StringVar(&defaults.Kubeconfig, "kubeconfig", defaults.Kubeconfig, "path to the kubeconfig used to connect to the Kubernetes API server and the Kubelets (defaults to in-cluster config)") flags.BoolVar(&defaults.Debug, "debug", defaults.Debug, "use debug log level") + flags.StringSliceVar(&defaults.CustomSchemas, "custom-schemas", defaults.CustomSchemas, "comma-separated list of custom schema names to query from catalog registries") defaults.SecureServing.AddFlags(flags) defaults.Authentication.AddFlags(flags) @@ -81,6 +82,9 @@ type PackageServerOptions struct { Kubeconfig string RegistryAddr string + // Custom schemas to query from CatalogSource registries + CustomSchemas []string + // Only to be used to for testing DisableAuthForTesting bool @@ -281,7 +285,7 @@ func (o *PackageServerOptions) Run(ctx context.Context) error { } } - sourceProvider, err := provider.NewRegistryProvider(ctx, crClient, queueOperator, o.CurrentSyncInterval, o.GlobalNamespace) + sourceProvider, err := provider.NewRegistryProvider(ctx, crClient, queueOperator, o.CurrentSyncInterval, o.GlobalNamespace, o.CustomSchemas) if err != nil { return err } diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 7ac723c128..3ccfe515f7 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.81.0" +const Version = "1.81.1" diff --git a/vendor/modules.txt b/vendor/modules.txt index 11a4e88d39..c5508af8e2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1281,7 +1281,7 @@ google.golang.org/genproto/googleapis/api/httpbody ## explicit; go 1.25.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.81.0 +# google.golang.org/grpc v1.81.1 ## explicit; go 1.25.0 google.golang.org/grpc google.golang.org/grpc/attributes From 9f245d3b1ad2b3479e8e198b6311d50d4384f1b8 Mon Sep 17 00:00:00 2001 From: "Per G. da Silva" Date: Tue, 19 May 2026 14:16:34 +0200 Subject: [PATCH 3/3] Wire package-server to query for lifecycle schemas Signed-off-by: Per G. da Silva --- cmd/package-server-manager/main.go | 19 ++++++++++++------- cmd/package-server-manager/start.go | 1 + ...operator.deployment.ibm-cloud-managed.yaml | 2 ++ ...000_50_olm_06-psm-operator.deployment.yaml | 2 ++ ...operator.deployment.ibm-cloud-managed.yaml | 2 ++ ...000_50_olm_06-psm-operator.deployment.yaml | 2 ++ pkg/package-server-manager/config.go | 5 ++++- pkg/package-server-manager/controller.go | 18 +++++++++++------- pkg/package-server-manager/controller_test.go | 2 +- scripts/generate_crds_manifests.sh | 2 ++ 10 files changed, 39 insertions(+), 16 deletions(-) diff --git a/cmd/package-server-manager/main.go b/cmd/package-server-manager/main.go index 711f6fab26..2dcb0695d4 100644 --- a/cmd/package-server-manager/main.go +++ b/cmd/package-server-manager/main.go @@ -89,6 +89,10 @@ func run(cmd *cobra.Command, args []string) error { if err != nil { return err } + customSchemas, err := cmd.Flags().GetString("custom-schemas") + if err != nil { + return err + } ctrl.SetLogger(zap.New(zap.UseDevMode(true))) setupLog := ctrl.Log.WithName("setup") @@ -166,13 +170,14 @@ func run(cmd *cobra.Command, args []string) error { } if err := (&controllers.PackageServerCSVReconciler{ - Name: name, - Namespace: namespace, - Image: os.Getenv("PACKAGESERVER_IMAGE"), - Interval: interval, - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName(name), - Scheme: mgr.GetScheme(), + Name: name, + Namespace: namespace, + Image: os.Getenv("PACKAGESERVER_IMAGE"), + Interval: interval, + CustomSchemas: customSchemas, + Client: mgr.GetClient(), + Log: ctrl.Log.WithName("controllers").WithName(name), + Scheme: mgr.GetScheme(), }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create controller", "controller", name) return err diff --git a/cmd/package-server-manager/start.go b/cmd/package-server-manager/start.go index d94c1fbc45..b351fd2d0f 100644 --- a/cmd/package-server-manager/start.go +++ b/cmd/package-server-manager/start.go @@ -22,6 +22,7 @@ func newStartCmd() *cobra.Command { cmd.Flags().String("tls-cert", "", "path to use for certificate key (requires tls-key)") cmd.Flags().String("tls-key", "", "path to use for private key (requires tls-cert)") cmd.Flags().String("client-ca", "", "path to watch for client ca bundle") + cmd.Flags().String("custom-schemas", "", "comma-separated list of custom FBC schemas to fetch from catalog sources (e.g., io.openshift.operators.lifecycles.v1alpha1)") return cmd } diff --git a/manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml b/manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml index 7c23b75efd..72277a9d3a 100644 --- a/manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml +++ b/manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml @@ -51,6 +51,8 @@ spec: - /etc/tls/private/tls.key - --client-ca - /etc/tls/private/tls.crt + - --custom-schemas + - io.openshift.operators.lifecycles.v1alpha1 image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607 imagePullPolicy: IfNotPresent env: diff --git a/manifests/0000_50_olm_06-psm-operator.deployment.yaml b/manifests/0000_50_olm_06-psm-operator.deployment.yaml index 84ca49f8aa..10159e900f 100644 --- a/manifests/0000_50_olm_06-psm-operator.deployment.yaml +++ b/manifests/0000_50_olm_06-psm-operator.deployment.yaml @@ -51,6 +51,8 @@ spec: - /etc/tls/private/tls.key - --client-ca - /etc/tls/private/tls.crt + - --custom-schemas + - io.openshift.operators.lifecycles.v1alpha1 image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607 imagePullPolicy: IfNotPresent env: diff --git a/microshift-manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml b/microshift-manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml index 7c23b75efd..72277a9d3a 100644 --- a/microshift-manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml +++ b/microshift-manifests/0000_50_olm_06-psm-operator.deployment.ibm-cloud-managed.yaml @@ -51,6 +51,8 @@ spec: - /etc/tls/private/tls.key - --client-ca - /etc/tls/private/tls.crt + - --custom-schemas + - io.openshift.operators.lifecycles.v1alpha1 image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607 imagePullPolicy: IfNotPresent env: diff --git a/microshift-manifests/0000_50_olm_06-psm-operator.deployment.yaml b/microshift-manifests/0000_50_olm_06-psm-operator.deployment.yaml index 84ca49f8aa..10159e900f 100644 --- a/microshift-manifests/0000_50_olm_06-psm-operator.deployment.yaml +++ b/microshift-manifests/0000_50_olm_06-psm-operator.deployment.yaml @@ -51,6 +51,8 @@ spec: - /etc/tls/private/tls.key - --client-ca - /etc/tls/private/tls.crt + - --custom-schemas + - io.openshift.operators.lifecycles.v1alpha1 image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607 imagePullPolicy: IfNotPresent env: diff --git a/pkg/package-server-manager/config.go b/pkg/package-server-manager/config.go index 8a8bd3f338..b3486e521c 100644 --- a/pkg/package-server-manager/config.go +++ b/pkg/package-server-manager/config.go @@ -66,12 +66,15 @@ func getTopologyModeFromInfra(infra *configv1.Infrastructure) bool { // resource matches that of the codified defaults and high availability configurations, where // codified defaults are defined by the csv returned by the manifests.NewPackageServerCSV // function. -func ensureCSV(log logr.Logger, image string, interval string, csv *olmv1alpha1.ClusterServiceVersion, highlyAvailableMode bool) (bool, error) { +func ensureCSV(log logr.Logger, image string, interval string, customSchemas string, csv *olmv1alpha1.ClusterServiceVersion, highlyAvailableMode bool) (bool, error) { flags := []string{} if interval != "" { flags = append(flags, "--interval", interval) } + if customSchemas != "" { + flags = append(flags, "--custom-schemas", customSchemas) + } expectedCSV, err := manifests.NewPackageServerCSV( manifests.WithName(csv.Name), manifests.WithNamespace(csv.Namespace), diff --git a/pkg/package-server-manager/controller.go b/pkg/package-server-manager/controller.go index 3878aa5e65..f644933935 100644 --- a/pkg/package-server-manager/controller.go +++ b/pkg/package-server-manager/controller.go @@ -53,10 +53,11 @@ type PackageServerCSVReconciler struct { Scheme *runtime.Scheme Lock sync.Mutex - Name string - Namespace string - Image string - Interval string + Name string + Namespace string + Image string + Interval string + CustomSchemas string } // Reconcile is part of the main kubernetes reconciliation loop which is responsible @@ -84,6 +85,9 @@ func (r *PackageServerCSVReconciler) Reconcile(ctx context.Context, req ctrl.Req if r.Interval != "" { flags = append(flags, "--interval", r.Interval) } + if r.CustomSchemas != "" { + flags = append(flags, "--custom-schemas", r.CustomSchemas) + } required, err := manifests.NewPackageServerCSV( manifests.WithName(r.Name), @@ -96,7 +100,7 @@ func (r *PackageServerCSVReconciler) Reconcile(ctx context.Context, req ctrl.Req return ctrl.Result{}, err } res, err := controllerutil.CreateOrUpdate(ctx, r.Client, required, func() error { - return reconcileCSV(r.Log, r.Image, r.Interval, required, highAvailabilityMode) + return reconcileCSV(r.Log, r.Image, r.Interval, r.CustomSchemas, required, highAvailabilityMode) }) log.Info("reconciliation result", "res", res) @@ -123,12 +127,12 @@ func ensureRBAC(client client.Client, ctx context.Context, namespace string, log return nil } -func reconcileCSV(log logr.Logger, image string, interval string, csv *olmv1alpha1.ClusterServiceVersion, highAvailabilityMode bool) error { +func reconcileCSV(log logr.Logger, image string, interval string, customSchemas string, csv *olmv1alpha1.ClusterServiceVersion, highAvailabilityMode bool) error { if csv.ObjectMeta.CreationTimestamp.IsZero() { log.Info("attempting to create the packageserver csv") } - modified, err := ensureCSV(log, image, interval, csv, highAvailabilityMode) + modified, err := ensureCSV(log, image, interval, customSchemas, csv, highAvailabilityMode) if err != nil { return fmt.Errorf("error ensuring CSV: %v", err) } diff --git a/pkg/package-server-manager/controller_test.go b/pkg/package-server-manager/controller_test.go index b5e4eee116..363c7bdf37 100644 --- a/pkg/package-server-manager/controller_test.go +++ b/pkg/package-server-manager/controller_test.go @@ -261,7 +261,7 @@ func TestEnsureCSV(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { - gotBool, gotErr := ensureCSV(logger, image, interval, tc.inputCSV, tc.highlyAvailable) + gotBool, gotErr := ensureCSV(logger, image, interval, "", tc.inputCSV, tc.highlyAvailable) require.EqualValues(t, tc.want.expectedBool, gotBool) require.EqualValues(t, tc.want.expectedErr, gotErr) require.EqualValues(t, tc.inputCSV.Spec, tc.expectedCSV.Spec) diff --git a/scripts/generate_crds_manifests.sh b/scripts/generate_crds_manifests.sh index 85805439d7..736f7345d1 100755 --- a/scripts/generate_crds_manifests.sh +++ b/scripts/generate_crds_manifests.sh @@ -210,6 +210,8 @@ spec: - /etc/tls/private/tls.key - --client-ca - /etc/tls/private/tls.crt + - --custom-schemas + - io.openshift.operators.lifecycles.v1alpha1 image: quay.io/operator-framework/olm@sha256:de396b540b82219812061d0d753440d5655250c621c753ed1dc67d6154741607 imagePullPolicy: IfNotPresent env: