diff --git a/Makefile b/Makefile index 248483f..93ad395 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ NPROCS ?= 1 GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 ))) GO_LDFLAGS += -X $(GO_PROJECT)/pkg/version.Version=$(VERSION) -GO_SUBDIRS += proto +GO_SUBDIRS += errors proto resource response request GO111MODULE = on GOLANGCILINT_VERSION = 1.55.2 GO_LINT_ARGS ?= "--fix" diff --git a/go.mod b/go.mod index 2f7c85b..333a635 100644 --- a/go.mod +++ b/go.mod @@ -116,7 +116,7 @@ require ( github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect - github.com/rs/cors v1.10.1 // indirect + github.com/rs/cors v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/afero v1.11.0 // indirect diff --git a/go.sum b/go.sum index f472a94..a81826a 100644 --- a/go.sum +++ b/go.sum @@ -288,8 +288,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= diff --git a/proto/v1beta1/run_function.pb.go b/proto/v1beta1/run_function.pb.go index ecd8d16..3320e6b 100644 --- a/proto/v1beta1/run_function.pb.go +++ b/proto/v1beta1/run_function.pb.go @@ -154,6 +154,113 @@ func (Severity) EnumDescriptor() ([]byte, []int) { return file_v1beta1_run_function_proto_rawDescGZIP(), []int{1} } +// Target of Function results. +type Target int32 + +const ( + // If the target is unspecified, the result targets the composite resource. + Target_TARGET_UNSPECIFIED Target = 0 + // Target the composite resource. Results that target the composite resource + // should include detailed, advanced information. + Target_TARGET_COMPOSITE Target = 1 + // Target the composite and the claim. Results that target the composite and + // the claim should include only end-user friendly information. + Target_TARGET_COMPOSITE_AND_CLAIM Target = 2 +) + +// Enum value maps for Target. +var ( + Target_name = map[int32]string{ + 0: "TARGET_UNSPECIFIED", + 1: "TARGET_COMPOSITE", + 2: "TARGET_COMPOSITE_AND_CLAIM", + } + Target_value = map[string]int32{ + "TARGET_UNSPECIFIED": 0, + "TARGET_COMPOSITE": 1, + "TARGET_COMPOSITE_AND_CLAIM": 2, + } +) + +func (x Target) Enum() *Target { + p := new(Target) + *p = x + return p +} + +func (x Target) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Target) Descriptor() protoreflect.EnumDescriptor { + return file_v1beta1_run_function_proto_enumTypes[2].Descriptor() +} + +func (Target) Type() protoreflect.EnumType { + return &file_v1beta1_run_function_proto_enumTypes[2] +} + +func (x Target) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Target.Descriptor instead. +func (Target) EnumDescriptor() ([]byte, []int) { + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{2} +} + +type Status int32 + +const ( + Status_STATUS_CONDITION_UNSPECIFIED Status = 0 + Status_STATUS_CONDITION_UNKNOWN Status = 1 + Status_STATUS_CONDITION_TRUE Status = 2 + Status_STATUS_CONDITION_FALSE Status = 3 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "STATUS_CONDITION_UNSPECIFIED", + 1: "STATUS_CONDITION_UNKNOWN", + 2: "STATUS_CONDITION_TRUE", + 3: "STATUS_CONDITION_FALSE", + } + Status_value = map[string]int32{ + "STATUS_CONDITION_UNSPECIFIED": 0, + "STATUS_CONDITION_UNKNOWN": 1, + "STATUS_CONDITION_TRUE": 2, + "STATUS_CONDITION_FALSE": 3, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_v1beta1_run_function_proto_enumTypes[3].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_v1beta1_run_function_proto_enumTypes[3] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{3} +} + // A RunFunctionRequest requests that the Composition Function be run. type RunFunctionRequest struct { state protoimpl.MessageState @@ -192,6 +299,9 @@ type RunFunctionRequest struct { // did not exist, Crossplane sets the map key to an empty Resources message to // indicate that it attempted to satisfy the request. ExtraResources map[string]*Resources `protobuf:"bytes,6,rep,name=extra_resources,json=extraResources,proto3" json:"extra_resources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Optional credentials that this Function may use to communicate with an + // external system. + Credentials map[string]*Credentials `protobuf:"bytes,7,rep,name=credentials,proto3" json:"credentials,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *RunFunctionRequest) Reset() { @@ -268,6 +378,132 @@ func (x *RunFunctionRequest) GetExtraResources() map[string]*Resources { return nil } +func (x *RunFunctionRequest) GetCredentials() map[string]*Credentials { + if x != nil { + return x.Credentials + } + return nil +} + +// Credentials that a Function may use to communicate with an external system. +type Credentials struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Source of the credentials. + // + // Types that are assignable to Source: + // + // *Credentials_CredentialData + Source isCredentials_Source `protobuf_oneof:"source"` +} + +func (x *Credentials) Reset() { + *x = Credentials{} + if protoimpl.UnsafeEnabled { + mi := &file_v1beta1_run_function_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Credentials) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Credentials) ProtoMessage() {} + +func (x *Credentials) ProtoReflect() protoreflect.Message { + mi := &file_v1beta1_run_function_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Credentials.ProtoReflect.Descriptor instead. +func (*Credentials) Descriptor() ([]byte, []int) { + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{1} +} + +func (m *Credentials) GetSource() isCredentials_Source { + if m != nil { + return m.Source + } + return nil +} + +func (x *Credentials) GetCredentialData() *CredentialData { + if x, ok := x.GetSource().(*Credentials_CredentialData); ok { + return x.CredentialData + } + return nil +} + +type isCredentials_Source interface { + isCredentials_Source() +} + +type Credentials_CredentialData struct { + // Credential data loaded by Crossplane, for example from a Secret. + CredentialData *CredentialData `protobuf:"bytes,1,opt,name=credential_data,json=credentialData,proto3,oneof"` +} + +func (*Credentials_CredentialData) isCredentials_Source() {} + +// CredentialData loaded by Crossplane, for example from a Secret. +type CredentialData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data map[string][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CredentialData) Reset() { + *x = CredentialData{} + if protoimpl.UnsafeEnabled { + mi := &file_v1beta1_run_function_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CredentialData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialData) ProtoMessage() {} + +func (x *CredentialData) ProtoReflect() protoreflect.Message { + mi := &file_v1beta1_run_function_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CredentialData.ProtoReflect.Descriptor instead. +func (*CredentialData) Descriptor() ([]byte, []int) { + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{2} +} + +func (x *CredentialData) GetData() map[string][]byte { + if x != nil { + return x.Data + } + return nil +} + // Resources represents the state of several Crossplane resources. type Resources struct { state protoimpl.MessageState @@ -280,7 +516,7 @@ type Resources struct { func (x *Resources) Reset() { *x = Resources{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[1] + mi := &file_v1beta1_run_function_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -293,7 +529,7 @@ func (x *Resources) String() string { func (*Resources) ProtoMessage() {} func (x *Resources) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[1] + mi := &file_v1beta1_run_function_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -306,7 +542,7 @@ func (x *Resources) ProtoReflect() protoreflect.Message { // Deprecated: Use Resources.ProtoReflect.Descriptor instead. func (*Resources) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{1} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{3} } func (x *Resources) GetItems() []*Resource { @@ -343,12 +579,15 @@ type RunFunctionResponse struct { Context *structpb.Struct `protobuf:"bytes,4,opt,name=context,proto3,oneof" json:"context,omitempty"` // Requirements that must be satisfied for this Function to run successfully. Requirements *Requirements `protobuf:"bytes,5,opt,name=requirements,proto3" json:"requirements,omitempty"` + // Status Conditions to be applied to the Composite Resource and sometimes the + // Claim. + Conditions []*Condition `protobuf:"bytes,6,rep,name=conditions,proto3" json:"conditions,omitempty"` } func (x *RunFunctionResponse) Reset() { *x = RunFunctionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[2] + mi := &file_v1beta1_run_function_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -361,7 +600,7 @@ func (x *RunFunctionResponse) String() string { func (*RunFunctionResponse) ProtoMessage() {} func (x *RunFunctionResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[2] + mi := &file_v1beta1_run_function_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -374,7 +613,7 @@ func (x *RunFunctionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RunFunctionResponse.ProtoReflect.Descriptor instead. func (*RunFunctionResponse) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{2} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{4} } func (x *RunFunctionResponse) GetMeta() *ResponseMeta { @@ -412,6 +651,13 @@ func (x *RunFunctionResponse) GetRequirements() *Requirements { return nil } +func (x *RunFunctionResponse) GetConditions() []*Condition { + if x != nil { + return x.Conditions + } + return nil +} + // RequestMeta contains metadata pertaining to a RunFunctionRequest. type RequestMeta struct { state protoimpl.MessageState @@ -426,7 +672,7 @@ type RequestMeta struct { func (x *RequestMeta) Reset() { *x = RequestMeta{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[3] + mi := &file_v1beta1_run_function_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -439,7 +685,7 @@ func (x *RequestMeta) String() string { func (*RequestMeta) ProtoMessage() {} func (x *RequestMeta) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[3] + mi := &file_v1beta1_run_function_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -452,7 +698,7 @@ func (x *RequestMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestMeta.ProtoReflect.Descriptor instead. func (*RequestMeta) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{3} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{5} } func (x *RequestMeta) GetTag() string { @@ -476,7 +722,7 @@ type Requirements struct { func (x *Requirements) Reset() { *x = Requirements{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[4] + mi := &file_v1beta1_run_function_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -489,7 +735,7 @@ func (x *Requirements) String() string { func (*Requirements) ProtoMessage() {} func (x *Requirements) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[4] + mi := &file_v1beta1_run_function_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -502,7 +748,7 @@ func (x *Requirements) ProtoReflect() protoreflect.Message { // Deprecated: Use Requirements.ProtoReflect.Descriptor instead. func (*Requirements) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{4} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{6} } func (x *Requirements) GetExtraResources() map[string]*ResourceSelector { @@ -518,8 +764,12 @@ type ResourceSelector struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // API version of resources to select. ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // Kind of resources to select. + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // Resources to match. + // // Types that are assignable to Match: // // *ResourceSelector_MatchName @@ -530,7 +780,7 @@ type ResourceSelector struct { func (x *ResourceSelector) Reset() { *x = ResourceSelector{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[5] + mi := &file_v1beta1_run_function_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -543,7 +793,7 @@ func (x *ResourceSelector) String() string { func (*ResourceSelector) ProtoMessage() {} func (x *ResourceSelector) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[5] + mi := &file_v1beta1_run_function_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -556,7 +806,7 @@ func (x *ResourceSelector) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceSelector.ProtoReflect.Descriptor instead. func (*ResourceSelector) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{5} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{7} } func (x *ResourceSelector) GetApiVersion() string { @@ -599,10 +849,12 @@ type isResourceSelector_Match interface { } type ResourceSelector_MatchName struct { + // Match the resource with this name. MatchName string `protobuf:"bytes,3,opt,name=match_name,json=matchName,proto3,oneof"` } type ResourceSelector_MatchLabels struct { + // Match all resources with these labels. MatchLabels *MatchLabels `protobuf:"bytes,4,opt,name=match_labels,json=matchLabels,proto3,oneof"` } @@ -622,7 +874,7 @@ type MatchLabels struct { func (x *MatchLabels) Reset() { *x = MatchLabels{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[6] + mi := &file_v1beta1_run_function_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -635,7 +887,7 @@ func (x *MatchLabels) String() string { func (*MatchLabels) ProtoMessage() {} func (x *MatchLabels) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[6] + mi := &file_v1beta1_run_function_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -648,7 +900,7 @@ func (x *MatchLabels) ProtoReflect() protoreflect.Message { // Deprecated: Use MatchLabels.ProtoReflect.Descriptor instead. func (*MatchLabels) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{6} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{8} } func (x *MatchLabels) GetLabels() map[string]string { @@ -676,7 +928,7 @@ type ResponseMeta struct { func (x *ResponseMeta) Reset() { *x = ResponseMeta{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[7] + mi := &file_v1beta1_run_function_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -689,7 +941,7 @@ func (x *ResponseMeta) String() string { func (*ResponseMeta) ProtoMessage() {} func (x *ResponseMeta) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[7] + mi := &file_v1beta1_run_function_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -702,7 +954,7 @@ func (x *ResponseMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use ResponseMeta.ProtoReflect.Descriptor instead. func (*ResponseMeta) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{7} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{9} } func (x *ResponseMeta) GetTag() string { @@ -734,7 +986,7 @@ type State struct { func (x *State) Reset() { *x = State{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[8] + mi := &file_v1beta1_run_function_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -747,7 +999,7 @@ func (x *State) String() string { func (*State) ProtoMessage() {} func (x *State) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[8] + mi := &file_v1beta1_run_function_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -760,7 +1012,7 @@ func (x *State) ProtoReflect() protoreflect.Message { // Deprecated: Use State.ProtoReflect.Descriptor instead. func (*State) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{8} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{10} } func (x *State) GetComposite() *Resource { @@ -826,7 +1078,7 @@ type Resource struct { func (x *Resource) Reset() { *x = Resource{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[9] + mi := &file_v1beta1_run_function_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -839,7 +1091,7 @@ func (x *Resource) String() string { func (*Resource) ProtoMessage() {} func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[9] + mi := &file_v1beta1_run_function_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -852,7 +1104,7 @@ func (x *Resource) ProtoReflect() protoreflect.Message { // Deprecated: Use Resource.ProtoReflect.Descriptor instead. func (*Resource) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{9} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{11} } func (x *Resource) GetResource() *structpb.Struct { @@ -886,12 +1138,16 @@ type Result struct { Severity Severity `protobuf:"varint,1,opt,name=severity,proto3,enum=apiextensions.fn.proto.v1beta1.Severity" json:"severity,omitempty"` // Human-readable details about the result. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // Optional PascalCase, machine-readable reason for this result. + Reason *string `protobuf:"bytes,3,opt,name=reason,proto3,oneof" json:"reason,omitempty"` + // The resources this result targets. + Target *Target `protobuf:"varint,4,opt,name=target,proto3,enum=apiextensions.fn.proto.v1beta1.Target,oneof" json:"target,omitempty"` } func (x *Result) Reset() { *x = Result{} if protoimpl.UnsafeEnabled { - mi := &file_v1beta1_run_function_proto_msgTypes[10] + mi := &file_v1beta1_run_function_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -904,7 +1160,7 @@ func (x *Result) String() string { func (*Result) ProtoMessage() {} func (x *Result) ProtoReflect() protoreflect.Message { - mi := &file_v1beta1_run_function_proto_msgTypes[10] + mi := &file_v1beta1_run_function_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -917,7 +1173,7 @@ func (x *Result) ProtoReflect() protoreflect.Message { // Deprecated: Use Result.ProtoReflect.Descriptor instead. func (*Result) Descriptor() ([]byte, []int) { - return file_v1beta1_run_function_proto_rawDescGZIP(), []int{10} + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{12} } func (x *Result) GetSeverity() Severity { @@ -934,6 +1190,112 @@ func (x *Result) GetMessage() string { return "" } +func (x *Result) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason + } + return "" +} + +func (x *Result) GetTarget() Target { + if x != nil && x.Target != nil { + return *x.Target + } + return Target_TARGET_UNSPECIFIED +} + +// A Status Condition to be applied to the Composite Resource and sometimes the +// Claim. For detailed information on proper usage of Conditions, please see +// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties. +type Condition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Type of condition in CamelCase or in foo.example.com/CamelCase. + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Status of the condition. + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=apiextensions.fn.proto.v1beta1.Status" json:"status,omitempty"` + // Reason contains a programmatic identifier indicating the reason for the + // condition's last transition. Producers of specific condition types may + // define expected values and meanings for this field, and whether the values + // are considered a guaranteed API. The value should be a CamelCase string. + // This field may not be empty. + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` + // Message is a human readable message indicating details about the + // transition. This may be an empty string. + Message *string `protobuf:"bytes,4,opt,name=message,proto3,oneof" json:"message,omitempty"` + // The resources this condition targets. + Target *Target `protobuf:"varint,5,opt,name=target,proto3,enum=apiextensions.fn.proto.v1beta1.Target,oneof" json:"target,omitempty"` +} + +func (x *Condition) Reset() { + *x = Condition{} + if protoimpl.UnsafeEnabled { + mi := &file_v1beta1_run_function_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Condition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Condition) ProtoMessage() {} + +func (x *Condition) ProtoReflect() protoreflect.Message { + mi := &file_v1beta1_run_function_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Condition.ProtoReflect.Descriptor instead. +func (*Condition) Descriptor() ([]byte, []int) { + return file_v1beta1_run_function_proto_rawDescGZIP(), []int{13} +} + +func (x *Condition) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Condition) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_CONDITION_UNSPECIFIED +} + +func (x *Condition) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *Condition) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message + } + return "" +} + +func (x *Condition) GetTarget() Target { + if x != nil && x.Target != nil { + return *x.Target + } + return Target_TARGET_UNSPECIFIED +} + var File_v1beta1_run_function_proto protoreflect.FileDescriptor var file_v1beta1_run_function_proto_rawDesc = []byte{ @@ -944,7 +1306,7 @@ var file_v1beta1_run_function_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x04, 0x0a, 0x12, 0x52, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x06, 0x0a, 0x12, 0x52, 0x75, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, @@ -972,154 +1334,226 @@ var file_v1beta1_run_function_proto_rawDesc = []byte{ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x1a, 0x6c, 0x0a, 0x13, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x70, - 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x5f, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x4b, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x63, 0x65, 0x73, 0x12, 0x65, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x46, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x63, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x1a, 0x6c, 0x0a, 0x13, 0x45, 0x78, + 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x6b, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x41, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x42, + 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x72, 0x0a, 0x0b, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x59, 0x0a, 0x0f, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x05, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x22, 0xf0, 0x02, 0x0a, 0x13, 0x52, 0x75, 0x6e, 0x46, 0x75, 0x6e, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, - 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x69, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x3f, - 0x0a, 0x07, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x07, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x12, - 0x40, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x44, + 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, + 0x97, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x4c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x38, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x73, 0x12, 0x36, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x88, 0x01, 0x01, 0x12, 0x50, 0x0a, 0x0c, 0x72, 0x65, 0x71, - 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x0c, 0x72, - 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x1f, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0xee, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x71, - 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x69, 0x0a, 0x0f, 0x65, 0x78, 0x74, - 0x72, 0x61, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x1a, 0x73, 0x0a, 0x13, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x46, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x61, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4b, 0x0a, 0x09, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0xbb, 0x03, 0x0a, 0x13, 0x52, 0x75, 0x6e, 0x46, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, + 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc3, 0x01, 0x0a, 0x10, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1f, - 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, - 0x69, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0c, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x70, 0x69, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, - 0x99, 0x01, 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, - 0x4f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x37, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, + 0x12, 0x3f, 0x0a, 0x07, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x07, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, + 0x64, 0x12, 0x40, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x88, 0x01, 0x01, 0x12, 0x50, 0x0a, 0x0c, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x0c, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x49, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x22, 0x1f, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0xee, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x69, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x5a, 0x0a, 0x0c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x74, - 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x30, 0x0a, - 0x03, 0x74, 0x74, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x88, 0x01, 0x01, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x74, 0x74, 0x6c, 0x22, 0x8b, 0x02, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x46, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, - 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x12, 0x52, 0x0a, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x78, + 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x1a, 0x73, 0x0a, 0x13, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x46, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc3, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x61, + 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x12, 0x1f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x50, 0x0a, 0x0c, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0x99, 0x01, 0x0a, + 0x0b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x4f, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x66, 0x0a, - 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x5a, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x30, 0x0a, 0x03, 0x74, 0x74, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, + 0x5f, 0x74, 0x74, 0x6c, 0x22, 0x8b, 0x02, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x46, + 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x63, 0x6f, 0x6d, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x12, 0x52, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x61, 0x70, 0x69, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x66, 0x0a, 0x0e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3e, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0xb2, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x33, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x6e, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb2, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x6e, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x12, 0x3b, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x3b, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x79, 0x52, 0x05, 0x72, - 0x65, 0x61, 0x64, 0x79, 0x1a, 0x44, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x68, 0x0a, 0x06, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x12, 0x44, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, - 0x52, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x2a, 0x3f, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x15, 0x0a, - 0x11, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x54, 0x52, - 0x55, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x46, 0x41, - 0x4c, 0x53, 0x45, 0x10, 0x02, 0x2a, 0x63, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, - 0x79, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, - 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, 0x01, 0x12, - 0x14, 0x0a, 0x10, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x57, 0x41, 0x52, 0x4e, - 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, - 0x59, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x03, 0x32, 0x91, 0x01, 0x0a, 0x15, 0x46, - 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0b, 0x52, 0x75, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x79, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, + 0x79, 0x1a, 0x44, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe0, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x44, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, + 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, + 0x43, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x26, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x01, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, + 0x09, 0x0a, 0x07, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xf2, 0x01, 0x0a, 0x09, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x61, + 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x01, 0x52, 0x06, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2a, + 0x3f, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x41, 0x44, + 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x54, 0x52, 0x55, 0x45, 0x10, 0x01, 0x12, + 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x46, 0x41, 0x4c, 0x53, 0x45, 0x10, 0x02, + 0x2a, 0x63, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x14, + 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, + 0x54, 0x59, 0x5f, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45, + 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, + 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x4e, 0x4f, 0x52, + 0x4d, 0x41, 0x4c, 0x10, 0x03, 0x2a, 0x56, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, + 0x16, 0x0a, 0x12, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, + 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x45, 0x10, 0x01, 0x12, 0x1e, 0x0a, + 0x1a, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x53, 0x49, 0x54, + 0x45, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x10, 0x02, 0x2a, 0x7f, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x52, 0x55, 0x45, + 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4e, + 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x4c, 0x53, 0x45, 0x10, 0x03, 0x32, 0x91, + 0x01, 0x0a, 0x15, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6e, 0x6e, 0x65, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0b, 0x52, 0x75, 0x6e, 0x46, + 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x46, 0x75, 0x6e, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x35, - 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x72, 0x6f, - 0x73, 0x73, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x61, 0x70, + 0x69, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x66, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, + 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x66, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1134,63 +1568,78 @@ func file_v1beta1_run_function_proto_rawDescGZIP() []byte { return file_v1beta1_run_function_proto_rawDescData } -var file_v1beta1_run_function_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v1beta1_run_function_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_v1beta1_run_function_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_v1beta1_run_function_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_v1beta1_run_function_proto_goTypes = []interface{}{ (Ready)(0), // 0: apiextensions.fn.proto.v1beta1.Ready (Severity)(0), // 1: apiextensions.fn.proto.v1beta1.Severity - (*RunFunctionRequest)(nil), // 2: apiextensions.fn.proto.v1beta1.RunFunctionRequest - (*Resources)(nil), // 3: apiextensions.fn.proto.v1beta1.Resources - (*RunFunctionResponse)(nil), // 4: apiextensions.fn.proto.v1beta1.RunFunctionResponse - (*RequestMeta)(nil), // 5: apiextensions.fn.proto.v1beta1.RequestMeta - (*Requirements)(nil), // 6: apiextensions.fn.proto.v1beta1.Requirements - (*ResourceSelector)(nil), // 7: apiextensions.fn.proto.v1beta1.ResourceSelector - (*MatchLabels)(nil), // 8: apiextensions.fn.proto.v1beta1.MatchLabels - (*ResponseMeta)(nil), // 9: apiextensions.fn.proto.v1beta1.ResponseMeta - (*State)(nil), // 10: apiextensions.fn.proto.v1beta1.State - (*Resource)(nil), // 11: apiextensions.fn.proto.v1beta1.Resource - (*Result)(nil), // 12: apiextensions.fn.proto.v1beta1.Result - nil, // 13: apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry - nil, // 14: apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry - nil, // 15: apiextensions.fn.proto.v1beta1.MatchLabels.LabelsEntry - nil, // 16: apiextensions.fn.proto.v1beta1.State.ResourcesEntry - nil, // 17: apiextensions.fn.proto.v1beta1.Resource.ConnectionDetailsEntry - (*structpb.Struct)(nil), // 18: google.protobuf.Struct - (*durationpb.Duration)(nil), // 19: google.protobuf.Duration + (Target)(0), // 2: apiextensions.fn.proto.v1beta1.Target + (Status)(0), // 3: apiextensions.fn.proto.v1beta1.Status + (*RunFunctionRequest)(nil), // 4: apiextensions.fn.proto.v1beta1.RunFunctionRequest + (*Credentials)(nil), // 5: apiextensions.fn.proto.v1beta1.Credentials + (*CredentialData)(nil), // 6: apiextensions.fn.proto.v1beta1.CredentialData + (*Resources)(nil), // 7: apiextensions.fn.proto.v1beta1.Resources + (*RunFunctionResponse)(nil), // 8: apiextensions.fn.proto.v1beta1.RunFunctionResponse + (*RequestMeta)(nil), // 9: apiextensions.fn.proto.v1beta1.RequestMeta + (*Requirements)(nil), // 10: apiextensions.fn.proto.v1beta1.Requirements + (*ResourceSelector)(nil), // 11: apiextensions.fn.proto.v1beta1.ResourceSelector + (*MatchLabels)(nil), // 12: apiextensions.fn.proto.v1beta1.MatchLabels + (*ResponseMeta)(nil), // 13: apiextensions.fn.proto.v1beta1.ResponseMeta + (*State)(nil), // 14: apiextensions.fn.proto.v1beta1.State + (*Resource)(nil), // 15: apiextensions.fn.proto.v1beta1.Resource + (*Result)(nil), // 16: apiextensions.fn.proto.v1beta1.Result + (*Condition)(nil), // 17: apiextensions.fn.proto.v1beta1.Condition + nil, // 18: apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry + nil, // 19: apiextensions.fn.proto.v1beta1.RunFunctionRequest.CredentialsEntry + nil, // 20: apiextensions.fn.proto.v1beta1.CredentialData.DataEntry + nil, // 21: apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry + nil, // 22: apiextensions.fn.proto.v1beta1.MatchLabels.LabelsEntry + nil, // 23: apiextensions.fn.proto.v1beta1.State.ResourcesEntry + nil, // 24: apiextensions.fn.proto.v1beta1.Resource.ConnectionDetailsEntry + (*structpb.Struct)(nil), // 25: google.protobuf.Struct + (*durationpb.Duration)(nil), // 26: google.protobuf.Duration } var file_v1beta1_run_function_proto_depIdxs = []int32{ - 5, // 0: apiextensions.fn.proto.v1beta1.RunFunctionRequest.meta:type_name -> apiextensions.fn.proto.v1beta1.RequestMeta - 10, // 1: apiextensions.fn.proto.v1beta1.RunFunctionRequest.observed:type_name -> apiextensions.fn.proto.v1beta1.State - 10, // 2: apiextensions.fn.proto.v1beta1.RunFunctionRequest.desired:type_name -> apiextensions.fn.proto.v1beta1.State - 18, // 3: apiextensions.fn.proto.v1beta1.RunFunctionRequest.input:type_name -> google.protobuf.Struct - 18, // 4: apiextensions.fn.proto.v1beta1.RunFunctionRequest.context:type_name -> google.protobuf.Struct - 13, // 5: apiextensions.fn.proto.v1beta1.RunFunctionRequest.extra_resources:type_name -> apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry - 11, // 6: apiextensions.fn.proto.v1beta1.Resources.items:type_name -> apiextensions.fn.proto.v1beta1.Resource - 9, // 7: apiextensions.fn.proto.v1beta1.RunFunctionResponse.meta:type_name -> apiextensions.fn.proto.v1beta1.ResponseMeta - 10, // 8: apiextensions.fn.proto.v1beta1.RunFunctionResponse.desired:type_name -> apiextensions.fn.proto.v1beta1.State - 12, // 9: apiextensions.fn.proto.v1beta1.RunFunctionResponse.results:type_name -> apiextensions.fn.proto.v1beta1.Result - 18, // 10: apiextensions.fn.proto.v1beta1.RunFunctionResponse.context:type_name -> google.protobuf.Struct - 6, // 11: apiextensions.fn.proto.v1beta1.RunFunctionResponse.requirements:type_name -> apiextensions.fn.proto.v1beta1.Requirements - 14, // 12: apiextensions.fn.proto.v1beta1.Requirements.extra_resources:type_name -> apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry - 8, // 13: apiextensions.fn.proto.v1beta1.ResourceSelector.match_labels:type_name -> apiextensions.fn.proto.v1beta1.MatchLabels - 15, // 14: apiextensions.fn.proto.v1beta1.MatchLabels.labels:type_name -> apiextensions.fn.proto.v1beta1.MatchLabels.LabelsEntry - 19, // 15: apiextensions.fn.proto.v1beta1.ResponseMeta.ttl:type_name -> google.protobuf.Duration - 11, // 16: apiextensions.fn.proto.v1beta1.State.composite:type_name -> apiextensions.fn.proto.v1beta1.Resource - 16, // 17: apiextensions.fn.proto.v1beta1.State.resources:type_name -> apiextensions.fn.proto.v1beta1.State.ResourcesEntry - 18, // 18: apiextensions.fn.proto.v1beta1.Resource.resource:type_name -> google.protobuf.Struct - 17, // 19: apiextensions.fn.proto.v1beta1.Resource.connection_details:type_name -> apiextensions.fn.proto.v1beta1.Resource.ConnectionDetailsEntry - 0, // 20: apiextensions.fn.proto.v1beta1.Resource.ready:type_name -> apiextensions.fn.proto.v1beta1.Ready - 1, // 21: apiextensions.fn.proto.v1beta1.Result.severity:type_name -> apiextensions.fn.proto.v1beta1.Severity - 3, // 22: apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry.value:type_name -> apiextensions.fn.proto.v1beta1.Resources - 7, // 23: apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry.value:type_name -> apiextensions.fn.proto.v1beta1.ResourceSelector - 11, // 24: apiextensions.fn.proto.v1beta1.State.ResourcesEntry.value:type_name -> apiextensions.fn.proto.v1beta1.Resource - 2, // 25: apiextensions.fn.proto.v1beta1.FunctionRunnerService.RunFunction:input_type -> apiextensions.fn.proto.v1beta1.RunFunctionRequest - 4, // 26: apiextensions.fn.proto.v1beta1.FunctionRunnerService.RunFunction:output_type -> apiextensions.fn.proto.v1beta1.RunFunctionResponse - 26, // [26:27] is the sub-list for method output_type - 25, // [25:26] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 9, // 0: apiextensions.fn.proto.v1beta1.RunFunctionRequest.meta:type_name -> apiextensions.fn.proto.v1beta1.RequestMeta + 14, // 1: apiextensions.fn.proto.v1beta1.RunFunctionRequest.observed:type_name -> apiextensions.fn.proto.v1beta1.State + 14, // 2: apiextensions.fn.proto.v1beta1.RunFunctionRequest.desired:type_name -> apiextensions.fn.proto.v1beta1.State + 25, // 3: apiextensions.fn.proto.v1beta1.RunFunctionRequest.input:type_name -> google.protobuf.Struct + 25, // 4: apiextensions.fn.proto.v1beta1.RunFunctionRequest.context:type_name -> google.protobuf.Struct + 18, // 5: apiextensions.fn.proto.v1beta1.RunFunctionRequest.extra_resources:type_name -> apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry + 19, // 6: apiextensions.fn.proto.v1beta1.RunFunctionRequest.credentials:type_name -> apiextensions.fn.proto.v1beta1.RunFunctionRequest.CredentialsEntry + 6, // 7: apiextensions.fn.proto.v1beta1.Credentials.credential_data:type_name -> apiextensions.fn.proto.v1beta1.CredentialData + 20, // 8: apiextensions.fn.proto.v1beta1.CredentialData.data:type_name -> apiextensions.fn.proto.v1beta1.CredentialData.DataEntry + 15, // 9: apiextensions.fn.proto.v1beta1.Resources.items:type_name -> apiextensions.fn.proto.v1beta1.Resource + 13, // 10: apiextensions.fn.proto.v1beta1.RunFunctionResponse.meta:type_name -> apiextensions.fn.proto.v1beta1.ResponseMeta + 14, // 11: apiextensions.fn.proto.v1beta1.RunFunctionResponse.desired:type_name -> apiextensions.fn.proto.v1beta1.State + 16, // 12: apiextensions.fn.proto.v1beta1.RunFunctionResponse.results:type_name -> apiextensions.fn.proto.v1beta1.Result + 25, // 13: apiextensions.fn.proto.v1beta1.RunFunctionResponse.context:type_name -> google.protobuf.Struct + 10, // 14: apiextensions.fn.proto.v1beta1.RunFunctionResponse.requirements:type_name -> apiextensions.fn.proto.v1beta1.Requirements + 17, // 15: apiextensions.fn.proto.v1beta1.RunFunctionResponse.conditions:type_name -> apiextensions.fn.proto.v1beta1.Condition + 21, // 16: apiextensions.fn.proto.v1beta1.Requirements.extra_resources:type_name -> apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry + 12, // 17: apiextensions.fn.proto.v1beta1.ResourceSelector.match_labels:type_name -> apiextensions.fn.proto.v1beta1.MatchLabels + 22, // 18: apiextensions.fn.proto.v1beta1.MatchLabels.labels:type_name -> apiextensions.fn.proto.v1beta1.MatchLabels.LabelsEntry + 26, // 19: apiextensions.fn.proto.v1beta1.ResponseMeta.ttl:type_name -> google.protobuf.Duration + 15, // 20: apiextensions.fn.proto.v1beta1.State.composite:type_name -> apiextensions.fn.proto.v1beta1.Resource + 23, // 21: apiextensions.fn.proto.v1beta1.State.resources:type_name -> apiextensions.fn.proto.v1beta1.State.ResourcesEntry + 25, // 22: apiextensions.fn.proto.v1beta1.Resource.resource:type_name -> google.protobuf.Struct + 24, // 23: apiextensions.fn.proto.v1beta1.Resource.connection_details:type_name -> apiextensions.fn.proto.v1beta1.Resource.ConnectionDetailsEntry + 0, // 24: apiextensions.fn.proto.v1beta1.Resource.ready:type_name -> apiextensions.fn.proto.v1beta1.Ready + 1, // 25: apiextensions.fn.proto.v1beta1.Result.severity:type_name -> apiextensions.fn.proto.v1beta1.Severity + 2, // 26: apiextensions.fn.proto.v1beta1.Result.target:type_name -> apiextensions.fn.proto.v1beta1.Target + 3, // 27: apiextensions.fn.proto.v1beta1.Condition.status:type_name -> apiextensions.fn.proto.v1beta1.Status + 2, // 28: apiextensions.fn.proto.v1beta1.Condition.target:type_name -> apiextensions.fn.proto.v1beta1.Target + 7, // 29: apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry.value:type_name -> apiextensions.fn.proto.v1beta1.Resources + 5, // 30: apiextensions.fn.proto.v1beta1.RunFunctionRequest.CredentialsEntry.value:type_name -> apiextensions.fn.proto.v1beta1.Credentials + 11, // 31: apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry.value:type_name -> apiextensions.fn.proto.v1beta1.ResourceSelector + 15, // 32: apiextensions.fn.proto.v1beta1.State.ResourcesEntry.value:type_name -> apiextensions.fn.proto.v1beta1.Resource + 4, // 33: apiextensions.fn.proto.v1beta1.FunctionRunnerService.RunFunction:input_type -> apiextensions.fn.proto.v1beta1.RunFunctionRequest + 8, // 34: apiextensions.fn.proto.v1beta1.FunctionRunnerService.RunFunction:output_type -> apiextensions.fn.proto.v1beta1.RunFunctionResponse + 34, // [34:35] is the sub-list for method output_type + 33, // [33:34] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name } func init() { file_v1beta1_run_function_proto_init() } @@ -1212,7 +1661,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Resources); i { + switch v := v.(*Credentials); i { case 0: return &v.state case 1: @@ -1224,7 +1673,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RunFunctionResponse); i { + switch v := v.(*CredentialData); i { case 0: return &v.state case 1: @@ -1236,7 +1685,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestMeta); i { + switch v := v.(*Resources); i { case 0: return &v.state case 1: @@ -1248,7 +1697,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Requirements); i { + switch v := v.(*RunFunctionResponse); i { case 0: return &v.state case 1: @@ -1260,7 +1709,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceSelector); i { + switch v := v.(*RequestMeta); i { case 0: return &v.state case 1: @@ -1272,7 +1721,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MatchLabels); i { + switch v := v.(*Requirements); i { case 0: return &v.state case 1: @@ -1284,7 +1733,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseMeta); i { + switch v := v.(*ResourceSelector); i { case 0: return &v.state case 1: @@ -1296,7 +1745,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*State); i { + switch v := v.(*MatchLabels); i { case 0: return &v.state case 1: @@ -1308,7 +1757,7 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Resource); i { + switch v := v.(*ResponseMeta); i { case 0: return &v.state case 1: @@ -1320,6 +1769,30 @@ func file_v1beta1_run_function_proto_init() { } } file_v1beta1_run_function_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*State); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1beta1_run_function_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Resource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1beta1_run_function_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Result); i { case 0: return &v.state @@ -1331,21 +1804,38 @@ func file_v1beta1_run_function_proto_init() { return nil } } + file_v1beta1_run_function_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Condition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_v1beta1_run_function_proto_msgTypes[0].OneofWrappers = []interface{}{} - file_v1beta1_run_function_proto_msgTypes[2].OneofWrappers = []interface{}{} - file_v1beta1_run_function_proto_msgTypes[5].OneofWrappers = []interface{}{ + file_v1beta1_run_function_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Credentials_CredentialData)(nil), + } + file_v1beta1_run_function_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_v1beta1_run_function_proto_msgTypes[7].OneofWrappers = []interface{}{ (*ResourceSelector_MatchName)(nil), (*ResourceSelector_MatchLabels)(nil), } - file_v1beta1_run_function_proto_msgTypes[7].OneofWrappers = []interface{}{} + file_v1beta1_run_function_proto_msgTypes[9].OneofWrappers = []interface{}{} + file_v1beta1_run_function_proto_msgTypes[12].OneofWrappers = []interface{}{} + file_v1beta1_run_function_proto_msgTypes[13].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1beta1_run_function_proto_rawDesc, - NumEnums: 2, - NumMessages: 16, + NumEnums: 4, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/v1beta1/run_function.proto b/proto/v1beta1/run_function.proto index 8e87154..c2eb741 100644 --- a/proto/v1beta1/run_function.proto +++ b/proto/v1beta1/run_function.proto @@ -71,6 +71,24 @@ message RunFunctionRequest { // did not exist, Crossplane sets the map key to an empty Resources message to // indicate that it attempted to satisfy the request. map extra_resources = 6; + + // Optional credentials that this Function may use to communicate with an + // external system. + map credentials = 7; +} + +// Credentials that a Function may use to communicate with an external system. +message Credentials { + // Source of the credentials. + oneof source { + // Credential data loaded by Crossplane, for example from a Secret. + CredentialData credential_data = 1; + } +} + +// CredentialData loaded by Crossplane, for example from a Secret. +message CredentialData { + map data = 1; } // Resources represents the state of several Crossplane resources. @@ -106,6 +124,10 @@ message RunFunctionResponse { // Requirements that must be satisfied for this Function to run successfully. Requirements requirements = 5; + + // Status Conditions to be applied to the Composite Resource and sometimes the + // Claim. + repeated Condition conditions = 6; } // RequestMeta contains metadata pertaining to a RunFunctionRequest. @@ -124,11 +146,18 @@ message Requirements { // ResourceSelector selects a group of resources, either by name or by label. message ResourceSelector { + // API version of resources to select. string api_version = 1; + + // Kind of resources to select. string kind = 2; + // Resources to match. oneof match { + // Match the resource with this name. string match_name = 3; + + // Match all resources with these labels. MatchLabels match_labels = 4; } } @@ -221,6 +250,12 @@ message Result { // Human-readable details about the result. string message = 2; + + // Optional PascalCase, machine-readable reason for this result. + optional string reason = 3; + + // The resources this result targets. + optional Target target = 4; } // Severity of Function results. @@ -241,3 +276,52 @@ enum Severity { // with the composite resource. SEVERITY_NORMAL = 3; } + +// Target of Function results. +enum Target { + // If the target is unspecified, the result targets the composite resource. + TARGET_UNSPECIFIED = 0; + + // Target the composite resource. Results that target the composite resource + // should include detailed, advanced information. + TARGET_COMPOSITE = 1; + + // Target the composite and the claim. Results that target the composite and + // the claim should include only end-user friendly information. + TARGET_COMPOSITE_AND_CLAIM = 2; +} + +// A Status Condition to be applied to the Composite Resource and sometimes the +// Claim. For detailed information on proper usage of Conditions, please see +// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties. +message Condition { + // Type of condition in CamelCase or in foo.example.com/CamelCase. + string type = 1; + + // Status of the condition. + Status status = 2; + + // Reason contains a programmatic identifier indicating the reason for the + // condition's last transition. Producers of specific condition types may + // define expected values and meanings for this field, and whether the values + // are considered a guaranteed API. The value should be a CamelCase string. + // This field may not be empty. + string reason = 3; + + // Message is a human readable message indicating details about the + // transition. This may be an empty string. + optional string message = 4; + + // The resources this condition targets. + optional Target target = 5; +} + +enum Status { + STATUS_CONDITION_UNSPECIFIED = 0; + + STATUS_CONDITION_UNKNOWN = 1; + + STATUS_CONDITION_TRUE = 2; + + STATUS_CONDITION_FALSE = 3; +} diff --git a/request/request.go b/request/request.go index bf170d2..569760a 100644 --- a/request/request.go +++ b/request/request.go @@ -128,3 +128,18 @@ func GetExtraResources(req *v1beta1.RunFunctionRequest) (map[string][]resource.E } return out, nil } + +// GetCredentials from the supplied request. +func GetCredentials(req *v1beta1.RunFunctionRequest, name string) (resource.Credentials, error) { + cred, exists := req.GetCredentials()[name] + if !exists { + return resource.Credentials{}, errors.Errorf("%s: credential not found", name) + } + + switch t := cred.GetSource().(type) { + case *v1beta1.Credentials_CredentialData: + return resource.Credentials{Type: resource.CredentialsTypeData, Data: cred.GetCredentialData().GetData()}, nil + default: + return resource.Credentials{}, errors.Errorf("%s: not a supported credential source", t) + } +} diff --git a/resource/resource.go b/resource/resource.go index 4c0ffb6..dffa27b 100644 --- a/resource/resource.go +++ b/resource/resource.go @@ -57,6 +57,24 @@ type Extra struct { Resource *unstructured.Unstructured } +// CredentialsType is the type of credentials. +type CredentialsType string + +const ( + // CredentialsTypeData is a Credential of type Data. + CredentialsTypeData = "Data" +) + +// Credentials is a secret requested by a Function. +type Credentials struct { + // Type represents the type of credentials. + Type CredentialsType + + // Data is a map of key-value pairs where the keys are strings, and the values are byte slices + // containing sensitive data. + Data map[string][]byte +} + // Ready indicates whether a composed resource should be considered ready. type Ready string diff --git a/response/condition.go b/response/condition.go new file mode 100644 index 0000000..9d604c8 --- /dev/null +++ b/response/condition.go @@ -0,0 +1,77 @@ +/* +Copyright 2024 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package response + +import ( + "github.com/crossplane/function-sdk-go/proto/v1beta1" +) + +// ConditionOption allows further customization of the condition. +type ConditionOption struct { + condition *v1beta1.Condition +} + +// ConditionTrue will create a condition with the status of true and add the +// condition to the supplied RunFunctionResponse. +func ConditionTrue(rsp *v1beta1.RunFunctionResponse, typ, reason string) *ConditionOption { + return newCondition(rsp, typ, reason, v1beta1.Status_STATUS_CONDITION_TRUE) +} + +// ConditionFalse will create a condition with the status of false and add the +// condition to the supplied RunFunctionResponse. +func ConditionFalse(rsp *v1beta1.RunFunctionResponse, typ, reason string) *ConditionOption { + return newCondition(rsp, typ, reason, v1beta1.Status_STATUS_CONDITION_FALSE) +} + +// ConditionUnknown will create a condition with the status of unknown and add +// the condition to the supplied RunFunctionResponse. +func ConditionUnknown(rsp *v1beta1.RunFunctionResponse, typ, reason string) *ConditionOption { + return newCondition(rsp, typ, reason, v1beta1.Status_STATUS_CONDITION_UNKNOWN) +} + +func newCondition(rsp *v1beta1.RunFunctionResponse, typ, reason string, s v1beta1.Status) *ConditionOption { + if rsp.GetConditions() == nil { + rsp.Conditions = make([]*v1beta1.Condition, 0, 1) + } + c := &v1beta1.Condition{ + Type: typ, + Status: s, + Reason: reason, + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + } + rsp.Conditions = append(rsp.GetConditions(), c) + return &ConditionOption{condition: c} +} + +// TargetComposite updates the condition to target the composite resource. +func (c *ConditionOption) TargetComposite() *ConditionOption { + c.condition.Target = v1beta1.Target_TARGET_COMPOSITE.Enum() + return c +} + +// TargetCompositeAndClaim updates the condition to target both the composite +// resource and claim. +func (c *ConditionOption) TargetCompositeAndClaim() *ConditionOption { + c.condition.Target = v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum() + return c +} + +// WithMessage adds the message to the condition. +func (c *ConditionOption) WithMessage(message string) *ConditionOption { + c.condition.Message = &message + return c +} diff --git a/response/condition_test.go b/response/condition_test.go new file mode 100644 index 0000000..60fca7c --- /dev/null +++ b/response/condition_test.go @@ -0,0 +1,193 @@ +/* +Copyright 2024 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package response_test + +import ( + "testing" + + "github.com/google/go-cmp/cmp" + "google.golang.org/protobuf/testing/protocmp" + "k8s.io/utils/ptr" + + "github.com/crossplane/function-sdk-go/proto/v1beta1" + "github.com/crossplane/function-sdk-go/response" +) + +// Condition types. +const ( + typeDatabaseReady = "DatabaseReady" +) + +// Condition reasons. +const ( + reasonAvailable = "ReasonAvailable" + reasonCreating = "ReasonCreating" + reasonPriorFailure = "ReasonPriorFailure" + reasonUnauthorized = "ReasonUnauthorized" +) + +func TestCondition(t *testing.T) { + type testFn func(*v1beta1.RunFunctionResponse) + type args struct { + fns []testFn + } + type want struct { + conditions []*v1beta1.Condition + } + cases := map[string]struct { + reason string + args args + want want + }{ + "CreateBasicRecords": { + reason: "Correctly adds conditions to the response.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionTrue(rsp, typeDatabaseReady, reasonAvailable) + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionFalse(rsp, typeDatabaseReady, reasonCreating) + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionUnknown(rsp, typeDatabaseReady, reasonPriorFailure) + }, + }, + }, + want: want{ + conditions: []*v1beta1.Condition{ + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_TRUE, + Reason: reasonAvailable, + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_FALSE, + Reason: reasonCreating, + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_UNKNOWN, + Reason: reasonPriorFailure, + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + }, + }, + }, + "SetTargets": { + reason: "Correctly sets targets on condition and adds it to the response.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionTrue(rsp, typeDatabaseReady, reasonAvailable).TargetComposite() + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionTrue(rsp, typeDatabaseReady, reasonAvailable).TargetCompositeAndClaim() + }, + }, + }, + want: want{ + conditions: []*v1beta1.Condition{ + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_TRUE, + Reason: reasonAvailable, + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_TRUE, + Reason: reasonAvailable, + Target: v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), + }, + }, + }, + }, + "SetMessage": { + reason: "Correctly sets message on condition and adds it to the response.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionTrue(rsp, typeDatabaseReady, reasonAvailable).WithMessage("a test message") + }, + }, + }, + want: want{ + conditions: []*v1beta1.Condition{ + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_TRUE, + Reason: reasonAvailable, + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + Message: ptr.To("a test message"), + }, + }, + }, + }, + "ChainOptions": { + reason: "Can chain condition options together.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionTrue(rsp, typeDatabaseReady, reasonAvailable). + WithMessage("a test message"). + TargetCompositeAndClaim() + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.ConditionTrue(rsp, typeDatabaseReady, reasonAvailable). + TargetCompositeAndClaim(). + WithMessage("a test message") + }, + }, + }, + want: want{ + conditions: []*v1beta1.Condition{ + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_TRUE, + Reason: reasonAvailable, + Target: v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), + Message: ptr.To("a test message"), + }, + { + Type: typeDatabaseReady, + Status: v1beta1.Status_STATUS_CONDITION_TRUE, + Reason: reasonAvailable, + Target: v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), + Message: ptr.To("a test message"), + }, + }, + }, + }, + } + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + rsp := &v1beta1.RunFunctionResponse{} + for _, f := range tc.args.fns { + f(rsp) + } + + if diff := cmp.Diff(tc.want.conditions, rsp.GetConditions(), protocmp.Transform()); diff != "" { + t.Errorf("\n%s\nFrom(...): -want, +got:\n%s", tc.reason, diff) + } + + }) + } +} diff --git a/response/response.go b/response/response.go index 714eccc..7d5913e 100644 --- a/response/response.go +++ b/response/response.go @@ -18,7 +18,6 @@ limitations under the License. package response import ( - "fmt" "time" "google.golang.org/protobuf/types/known/durationpb" @@ -95,41 +94,3 @@ func SetDesiredComposedResources(rsp *v1beta1.RunFunctionResponse, dcds map[reso } return nil } - -// Fatal adds a fatal result to the supplied RunFunctionResponse. -func Fatal(rsp *v1beta1.RunFunctionResponse, err error) { - if rsp.GetResults() == nil { - rsp.Results = make([]*v1beta1.Result, 0, 1) - } - rsp.Results = append(rsp.GetResults(), &v1beta1.Result{ - Severity: v1beta1.Severity_SEVERITY_FATAL, - Message: err.Error(), - }) -} - -// Warning adds a warning result to the supplied RunFunctionResponse. -func Warning(rsp *v1beta1.RunFunctionResponse, err error) { - if rsp.GetResults() == nil { - rsp.Results = make([]*v1beta1.Result, 0, 1) - } - rsp.Results = append(rsp.GetResults(), &v1beta1.Result{ - Severity: v1beta1.Severity_SEVERITY_WARNING, - Message: err.Error(), - }) -} - -// Normal adds a normal result to the supplied RunFunctionResponse. -func Normal(rsp *v1beta1.RunFunctionResponse, message string) { - if rsp.GetResults() == nil { - rsp.Results = make([]*v1beta1.Result, 0, 1) - } - rsp.Results = append(rsp.GetResults(), &v1beta1.Result{ - Severity: v1beta1.Severity_SEVERITY_NORMAL, - Message: message, - }) -} - -// Normalf adds a normal result to the supplied RunFunctionResponse. -func Normalf(rsp *v1beta1.RunFunctionResponse, format string, a ...any) { - Normal(rsp, fmt.Sprintf(format, a...)) -} diff --git a/response/result.go b/response/result.go new file mode 100644 index 0000000..e2cac99 --- /dev/null +++ b/response/result.go @@ -0,0 +1,89 @@ +/* +Copyright 2024 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package response contains utilities for working with RunFunctionResponses. +package response + +import ( + "fmt" + + "github.com/crossplane/function-sdk-go/proto/v1beta1" +) + +// ResultOption allows further customization of the result. +type ResultOption struct { + result *v1beta1.Result +} + +// Fatal adds a fatal result to the supplied RunFunctionResponse. +// An event will be created for the Composite Resource. +// A fatal result cannot target the claim. +func Fatal(rsp *v1beta1.RunFunctionResponse, err error) { + newResult(rsp, v1beta1.Severity_SEVERITY_FATAL, err.Error()) +} + +// Warning adds a warning result to the supplied RunFunctionResponse. +// An event will be created for the Composite Resource. +func Warning(rsp *v1beta1.RunFunctionResponse, err error) *ResultOption { + return newResult(rsp, v1beta1.Severity_SEVERITY_WARNING, err.Error()) +} + +// Normal adds a normal result to the supplied RunFunctionResponse. +// An event will be created for the Composite Resource. +func Normal(rsp *v1beta1.RunFunctionResponse, message string) *ResultOption { + return newResult(rsp, v1beta1.Severity_SEVERITY_NORMAL, message) +} + +// Normalf adds a normal result to the supplied RunFunctionResponse. +// An event will be created for the Composite Resource. +func Normalf(rsp *v1beta1.RunFunctionResponse, format string, a ...any) *ResultOption { + return Normal(rsp, fmt.Sprintf(format, a...)) +} + +func newResult(rsp *v1beta1.RunFunctionResponse, s v1beta1.Severity, message string) *ResultOption { + if rsp.GetResults() == nil { + rsp.Results = make([]*v1beta1.Result, 0, 1) + } + + r := &v1beta1.Result{ + Severity: s, + Message: message, + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + } + rsp.Results = append(rsp.GetResults(), r) + + return &ResultOption{result: r} +} + +// TargetComposite updates the result and its event to target the composite +// resource. +func (o *ResultOption) TargetComposite() *ResultOption { + o.result.Target = v1beta1.Target_TARGET_COMPOSITE.Enum() + return o +} + +// TargetCompositeAndClaim updates the result and its event to target both the +// composite resource and claim. +func (o *ResultOption) TargetCompositeAndClaim() *ResultOption { + o.result.Target = v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum() + return o +} + +// WithReason sets the reason field on the result and its event. +func (o *ResultOption) WithReason(reason string) *ResultOption { + o.result.Reason = &reason + return o +} diff --git a/response/result_test.go b/response/result_test.go new file mode 100644 index 0000000..fed8315 --- /dev/null +++ b/response/result_test.go @@ -0,0 +1,190 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package response_test + +import ( + "errors" + "testing" + + "github.com/google/go-cmp/cmp" + "google.golang.org/protobuf/testing/protocmp" + "k8s.io/utils/ptr" + + "github.com/crossplane/function-sdk-go/proto/v1beta1" + "github.com/crossplane/function-sdk-go/response" +) + +func TestResult(t *testing.T) { + type testFn func(*v1beta1.RunFunctionResponse) + type args struct { + fns []testFn + } + type want struct { + results []*v1beta1.Result + } + cases := map[string]struct { + reason string + args args + want want + }{ + "CreateBasicRecords": { + reason: "Correctly adds results to the response.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.Normal(rsp, "this is a test normal result") + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.Normalf(rsp, "this is a test normal %s result", "formatted") + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.Warning(rsp, errors.New("this is a test warning result")) + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.Fatal(rsp, errors.New("this is a test fatal result")) + }, + }, + }, + want: want{ + results: []*v1beta1.Result{ + { + Severity: v1beta1.Severity_SEVERITY_NORMAL, + Message: "this is a test normal result", + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + { + Severity: v1beta1.Severity_SEVERITY_NORMAL, + Message: "this is a test normal formatted result", + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + { + Severity: v1beta1.Severity_SEVERITY_WARNING, + Message: "this is a test warning result", + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + { + Severity: v1beta1.Severity_SEVERITY_FATAL, + Message: "this is a test fatal result", + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + }, + }, + }, + "SetTargets": { + reason: "Correctly sets targets on result and adds it to the response.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.Warning(rsp, errors.New("this is a test warning result targeting the composite")).TargetComposite() + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.Warning(rsp, errors.New("this is a test fatal result targeting both")).TargetCompositeAndClaim() + }, + }, + }, + want: want{ + results: []*v1beta1.Result{ + { + Severity: v1beta1.Severity_SEVERITY_WARNING, + Message: "this is a test warning result targeting the composite", + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + }, + { + Severity: v1beta1.Severity_SEVERITY_WARNING, + Message: "this is a test fatal result targeting both", + Target: v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), + }, + }, + }, + }, + "SetReason": { + reason: "Correctly sets reason on result and adds it to the response.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.Normal(rsp, "this is a test normal result targeting the composite").WithReason("TestReason") + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.Warning(rsp, errors.New("this is a test warning result targeting the composite")).WithReason("TestReason") + }, + }, + }, + want: want{ + results: []*v1beta1.Result{ + { + Severity: v1beta1.Severity_SEVERITY_NORMAL, + Message: "this is a test normal result targeting the composite", + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + Reason: ptr.To("TestReason"), + }, + { + Severity: v1beta1.Severity_SEVERITY_WARNING, + Message: "this is a test warning result targeting the composite", + Target: v1beta1.Target_TARGET_COMPOSITE.Enum(), + Reason: ptr.To("TestReason"), + }, + }, + }, + }, + "ChainOptions": { + reason: "Can chain result options together.", + args: args{ + fns: []testFn{ + func(rsp *v1beta1.RunFunctionResponse) { + response.Normal(rsp, "this is a test normal result targeting the composite and claim"). + WithReason("TestReason"). + TargetCompositeAndClaim() + }, + func(rsp *v1beta1.RunFunctionResponse) { + response.Warning(rsp, errors.New("this is a test warning result targeting the composite and claim")). + TargetCompositeAndClaim(). + WithReason("TestReason") + }, + }, + }, + want: want{ + results: []*v1beta1.Result{ + { + Severity: v1beta1.Severity_SEVERITY_NORMAL, + Message: "this is a test normal result targeting the composite and claim", + Target: v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), + Reason: ptr.To("TestReason"), + }, + { + Severity: v1beta1.Severity_SEVERITY_WARNING, + Message: "this is a test warning result targeting the composite and claim", + Target: v1beta1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), + Reason: ptr.To("TestReason"), + }, + }, + }, + }, + } + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + rsp := &v1beta1.RunFunctionResponse{} + for _, f := range tc.args.fns { + f(rsp) + } + + if diff := cmp.Diff(tc.want.results, rsp.GetResults(), protocmp.Transform()); diff != "" { + t.Errorf("\n%s\nFrom(...): -want, +got:\n%s", tc.reason, diff) + } + + }) + } +} diff --git a/sdk.go b/sdk.go index 5b4aadb..a819fb6 100644 --- a/sdk.go +++ b/sdk.go @@ -36,21 +36,23 @@ import ( // Default ServeOptions. const ( - DefaultNetwork = "tcp" - DefaultAddress = ":9443" + DefaultNetwork = "tcp" + DefaultAddress = ":9443" + DefaultMaxRecvMsgSize = 4096 ) // ServeOptions configure how a Function is served. type ServeOptions struct { Network string Address string + MaxRecvMsgSize int Credentials credentials.TransportCredentials } // A ServeOption configures how a Function is served. type ServeOption func(o *ServeOptions) error -// Listen configures the network and address on which the Function will +// Listen configures the network, address and maximum message size on which the Function will // listen for RunFunctionRequests. func Listen(network, address string) ServeOption { return func(o *ServeOptions) error { @@ -114,12 +116,22 @@ func Insecure(insecure bool) ServeOption { } } +// MaxMsgSize returns a ServeOption to set the max message size in bytes the server can receive. +// If this is not set, gRPC uses the default limit. +func MaxRecvMessageSize(sz int) ServeOption { + return func(o *ServeOptions) error { + o.MaxRecvMsgSize = sz + return nil + } +} + // Serve the supplied Function by creating a gRPC server and listening for // RunFunctionRequests. Blocks until the server returns an error. func Serve(fn v1beta1.FunctionRunnerServiceServer, o ...ServeOption) error { so := &ServeOptions{ - Network: DefaultNetwork, - Address: DefaultAddress, + Network: DefaultNetwork, + Address: DefaultAddress, + MaxRecvMsgSize: DefaultMaxRecvMsgSize, } for _, fn := range o { @@ -137,7 +149,7 @@ func Serve(fn v1beta1.FunctionRunnerServiceServer, o ...ServeOption) error { return errors.Wrapf(err, "cannot listen for %s connections at address %q", so.Network, so.Address) } - srv := grpc.NewServer(grpc.Creds(so.Credentials)) + srv := grpc.NewServer(grpc.MaxRecvMsgSize(so.MaxRecvMsgSize), grpc.Creds(so.Credentials)) reflection.Register(srv) v1beta1.RegisterFunctionRunnerServiceServer(srv, fn) return errors.Wrap(srv.Serve(lis), "cannot serve mTLS gRPC connections")