diff --git a/Dockerfile b/Dockerfile index ec6e02a59..d572a1280 100644 --- a/Dockerfile +++ b/Dockerfile @@ -219,8 +219,6 @@ COPY ./api/time/time.proto /api/time/time.proto RUN protoc -I/api -I/api/vendor/ --go_out=paths=source_relative:/api --go-grpc_out=paths=source_relative:/api --go-vtproto_out=paths=source_relative:/api --go-vtproto_opt=features=marshal+unmarshal+size time/time.proto COPY ./api/cluster/cluster.proto /api/cluster/cluster.proto RUN protoc -I/api -I/api/vendor/ --go_out=paths=source_relative:/api --go-grpc_out=paths=source_relative:/api --go-vtproto_out=paths=source_relative:/api --go-vtproto_opt=features=marshal+unmarshal+size cluster/cluster.proto -COPY ./api/resource/resource.proto /api/resource/resource.proto -RUN protoc -I/api -I/api/vendor/ --go_out=paths=source_relative:/api --go-grpc_out=paths=source_relative:/api --go-vtproto_out=paths=source_relative:/api --go-vtproto_opt=features=marshal+unmarshal+size resource/resource.proto COPY ./api/resource/config/config.proto /api/resource/config/config.proto RUN protoc -I/api -I/api/vendor/ --go_out=paths=source_relative:/api --go-grpc_out=paths=source_relative:/api --go-vtproto_out=paths=source_relative:/api --go-vtproto_opt=features=marshal+unmarshal+size resource/config/config.proto COPY ./api/resource/network/device_config.proto /api/resource/network/device_config.proto @@ -899,7 +897,6 @@ RUN protoc \ /protos/resource/definitions/**/*.proto \ /protos/inspect/*.proto \ /protos/machine/*.proto \ - /protos/resource/*.proto \ /protos/security/*.proto \ /protos/storage/*.proto \ /protos/time/*.proto diff --git a/api/api.descriptors b/api/api.descriptors index fbad017e4..caf6b1003 100644 Binary files a/api/api.descriptors and b/api/api.descriptors differ diff --git a/api/resource/resource.proto b/api/resource/resource.proto deleted file mode 100644 index f2e87ce2c..000000000 --- a/api/resource/resource.proto +++ /dev/null @@ -1,97 +0,0 @@ -syntax = "proto3"; - -package resource; - -option go_package = "github.com/siderolabs/talos/pkg/machinery/api/resource"; - -import "common/common.proto"; -import "google/protobuf/timestamp.proto"; - -// The resource service definition. -// -// ResourceService provides user-facing API for the Talos resources. -service ResourceService { - option (common.remove_deprecated_service) = "v1.5"; - option deprecated = true; - rpc Get(GetRequest) returns (GetResponse); - rpc List(ListRequest) returns (stream ListResponse); - rpc Watch(WatchRequest) returns (stream WatchResponse); -} - -// common resource definition - -message Resource { - Metadata metadata = 1; - Spec spec = 2; -} - -message Metadata { - string namespace = 1; - string type = 2; - string id = 3; - string version = 4; - string owner = 7; - string phase = 5; - google.protobuf.Timestamp created = 8; - google.protobuf.Timestamp updated = 9; - repeated string finalizers = 6; - map labels = 10; - map annotations = 11; -} - -message Spec { - bytes yaml = 1; -} - -// rpc Get -message GetRequest { - string namespace = 1; - string type = 2; - string id = 3; -} - -// The GetResponse message contains the Resource returned. -message Get { - common.Metadata metadata = 1; - Resource definition = 2; - Resource resource = 3; -} - -message GetResponse { - repeated Get messages = 1; -} - -// rpc List -// The ListResponse message contains the Resource returned. -message ListRequest { - string namespace = 1; - string type = 2; -} - -message ListResponse { - common.Metadata metadata = 1; - Resource definition = 2; - Resource resource = 3; -} - -// rpc Watch -// The WatchResponse message contains the Resource returned. -message WatchRequest { - string namespace = 1; - string type = 2; - string id = 3; - uint32 tail_events = 4; -} - -enum EventType { - CREATED = 0; - UPDATED = 1; - DESTROYED = 2; -} - -message WatchResponse { - common.Metadata metadata = 1; - EventType event_type = 2; - Resource definition = 3; - Resource resource = 4; -} diff --git a/cmd/talosctl/cmd/talos/get.go b/cmd/talosctl/cmd/talos/get.go index 08ce2f3e9..d4a110f4d 100644 --- a/cmd/talosctl/cmd/talos/get.go +++ b/cmd/talosctl/cmd/talos/get.go @@ -140,6 +140,8 @@ func getResources(args []string) func(ctx context.Context, c *client.Client) err go aggregateEvents(ctx, aggregatedCh, watchCh, node) } + var bootstrapped bool + for { var nev nodeAndEvent @@ -154,7 +156,12 @@ func getResources(args []string) func(ctx context.Context, c *client.Client) err } if nev.ev.Type == state.Bootstrapped { - // TODO: in Talos 1.4, use Bootstrapped event to determine whether it's time to flush the first line + bootstrapped = true + + if err = out.Flush(); err != nil { + return err + } + continue } @@ -167,8 +174,10 @@ func getResources(args []string) func(ctx context.Context, c *client.Client) err return err } - if err = out.Flush(); err != nil { - return err + if bootstrapped { + if err = out.Flush(); err != nil { + return err + } } } } diff --git a/internal/app/apid/main.go b/internal/app/apid/main.go index d7b23ff77..89ad6a106 100644 --- a/internal/app/apid/main.go +++ b/internal/app/apid/main.go @@ -131,8 +131,6 @@ func apidMain() error { "/machine.MachineService/Logs", "/machine.MachineService/PacketCapture", "/machine.MachineService/Read", - "/resource.ResourceService/List", - "/resource.ResourceService/Watch", "/os.OSService/Dmesg", "/cluster.ClusterService/HealthCheck", } { diff --git a/internal/app/apid/pkg/backend/apid_test.go b/internal/app/apid/pkg/backend/apid_test.go index 3785b43f3..364788323 100644 --- a/internal/app/apid/pkg/backend/apid_test.go +++ b/internal/app/apid/pkg/backend/apid_test.go @@ -26,7 +26,6 @@ import ( "github.com/siderolabs/talos/pkg/machinery/api/common" "github.com/siderolabs/talos/pkg/machinery/api/inspect" "github.com/siderolabs/talos/pkg/machinery/api/machine" - "github.com/siderolabs/talos/pkg/machinery/api/resource" "github.com/siderolabs/talos/pkg/machinery/api/security" "github.com/siderolabs/talos/pkg/machinery/api/storage" "github.com/siderolabs/talos/pkg/machinery/api/time" @@ -211,7 +210,6 @@ func TestAPIIdiosyncrasies(t *testing.T) { cluster.File_cluster_cluster_proto.Services(), inspect.File_inspect_inspect_proto.Services(), machine.File_machine_machine_proto.Services(), - resource.File_resource_resource_proto.Services(), // security.File_security_security_proto.Services() is different storage.File_storage_storage_proto.Services(), time.File_time_time_proto.Services(), @@ -361,7 +359,6 @@ func TestDeprecatedAPIs(t *testing.T) { cluster.File_cluster_cluster_proto, inspect.File_inspect_inspect_proto, machine.File_machine_machine_proto, - resource.File_resource_resource_proto, security.File_security_security_proto, storage.File_storage_storage_proto, time.File_time_time_proto, diff --git a/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go b/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go index 4d1a45da1..9366ed8ca 100644 --- a/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go +++ b/internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go @@ -76,7 +76,6 @@ import ( "github.com/siderolabs/talos/pkg/machinery/api/common" "github.com/siderolabs/talos/pkg/machinery/api/inspect" "github.com/siderolabs/talos/pkg/machinery/api/machine" - "github.com/siderolabs/talos/pkg/machinery/api/resource" "github.com/siderolabs/talos/pkg/machinery/api/storage" timeapi "github.com/siderolabs/talos/pkg/machinery/api/time" clientconfig "github.com/siderolabs/talos/pkg/machinery/client/config" @@ -148,7 +147,6 @@ func (s *Server) Register(obj *grpc.Server) { machine.RegisterMachineServiceServer(obj, s) cluster.RegisterClusterServiceServer(obj, s) - resource.RegisterResourceServiceServer(obj, &resources.Server{Resources: resourceState}) //nolint:staticcheck cosiv1alpha1.RegisterStateServer(obj, server.NewState(resourceState)) inspect.RegisterInspectServiceServer(obj, &InspectServer{server: s}) storage.RegisterStorageServiceServer(obj, &storaged.Server{Controller: s.Controller}) diff --git a/internal/app/machined/pkg/system/services/machined.go b/internal/app/machined/pkg/system/services/machined.go index 130e3d471..f48563afa 100644 --- a/internal/app/machined/pkg/system/services/machined.go +++ b/internal/app/machined/pkg/system/services/machined.go @@ -85,15 +85,12 @@ var rules = map[string]role.Set{ "/machine.MachineService/Version": role.MakeSet(role.Admin, role.Operator, role.Reader), // per-type authorization is handled by the service itself - "/resource.ResourceService/Get": role.MakeSet(role.Admin, role.Operator, role.Reader), - "/resource.ResourceService/List": role.MakeSet(role.Admin, role.Operator, role.Reader), - "/resource.ResourceService/Watch": role.MakeSet(role.Admin, role.Operator, role.Reader), - "/cosi.resource.State/Create": role.MakeSet(role.Admin), - "/cosi.resource.State/Destroy": role.MakeSet(role.Admin), - "/cosi.resource.State/Get": role.MakeSet(role.Admin, role.Operator, role.Reader), - "/cosi.resource.State/List": role.MakeSet(role.Admin, role.Operator, role.Reader), - "/cosi.resource.State/Update": role.MakeSet(role.Admin), - "/cosi.resource.State/Watch": role.MakeSet(role.Admin, role.Operator, role.Reader), + "/cosi.resource.State/Create": role.MakeSet(role.Admin), + "/cosi.resource.State/Destroy": role.MakeSet(role.Admin), + "/cosi.resource.State/Get": role.MakeSet(role.Admin, role.Operator, role.Reader), + "/cosi.resource.State/List": role.MakeSet(role.Admin, role.Operator, role.Reader), + "/cosi.resource.State/Update": role.MakeSet(role.Admin), + "/cosi.resource.State/Watch": role.MakeSet(role.Admin, role.Operator, role.Reader), "/storage.StorageService/Disks": role.MakeSet(role.Admin, role.Operator, role.Reader), diff --git a/internal/app/machined/pkg/system/services/machined_test.go b/internal/app/machined/pkg/system/services/machined_test.go index aed2a291c..6b60fc49f 100644 --- a/internal/app/machined/pkg/system/services/machined_test.go +++ b/internal/app/machined/pkg/system/services/machined_test.go @@ -16,7 +16,6 @@ import ( "github.com/siderolabs/talos/pkg/machinery/api/cluster" "github.com/siderolabs/talos/pkg/machinery/api/inspect" "github.com/siderolabs/talos/pkg/machinery/api/machine" - "github.com/siderolabs/talos/pkg/machinery/api/resource" "github.com/siderolabs/talos/pkg/machinery/api/storage" "github.com/siderolabs/talos/pkg/machinery/api/time" ) @@ -29,7 +28,6 @@ func collectMethods(t *testing.T) map[string]struct{} { cluster.ClusterService_ServiceDesc, inspect.InspectService_ServiceDesc, machine.MachineService_ServiceDesc, - resource.ResourceService_ServiceDesc, // security.SecurityService_ServiceDesc, - not in machined storage.StorageService_ServiceDesc, time.TimeService_ServiceDesc, diff --git a/internal/app/maintenance/server/server.go b/internal/app/maintenance/server/server.go index dc6aefef5..646534373 100644 --- a/internal/app/maintenance/server/server.go +++ b/internal/app/maintenance/server/server.go @@ -26,7 +26,6 @@ import ( storaged "github.com/siderolabs/talos/internal/app/storaged" "github.com/siderolabs/talos/internal/pkg/configuration" "github.com/siderolabs/talos/pkg/machinery/api/machine" - "github.com/siderolabs/talos/pkg/machinery/api/resource" "github.com/siderolabs/talos/pkg/machinery/api/storage" "github.com/siderolabs/talos/pkg/machinery/config/configloader" v1alpha1machine "github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1/machine" @@ -63,7 +62,6 @@ func (s *Server) Register(obj *grpc.Server) { storage.RegisterStorageServiceServer(obj, &storaged.Server{Controller: s.controller}) machine.RegisterMachineServiceServer(obj, s) - resource.RegisterResourceServiceServer(obj, &resources.Server{Resources: resourceState}) //nolint:staticcheck cosiv1alpha1.RegisterStateServer(obj, server.NewState(resourceState)) } diff --git a/internal/app/resources/access.go b/internal/app/resources/access.go index 9ad24d87b..6faa5b721 100644 --- a/internal/app/resources/access.go +++ b/internal/app/resources/access.go @@ -2,6 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +// Package resources contains shared implementation of COSI resource API. package resources import ( diff --git a/internal/app/resources/server.go b/internal/app/resources/server.go deleted file mode 100644 index ec7ee4e83..000000000 --- a/internal/app/resources/server.go +++ /dev/null @@ -1,290 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -// Package resources implements resources API server. -package resources - -import ( - "context" - "fmt" - "strings" - - "github.com/cosi-project/runtime/pkg/resource" - "github.com/cosi-project/runtime/pkg/resource/meta" - "github.com/cosi-project/runtime/pkg/state" - "github.com/siderolabs/gen/slices" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - yaml "gopkg.in/yaml.v3" - - resourceapi "github.com/siderolabs/talos/pkg/machinery/api/resource" -) - -// Server implements ResourceService API. -type Server struct { - resourceapi.UnimplementedResourceServiceServer - - Resources state.State -} - -func marshalResource(r resource.Resource) (*resourceapi.Resource, error) { - md := &resourceapi.Metadata{ - Namespace: r.Metadata().Namespace(), - Type: r.Metadata().Type(), - Id: r.Metadata().ID(), - Version: r.Metadata().Version().String(), - Phase: r.Metadata().Phase().String(), - Owner: r.Metadata().Owner(), - Created: timestamppb.New(r.Metadata().Created()), - Updated: timestamppb.New(r.Metadata().Updated()), - } - - for _, fin := range *r.Metadata().Finalizers() { - md.Finalizers = append(md.Finalizers, fin) - } - - spec := &resourceapi.Spec{} - - if !resource.IsTombstone(r) && r.Spec() != nil { - var err error - - spec.Yaml, err = yaml.Marshal(r.Spec()) - if err != nil { - return nil, err - } - } - - return &resourceapi.Resource{ - Metadata: md, - Spec: spec, - }, nil -} - -type resourceKind struct { - Namespace resource.Namespace - Type resource.Type -} - -//nolint:gocyclo -func (s *Server) resolveResourceKind(ctx context.Context, kind *resourceKind) (*meta.ResourceDefinition, error) { - registeredResources, err := s.Resources.List(ctx, resource.NewMetadata(meta.NamespaceName, meta.ResourceDefinitionType, "", resource.VersionUndefined)) - if err != nil { - return nil, err - } - - matched := []*meta.ResourceDefinition{} - - for _, item := range registeredResources.Items { - rd, ok := item.(*meta.ResourceDefinition) - if !ok { - return nil, fmt.Errorf("unexpected resource definition type") - } - - if strings.EqualFold(rd.Metadata().ID(), kind.Type) { - matched = append(matched, rd) - - continue - } - - spec := rd.TypedSpec() - - for _, alias := range spec.AllAliases { - if strings.EqualFold(alias, kind.Type) { - matched = append(matched, rd) - - break - } - } - } - - switch { - case len(matched) == 1: - kind.Type = matched[0].TypedSpec().Type - - if kind.Namespace == "" { - kind.Namespace = matched[0].TypedSpec().DefaultNamespace - } - - return matched[0], nil - case len(matched) > 1: - matchedTypes := slices.Map(matched, func(rd *meta.ResourceDefinition) string { return rd.Metadata().ID() }) - - return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("resource type %q is ambiguous: %v", kind.Type, matchedTypes)) - default: - return nil, status.Error(codes.NotFound, fmt.Sprintf("resource %q is not registered", kind.Type)) - } -} - -// Get implements resource.ResourceServiceServer interface. -func (s *Server) Get(ctx context.Context, in *resourceapi.GetRequest) (*resourceapi.GetResponse, error) { - kind := &resourceKind{ - Namespace: in.GetNamespace(), - Type: in.GetType(), - } - - rd, err := s.resolveResourceKind(ctx, kind) - if err != nil { - return nil, err - } - - r, err := s.Resources.Get(ctx, resource.NewMetadata(kind.Namespace, kind.Type, in.GetId(), resource.VersionUndefined)) - if err != nil { - if state.IsNotFoundError(err) { - return nil, status.Error(codes.NotFound, err.Error()) - } - - return nil, err - } - - protoD, err := marshalResource(rd) - if err != nil { - return nil, err - } - - protoR, err := marshalResource(r) - if err != nil { - return nil, err - } - - return &resourceapi.GetResponse{ - Messages: []*resourceapi.Get{ - { - Definition: protoD, - Resource: protoR, - }, - }, - }, nil -} - -// List implements resource.ResourceServiceServer interface. -func (s *Server) List(in *resourceapi.ListRequest, srv resourceapi.ResourceService_ListServer) error { - kind := &resourceKind{ - Namespace: in.GetNamespace(), - Type: in.GetType(), - } - - rd, err := s.resolveResourceKind(srv.Context(), kind) - if err != nil { - return err - } - - list, err := s.Resources.List(srv.Context(), resource.NewMetadata(kind.Namespace, kind.Type, "", resource.VersionUndefined)) - if err != nil { - return err - } - - protoD, err := marshalResource(rd) - if err != nil { - return err - } - - if err = srv.Send(&resourceapi.ListResponse{ - Definition: protoD, - }); err != nil { - return err - } - - for _, r := range list.Items { - protoR, err := marshalResource(r) - if err != nil { - return err - } - - if err = srv.Send(&resourceapi.ListResponse{ - Resource: protoR, - }); err != nil { - return err - } - } - - return nil -} - -// Watch implements resource.ResourceServiceServer interface. -// -//nolint:gocyclo -func (s *Server) Watch(in *resourceapi.WatchRequest, srv resourceapi.ResourceService_WatchServer) error { - kind := &resourceKind{ - Namespace: in.GetNamespace(), - Type: in.GetType(), - } - - rd, err := s.resolveResourceKind(srv.Context(), kind) - if err != nil { - return err - } - - protoD, err := marshalResource(rd) - if err != nil { - return err - } - - if err = srv.Send(&resourceapi.WatchResponse{ - Definition: protoD, - }); err != nil { - return err - } - - ctx, cancel := context.WithCancel(srv.Context()) - defer cancel() - - eventCh := make(chan state.Event) - - md := resource.NewMetadata(kind.Namespace, kind.Type, in.GetId(), resource.VersionUndefined) - - if in.GetId() == "" { - opts := []state.WatchKindOption{} - - if in.TailEvents > 0 { - opts = append(opts, state.WithKindTailEvents(int(in.TailEvents))) - } else { - opts = append(opts, state.WithBootstrapContents(true)) - } - - err = s.Resources.WatchKind(ctx, md, eventCh, opts...) - } else { - opts := []state.WatchOption{} - - if in.TailEvents > 0 { - opts = append(opts, state.WithTailEvents(int(in.TailEvents))) - } - - err = s.Resources.Watch(ctx, md, eventCh, opts...) - } - - if err != nil { - return fmt.Errorf("error setting up watch: %w", err) - } - - for event := range eventCh { - protoR, err := marshalResource(event.Resource) - if err != nil { - return err - } - - resp := &resourceapi.WatchResponse{ - Resource: protoR, - } - - switch event.Type { - case state.Created: - resp.EventType = resourceapi.EventType_CREATED - case state.Updated: - resp.EventType = resourceapi.EventType_UPDATED - case state.Destroyed: - resp.EventType = resourceapi.EventType_DESTROYED - case state.Bootstrapped: - // ignore - case state.Errored: - return fmt.Errorf("error watching resource: %w", event.Error) - } - - if err = srv.Send(resp); err != nil { - return err - } - } - - return nil -} diff --git a/pkg/machinery/api/resource/resource.pb.go b/pkg/machinery/api/resource/resource.pb.go deleted file mode 100644 index 57b376a1c..000000000 --- a/pkg/machinery/api/resource/resource.pb.go +++ /dev/null @@ -1,1078 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.0 -// source: resource/resource.proto - -package resource - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - common "github.com/siderolabs/talos/pkg/machinery/api/common" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type EventType int32 - -const ( - EventType_CREATED EventType = 0 - EventType_UPDATED EventType = 1 - EventType_DESTROYED EventType = 2 -) - -// Enum value maps for EventType. -var ( - EventType_name = map[int32]string{ - 0: "CREATED", - 1: "UPDATED", - 2: "DESTROYED", - } - EventType_value = map[string]int32{ - "CREATED": 0, - "UPDATED": 1, - "DESTROYED": 2, - } -) - -func (x EventType) Enum() *EventType { - p := new(EventType) - *p = x - return p -} - -func (x EventType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (EventType) Descriptor() protoreflect.EnumDescriptor { - return file_resource_resource_proto_enumTypes[0].Descriptor() -} - -func (EventType) Type() protoreflect.EnumType { - return &file_resource_resource_proto_enumTypes[0] -} - -func (x EventType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use EventType.Descriptor instead. -func (EventType) EnumDescriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{0} -} - -type Resource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - Spec *Spec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (x *Resource) Reset() { - *x = Resource{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Resource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Resource) ProtoMessage() {} - -func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Resource.ProtoReflect.Descriptor instead. -func (*Resource) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{0} -} - -func (x *Resource) GetMetadata() *Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *Resource) GetSpec() *Spec { - if x != nil { - return x.Spec - } - return nil -} - -type Metadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` - Phase string `protobuf:"bytes,5,opt,name=phase,proto3" json:"phase,omitempty"` - Created *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created,proto3" json:"created,omitempty"` - Updated *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated,proto3" json:"updated,omitempty"` - Finalizers []string `protobuf:"bytes,6,rep,name=finalizers,proto3" json:"finalizers,omitempty"` - Labels map[string]string `protobuf:"bytes,10,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Annotations map[string]string `protobuf:"bytes,11,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Metadata) Reset() { - *x = Metadata{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Metadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Metadata) ProtoMessage() {} - -func (x *Metadata) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_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 Metadata.ProtoReflect.Descriptor instead. -func (*Metadata) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{1} -} - -func (x *Metadata) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *Metadata) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Metadata) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Metadata) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Metadata) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *Metadata) GetPhase() string { - if x != nil { - return x.Phase - } - return "" -} - -func (x *Metadata) GetCreated() *timestamppb.Timestamp { - if x != nil { - return x.Created - } - return nil -} - -func (x *Metadata) GetUpdated() *timestamppb.Timestamp { - if x != nil { - return x.Updated - } - return nil -} - -func (x *Metadata) GetFinalizers() []string { - if x != nil { - return x.Finalizers - } - return nil -} - -func (x *Metadata) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -func (x *Metadata) GetAnnotations() map[string]string { - if x != nil { - return x.Annotations - } - return nil -} - -type Spec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Yaml []byte `protobuf:"bytes,1,opt,name=yaml,proto3" json:"yaml,omitempty"` -} - -func (x *Spec) Reset() { - *x = Spec{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Spec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Spec) ProtoMessage() {} - -func (x *Spec) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_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 Spec.ProtoReflect.Descriptor instead. -func (*Spec) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{2} -} - -func (x *Spec) GetYaml() []byte { - if x != nil { - return x.Yaml - } - return nil -} - -// rpc Get -type GetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{3} -} - -func (x *GetRequest) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *GetRequest) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *GetRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// The GetResponse message contains the Resource returned. -type Get struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - Definition *Resource `protobuf:"bytes,2,opt,name=definition,proto3" json:"definition,omitempty"` - Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *Get) Reset() { - *x = Get{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Get) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Get) ProtoMessage() {} - -func (x *Get) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Get.ProtoReflect.Descriptor instead. -func (*Get) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{4} -} - -func (x *Get) GetMetadata() *common.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *Get) GetDefinition() *Resource { - if x != nil { - return x.Definition - } - return nil -} - -func (x *Get) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -type GetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Messages []*Get `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{5} -} - -func (x *GetResponse) GetMessages() []*Get { - if x != nil { - return x.Messages - } - return nil -} - -// rpc List -// The ListResponse message contains the Resource returned. -type ListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` -} - -func (x *ListRequest) Reset() { - *x = ListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest) ProtoMessage() {} - -func (x *ListRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. -func (*ListRequest) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{6} -} - -func (x *ListRequest) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *ListRequest) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -type ListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - Definition *Resource `protobuf:"bytes,2,opt,name=definition,proto3" json:"definition,omitempty"` - Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *ListResponse) Reset() { - *x = ListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResponse) ProtoMessage() {} - -func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. -func (*ListResponse) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{7} -} - -func (x *ListResponse) GetMetadata() *common.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *ListResponse) GetDefinition() *Resource { - if x != nil { - return x.Definition - } - return nil -} - -func (x *ListResponse) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -// rpc Watch -// The WatchResponse message contains the Resource returned. -type WatchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - TailEvents uint32 `protobuf:"varint,4,opt,name=tail_events,json=tailEvents,proto3" json:"tail_events,omitempty"` -} - -func (x *WatchRequest) Reset() { - *x = WatchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchRequest) ProtoMessage() {} - -func (x *WatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[8] - 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 WatchRequest.ProtoReflect.Descriptor instead. -func (*WatchRequest) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{8} -} - -func (x *WatchRequest) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *WatchRequest) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *WatchRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *WatchRequest) GetTailEvents() uint32 { - if x != nil { - return x.TailEvents - } - return 0 -} - -type WatchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - EventType EventType `protobuf:"varint,2,opt,name=event_type,json=eventType,proto3,enum=resource.EventType" json:"event_type,omitempty"` - Definition *Resource `protobuf:"bytes,3,opt,name=definition,proto3" json:"definition,omitempty"` - Resource *Resource `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *WatchResponse) Reset() { - *x = WatchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_resource_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchResponse) ProtoMessage() {} - -func (x *WatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_resource_proto_msgTypes[9] - 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 WatchResponse.ProtoReflect.Descriptor instead. -func (*WatchResponse) Descriptor() ([]byte, []int) { - return file_resource_resource_proto_rawDescGZIP(), []int{9} -} - -func (x *WatchResponse) GetMetadata() *common.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *WatchResponse) GetEventType() EventType { - if x != nil { - return x.EventType - } - return EventType_CREATED -} - -func (x *WatchResponse) GetDefinition() *Resource { - if x != nil { - return x.Definition - } - return nil -} - -func (x *WatchResponse) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -var File_resource_resource_proto protoreflect.FileDescriptor - -var file_resource_resource_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5e, 0x0a, 0x08, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, - 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x98, 0x04, 0x0a, 0x08, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, 0x34, - 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x66, 0x69, - 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, - 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 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, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1a, 0x0a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, - 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, - 0x22, 0x4e, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x97, 0x01, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0a, - 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x38, 0x0a, 0x0b, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0a, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x71, 0x0a, 0x0c, 0x57, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, - 0x69, 0x6c, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd5, 0x01, 0x0a, 0x0d, - 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x0a, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x13, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x32, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2a, 0x34, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, - 0x53, 0x54, 0x52, 0x4f, 0x59, 0x45, 0x44, 0x10, 0x02, 0x32, 0xc7, 0x01, 0x0a, 0x0f, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x32, 0x0a, - 0x03, 0x47, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x37, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x3a, 0x0a, 0x05, 0x57, 0x61, - 0x74, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x1a, 0x0b, 0xea, 0xbb, 0x2d, 0x04, 0x76, 0x31, 0x2e, 0x35, - 0x88, 0x02, 0x01, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x74, 0x61, 0x6c, - 0x6f, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x72, 0x79, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_resource_resource_proto_rawDescOnce sync.Once - file_resource_resource_proto_rawDescData = file_resource_resource_proto_rawDesc -) - -func file_resource_resource_proto_rawDescGZIP() []byte { - file_resource_resource_proto_rawDescOnce.Do(func() { - file_resource_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_resource_resource_proto_rawDescData) - }) - return file_resource_resource_proto_rawDescData -} - -var file_resource_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_resource_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_resource_resource_proto_goTypes = []interface{}{ - (EventType)(0), // 0: resource.EventType - (*Resource)(nil), // 1: resource.Resource - (*Metadata)(nil), // 2: resource.Metadata - (*Spec)(nil), // 3: resource.Spec - (*GetRequest)(nil), // 4: resource.GetRequest - (*Get)(nil), // 5: resource.Get - (*GetResponse)(nil), // 6: resource.GetResponse - (*ListRequest)(nil), // 7: resource.ListRequest - (*ListResponse)(nil), // 8: resource.ListResponse - (*WatchRequest)(nil), // 9: resource.WatchRequest - (*WatchResponse)(nil), // 10: resource.WatchResponse - nil, // 11: resource.Metadata.LabelsEntry - nil, // 12: resource.Metadata.AnnotationsEntry - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (*common.Metadata)(nil), // 14: common.Metadata -} -var file_resource_resource_proto_depIdxs = []int32{ - 2, // 0: resource.Resource.metadata:type_name -> resource.Metadata - 3, // 1: resource.Resource.spec:type_name -> resource.Spec - 13, // 2: resource.Metadata.created:type_name -> google.protobuf.Timestamp - 13, // 3: resource.Metadata.updated:type_name -> google.protobuf.Timestamp - 11, // 4: resource.Metadata.labels:type_name -> resource.Metadata.LabelsEntry - 12, // 5: resource.Metadata.annotations:type_name -> resource.Metadata.AnnotationsEntry - 14, // 6: resource.Get.metadata:type_name -> common.Metadata - 1, // 7: resource.Get.definition:type_name -> resource.Resource - 1, // 8: resource.Get.resource:type_name -> resource.Resource - 5, // 9: resource.GetResponse.messages:type_name -> resource.Get - 14, // 10: resource.ListResponse.metadata:type_name -> common.Metadata - 1, // 11: resource.ListResponse.definition:type_name -> resource.Resource - 1, // 12: resource.ListResponse.resource:type_name -> resource.Resource - 14, // 13: resource.WatchResponse.metadata:type_name -> common.Metadata - 0, // 14: resource.WatchResponse.event_type:type_name -> resource.EventType - 1, // 15: resource.WatchResponse.definition:type_name -> resource.Resource - 1, // 16: resource.WatchResponse.resource:type_name -> resource.Resource - 4, // 17: resource.ResourceService.Get:input_type -> resource.GetRequest - 7, // 18: resource.ResourceService.List:input_type -> resource.ListRequest - 9, // 19: resource.ResourceService.Watch:input_type -> resource.WatchRequest - 6, // 20: resource.ResourceService.Get:output_type -> resource.GetResponse - 8, // 21: resource.ResourceService.List:output_type -> resource.ListResponse - 10, // 22: resource.ResourceService.Watch:output_type -> resource.WatchResponse - 20, // [20:23] is the sub-list for method output_type - 17, // [17:20] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name -} - -func init() { file_resource_resource_proto_init() } -func file_resource_resource_proto_init() { - if File_resource_resource_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_resource_resource_proto_msgTypes[0].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_resource_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Metadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Spec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Get); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_resource_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_resource_resource_proto_rawDesc, - NumEnums: 1, - NumMessages: 12, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_resource_resource_proto_goTypes, - DependencyIndexes: file_resource_resource_proto_depIdxs, - EnumInfos: file_resource_resource_proto_enumTypes, - MessageInfos: file_resource_resource_proto_msgTypes, - }.Build() - File_resource_resource_proto = out.File - file_resource_resource_proto_rawDesc = nil - file_resource_resource_proto_goTypes = nil - file_resource_resource_proto_depIdxs = nil -} diff --git a/pkg/machinery/api/resource/resource_grpc.pb.go b/pkg/machinery/api/resource/resource_grpc.pb.go deleted file mode 100644 index e05e4456b..000000000 --- a/pkg/machinery/api/resource/resource_grpc.pb.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.0 -// source: resource/resource.proto - -package resource - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - ResourceService_Get_FullMethodName = "/resource.ResourceService/Get" - ResourceService_List_FullMethodName = "/resource.ResourceService/List" - ResourceService_Watch_FullMethodName = "/resource.ResourceService/Watch" -) - -// ResourceServiceClient is the client API for ResourceService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Deprecated: Do not use. -type ResourceServiceClient interface { - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (ResourceService_ListClient, error) - Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (ResourceService_WatchClient, error) -} - -type resourceServiceClient struct { - cc grpc.ClientConnInterface -} - -// Deprecated: Do not use. -func NewResourceServiceClient(cc grpc.ClientConnInterface) ResourceServiceClient { - return &resourceServiceClient{cc} -} - -func (c *resourceServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { - out := new(GetResponse) - err := c.cc.Invoke(ctx, ResourceService_Get_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (ResourceService_ListClient, error) { - stream, err := c.cc.NewStream(ctx, &ResourceService_ServiceDesc.Streams[0], ResourceService_List_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &resourceServiceListClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type ResourceService_ListClient interface { - Recv() (*ListResponse, error) - grpc.ClientStream -} - -type resourceServiceListClient struct { - grpc.ClientStream -} - -func (x *resourceServiceListClient) Recv() (*ListResponse, error) { - m := new(ListResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *resourceServiceClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (ResourceService_WatchClient, error) { - stream, err := c.cc.NewStream(ctx, &ResourceService_ServiceDesc.Streams[1], ResourceService_Watch_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &resourceServiceWatchClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type ResourceService_WatchClient interface { - Recv() (*WatchResponse, error) - grpc.ClientStream -} - -type resourceServiceWatchClient struct { - grpc.ClientStream -} - -func (x *resourceServiceWatchClient) Recv() (*WatchResponse, error) { - m := new(WatchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ResourceServiceServer is the server API for ResourceService service. -// All implementations must embed UnimplementedResourceServiceServer -// for forward compatibility -// -// Deprecated: Do not use. -type ResourceServiceServer interface { - Get(context.Context, *GetRequest) (*GetResponse, error) - List(*ListRequest, ResourceService_ListServer) error - Watch(*WatchRequest, ResourceService_WatchServer) error - mustEmbedUnimplementedResourceServiceServer() -} - -// UnimplementedResourceServiceServer must be embedded to have forward compatible implementations. -type UnimplementedResourceServiceServer struct { -} - -func (UnimplementedResourceServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedResourceServiceServer) List(*ListRequest, ResourceService_ListServer) error { - return status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedResourceServiceServer) Watch(*WatchRequest, ResourceService_WatchServer) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} -func (UnimplementedResourceServiceServer) mustEmbedUnimplementedResourceServiceServer() {} - -// UnsafeResourceServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ResourceServiceServer will -// result in compilation errors. -type UnsafeResourceServiceServer interface { - mustEmbedUnimplementedResourceServiceServer() -} - -// Deprecated: Do not use. -func RegisterResourceServiceServer(s grpc.ServiceRegistrar, srv ResourceServiceServer) { - s.RegisterService(&ResourceService_ServiceDesc, srv) -} - -func _ResourceService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceServiceServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceService_Get_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceServiceServer).Get(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceService_List_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ListRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ResourceServiceServer).List(m, &resourceServiceListServer{stream}) -} - -type ResourceService_ListServer interface { - Send(*ListResponse) error - grpc.ServerStream -} - -type resourceServiceListServer struct { - grpc.ServerStream -} - -func (x *resourceServiceListServer) Send(m *ListResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _ResourceService_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(WatchRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ResourceServiceServer).Watch(m, &resourceServiceWatchServer{stream}) -} - -type ResourceService_WatchServer interface { - Send(*WatchResponse) error - grpc.ServerStream -} - -type resourceServiceWatchServer struct { - grpc.ServerStream -} - -func (x *resourceServiceWatchServer) Send(m *WatchResponse) error { - return x.ServerStream.SendMsg(m) -} - -// ResourceService_ServiceDesc is the grpc.ServiceDesc for ResourceService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ResourceService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "resource.ResourceService", - HandlerType: (*ResourceServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _ResourceService_Get_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "List", - Handler: _ResourceService_List_Handler, - ServerStreams: true, - }, - { - StreamName: "Watch", - Handler: _ResourceService_Watch_Handler, - ServerStreams: true, - }, - }, - Metadata: "resource/resource.proto", -} diff --git a/pkg/machinery/api/resource/resource_vtproto.pb.go b/pkg/machinery/api/resource/resource_vtproto.pb.go deleted file mode 100644 index 99901715d..000000000 --- a/pkg/machinery/api/resource/resource_vtproto.pb.go +++ /dev/null @@ -1,2955 +0,0 @@ -// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 -// source: resource/resource.proto - -package resource - -import ( - fmt "fmt" - io "io" - bits "math/bits" - - proto "google.golang.org/protobuf/proto" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - - common "github.com/siderolabs/talos/pkg/machinery/api/common" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -func (m *Resource) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Resource) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *Resource) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if m.Spec != nil { - size, err := m.Spec.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if m.Metadata != nil { - size, err := m.Metadata.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Metadata) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Metadata) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *Metadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.Annotations) > 0 { - for k := range m.Annotations { - v := m.Annotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x5a - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x52 - } - } - if m.Updated != nil { - if vtmsg, ok := interface{}(m.Updated).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.Updated) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) - } - i-- - dAtA[i] = 0x4a - } - if m.Created != nil { - if vtmsg, ok := interface{}(m.Created).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.Created) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) - } - i-- - dAtA[i] = 0x42 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarint(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x3a - } - if len(m.Finalizers) > 0 { - for iNdEx := len(m.Finalizers) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Finalizers[iNdEx]) - copy(dAtA[i:], m.Finalizers[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Finalizers[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Phase) > 0 { - i -= len(m.Phase) - copy(dAtA[i:], m.Phase) - i = encodeVarint(dAtA, i, uint64(len(m.Phase))) - i-- - dAtA[i] = 0x2a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarint(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x22 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0x1a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarint(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x12 - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarint(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Spec) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Spec) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *Spec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.Yaml) > 0 { - i -= len(m.Yaml) - copy(dAtA[i:], m.Yaml) - i = encodeVarint(dAtA, i, uint64(len(m.Yaml))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *GetRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0x1a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarint(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x12 - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarint(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Get) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Get) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *Get) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if m.Resource != nil { - size, err := m.Resource.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - if m.Definition != nil { - size, err := m.Definition.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if m.Metadata != nil { - if vtmsg, ok := interface{}(m.Metadata).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.Metadata) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetResponse) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetResponse) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *GetResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Messages[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *ListRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarint(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x12 - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarint(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListResponse) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListResponse) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *ListResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if m.Resource != nil { - size, err := m.Resource.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - if m.Definition != nil { - size, err := m.Definition.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if m.Metadata != nil { - if vtmsg, ok := interface{}(m.Metadata).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.Metadata) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WatchRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *WatchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if m.TailEvents != 0 { - i = encodeVarint(dAtA, i, uint64(m.TailEvents)) - i-- - dAtA[i] = 0x20 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0x1a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarint(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x12 - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarint(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WatchResponse) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchResponse) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *WatchResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if m.Resource != nil { - size, err := m.Resource.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - if m.Definition != nil { - size, err := m.Definition.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - if m.EventType != 0 { - i = encodeVarint(dAtA, i, uint64(m.EventType)) - i-- - dAtA[i] = 0x10 - } - if m.Metadata != nil { - if vtmsg, ok := interface{}(m.Metadata).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.Metadata) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Resource) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metadata != nil { - l = m.Metadata.SizeVT() - n += 1 + l + sov(uint64(l)) - } - if m.Spec != nil { - l = m.Spec.SizeVT() - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - -func (m *Metadata) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Id) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Phase) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - if len(m.Finalizers) > 0 { - for _, s := range m.Finalizers { - l = len(s) - n += 1 + l + sov(uint64(l)) - } - } - l = len(m.Owner) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - if m.Created != nil { - if size, ok := interface{}(m.Created).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.Created) - } - n += 1 + l + sov(uint64(l)) - } - if m.Updated != nil { - if size, ok := interface{}(m.Updated).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.Updated) - } - n += 1 + l + sov(uint64(l)) - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) - } - } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) - } - } - n += len(m.unknownFields) - return n -} - -func (m *Spec) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Yaml) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - -func (m *GetRequest) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Id) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - -func (m *Get) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metadata != nil { - if size, ok := interface{}(m.Metadata).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.Metadata) - } - n += 1 + l + sov(uint64(l)) - } - if m.Definition != nil { - l = m.Definition.SizeVT() - n += 1 + l + sov(uint64(l)) - } - if m.Resource != nil { - l = m.Resource.SizeVT() - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - -func (m *GetResponse) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } - n += len(m.unknownFields) - return n -} - -func (m *ListRequest) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - -func (m *ListResponse) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metadata != nil { - if size, ok := interface{}(m.Metadata).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.Metadata) - } - n += 1 + l + sov(uint64(l)) - } - if m.Definition != nil { - l = m.Definition.SizeVT() - n += 1 + l + sov(uint64(l)) - } - if m.Resource != nil { - l = m.Resource.SizeVT() - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - -func (m *WatchRequest) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Id) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - if m.TailEvents != 0 { - n += 1 + sov(uint64(m.TailEvents)) - } - n += len(m.unknownFields) - return n -} - -func (m *WatchResponse) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metadata != nil { - if size, ok := interface{}(m.Metadata).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.Metadata) - } - n += 1 + l + sov(uint64(l)) - } - if m.EventType != 0 { - n += 1 + sov(uint64(m.EventType)) - } - if m.Definition != nil { - l = m.Definition.SizeVT() - n += 1 + l + sov(uint64(l)) - } - if m.Resource != nil { - l = m.Resource.SizeVT() - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Resource) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Resource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &Metadata{} - } - if err := m.Metadata.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Spec == nil { - m.Spec = &Spec{} - } - if err := m.Spec.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Metadata) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Metadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Phase", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Phase = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Finalizers", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Finalizers = append(m.Finalizers, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Created == nil { - m.Created = ×tamppb.Timestamp{} - } - if unmarshal, ok := interface{}(m.Created).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Created); err != nil { - return err - } - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Updated", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Updated == nil { - m.Updated = ×tamppb.Timestamp{} - } - if unmarshal, ok := interface{}(m.Updated).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Updated); err != nil { - return err - } - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLength - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Annotations == nil { - m.Annotations = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLength - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Annotations[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Spec) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Spec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Spec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Yaml", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Yaml = append(m.Yaml[:0], dAtA[iNdEx:postIndex]...) - if m.Yaml == nil { - m.Yaml = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetRequest) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Get) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Get: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Get: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &common.Metadata{} - } - if unmarshal, ok := interface{}(m.Metadata).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Metadata); err != nil { - return err - } - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Definition == nil { - m.Definition = &Resource{} - } - if err := m.Definition.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resource == nil { - m.Resource = &Resource{} - } - if err := m.Resource.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetResponse) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Messages = append(m.Messages, &Get{}) - if err := m.Messages[len(m.Messages)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListRequest) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListResponse) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &common.Metadata{} - } - if unmarshal, ok := interface{}(m.Metadata).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Metadata); err != nil { - return err - } - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Definition == nil { - m.Definition = &Resource{} - } - if err := m.Definition.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resource == nil { - m.Resource = &Resource{} - } - if err := m.Resource.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchRequest) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TailEvents", wireType) - } - m.TailEvents = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TailEvents |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchResponse) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &common.Metadata{} - } - if unmarshal, ok := interface{}(m.Metadata).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Metadata); err != nil { - return err - } - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventType", wireType) - } - m.EventType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EventType |= EventType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Definition", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Definition == nil { - m.Definition = &Resource{} - } - if err := m.Definition.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resource == nil { - m.Resource = &Resource{} - } - if err := m.Resource.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/machinery/client/client.go b/pkg/machinery/client/client.go index dd281f3ed..1fe7d7fde 100644 --- a/pkg/machinery/client/client.go +++ b/pkg/machinery/client/client.go @@ -28,7 +28,6 @@ import ( "github.com/siderolabs/talos/pkg/machinery/api/common" inspectapi "github.com/siderolabs/talos/pkg/machinery/api/inspect" machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine" - resourceapi "github.com/siderolabs/talos/pkg/machinery/api/resource" storageapi "github.com/siderolabs/talos/pkg/machinery/api/storage" timeapi "github.com/siderolabs/talos/pkg/machinery/api/time" clientconfig "github.com/siderolabs/talos/pkg/machinery/client/config" @@ -46,10 +45,6 @@ type Client struct { StorageClient storageapi.StorageServiceClient InspectClient inspectapi.InspectServiceClient - // Deprecated: use COSI client. - Resources *ResourcesClient - ResourceClient resourceapi.ResourceServiceClient //nolint:staticcheck - COSI state.State Inspect *InspectClient @@ -169,10 +164,8 @@ func New(ctx context.Context, opts ...OptionFunc) (c *Client, err error) { c.TimeClient = timeapi.NewTimeServiceClient(c.conn) c.ClusterClient = clusterapi.NewClusterServiceClient(c.conn) c.StorageClient = storageapi.NewStorageServiceClient(c.conn) - c.ResourceClient = resourceapi.NewResourceServiceClient(c.conn) //nolint:staticcheck c.InspectClient = inspectapi.NewInspectServiceClient(c.conn) - c.Resources = &ResourcesClient{c.ResourceClient} c.Inspect = &InspectClient{c.InspectClient} c.COSI = state.WrapCore(client.NewAdapter(cosiv1alpha1.NewStateClient(c.conn))) diff --git a/pkg/machinery/client/resources_deprecated.go b/pkg/machinery/client/resources_deprecated.go deleted file mode 100644 index 51973132f..000000000 --- a/pkg/machinery/client/resources_deprecated.go +++ /dev/null @@ -1,206 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -package client - -import ( - "context" - "errors" - - "github.com/cosi-project/runtime/pkg/resource" - "github.com/cosi-project/runtime/pkg/state" - "google.golang.org/grpc" - "google.golang.org/grpc/status" - - "github.com/siderolabs/talos/pkg/machinery/api/common" - resourceapi "github.com/siderolabs/talos/pkg/machinery/api/resource" -) - -// ResourcesClient provides access to resource API. -// -// Deprecated: use COSI client. -type ResourcesClient struct { - client resourceapi.ResourceServiceClient //nolint:staticcheck -} - -// ResourceResponse is a parsed resource response. -type ResourceResponse struct { - Metadata *common.Metadata - Definition resource.Resource - Resource resource.Resource -} - -// WatchResponse is a parsed resource watch response. -type WatchResponse struct { - ResourceResponse - EventType state.EventType -} - -// Get a specified resource. -func (c *ResourcesClient) Get(ctx context.Context, resourceNamespace, resourceType, resourceID string, callOptions ...grpc.CallOption) ([]ResourceResponse, error) { - resp, err := c.client.Get(ctx, &resourceapi.GetRequest{ - Namespace: resourceNamespace, - Type: resourceType, - Id: resourceID, - }, callOptions...) - - var filtered interface{} - filtered, err = FilterMessages(resp, err) - resp, _ = filtered.(*resourceapi.GetResponse) //nolint:errcheck - - if resp == nil { - return nil, err - } - - items := make([]ResourceResponse, 0, len(resp.GetMessages())) - - for _, msg := range resp.GetMessages() { - var resourceResp ResourceResponse - - resourceResp.Metadata = msg.GetMetadata() - - if msg.GetDefinition() != nil { - var e error - - resourceResp.Definition, e = resource.NewAnyFromProto(msg.GetDefinition().GetMetadata(), msg.GetDefinition().GetSpec()) - if e != nil { - return nil, e - } - } - - if msg.GetResource() != nil { - var e error - - resourceResp.Resource, e = resource.NewAnyFromProto(msg.GetResource().GetMetadata(), msg.GetResource().GetSpec()) - if e != nil { - return nil, e - } - } - - items = append(items, resourceResp) - } - - return items, err -} - -// ResourceListClient wraps gRPC list client. -type ResourceListClient struct { - grpcClient resourceapi.ResourceService_ListClient -} - -// Recv next item from the list. -func (client *ResourceListClient) Recv() (ResourceResponse, error) { - var resourceResp ResourceResponse - - msg, err := client.grpcClient.Recv() - if err != nil { - return resourceResp, err - } - - resourceResp.Metadata = msg.GetMetadata() - - if msg.GetDefinition() != nil { - var e error - - resourceResp.Definition, e = resource.NewAnyFromProto(msg.GetDefinition().GetMetadata(), msg.GetDefinition().GetSpec()) - if e != nil { - return resourceResp, e - } - } - - if msg.GetResource() != nil { - var e error - - resourceResp.Resource, e = resource.NewAnyFromProto(msg.GetResource().GetMetadata(), msg.GetResource().GetSpec()) - if e != nil { - return resourceResp, e - } - } - - return resourceResp, nil -} - -// List resources by kind. -func (c *ResourcesClient) List(ctx context.Context, resourceNamespace, resourceType string, callOptions ...grpc.CallOption) (*ResourceListClient, error) { - client, err := c.client.List(ctx, &resourceapi.ListRequest{ - Namespace: resourceNamespace, - Type: resourceType, - }, callOptions...) - - return &ResourceListClient{ - grpcClient: client, - }, err -} - -// ResourceWatchClient wraps gRPC watch client. -type ResourceWatchClient struct { - grpcClient resourceapi.ResourceService_WatchClient -} - -// Recv next item from the list. -// -//nolint:gocyclo -func (client *ResourceWatchClient) Recv() (WatchResponse, error) { - var watchResp WatchResponse - - msg, err := client.grpcClient.Recv() - if err != nil { - return watchResp, err - } - - if msg.GetMetadata().GetError() != "" { - if msg.GetMetadata().Status != nil { - return watchResp, status.ErrorProto(msg.GetMetadata().GetStatus()) - } - - return watchResp, errors.New(msg.GetMetadata().GetError()) - } - - if msg.GetDefinition() != nil { - var e error - - watchResp.Definition, e = resource.NewAnyFromProto(msg.GetDefinition().GetMetadata(), msg.GetDefinition().GetSpec()) - if e != nil { - return watchResp, e - } - } - - if msg.GetResource() != nil { - var e error - - watchResp.Resource, e = resource.NewAnyFromProto(msg.GetResource().GetMetadata(), msg.GetResource().GetSpec()) - if e != nil { - return watchResp, e - } - } - - switch msg.GetEventType() { - case resourceapi.EventType_CREATED: - watchResp.EventType = state.Created - case resourceapi.EventType_UPDATED: - watchResp.EventType = state.Updated - case resourceapi.EventType_DESTROYED: - watchResp.EventType = state.Destroyed - } - - return watchResp, nil -} - -// Watch resources by kind or by kind and ID. -func (c *ResourcesClient) Watch(ctx context.Context, resourceNamespace, resourceType, resourceID string, callOptions ...grpc.CallOption) (*ResourceWatchClient, error) { - return c.WatchRequest(ctx, &resourceapi.WatchRequest{ - Namespace: resourceNamespace, - Type: resourceType, - Id: resourceID, - }, callOptions...) -} - -// WatchRequest resources by watch request. -func (c *ResourcesClient) WatchRequest(ctx context.Context, request *resourceapi.WatchRequest, callOptions ...grpc.CallOption) (*ResourceWatchClient, error) { - client, err := c.client.Watch(ctx, request, callOptions...) - - return &ResourceWatchClient{ - grpcClient: client, - }, err -} diff --git a/website/content/v1.5/reference/api.md b/website/content/v1.5/reference/api.md index 3655ca119..98e6674af 100644 --- a/website/content/v1.5/reference/api.md +++ b/website/content/v1.5/reference/api.md @@ -395,24 +395,6 @@ description: Talos gRPC API reference. - [MachineService](#machine.MachineService) -- [resource/resource.proto](#resource/resource.proto) - - [Get](#resource.Get) - - [GetRequest](#resource.GetRequest) - - [GetResponse](#resource.GetResponse) - - [ListRequest](#resource.ListRequest) - - [ListResponse](#resource.ListResponse) - - [Metadata](#resource.Metadata) - - [Metadata.AnnotationsEntry](#resource.Metadata.AnnotationsEntry) - - [Metadata.LabelsEntry](#resource.Metadata.LabelsEntry) - - [Resource](#resource.Resource) - - [Spec](#resource.Spec) - - [WatchRequest](#resource.WatchRequest) - - [WatchResponse](#resource.WatchResponse) - - - [EventType](#resource.EventType) - - - [ResourceService](#resource.ResourceService) - - [security/security.proto](#security/security.proto) - [CertificateRequest](#securityapi.CertificateRequest) - [CertificateResponse](#securityapi.CertificateResponse) @@ -6821,257 +6803,6 @@ This method is available only on control plane nodes (which run etcd). | - -

Top

- -## resource/resource.proto - - - - - -### Get -The GetResponse message contains the Resource returned. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| metadata | [common.Metadata](#common.Metadata) | | | -| definition | [Resource](#resource.Resource) | | | -| resource | [Resource](#resource.Resource) | | | - - - - - - - - -### GetRequest -rpc Get - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| namespace | [string](#string) | | | -| type | [string](#string) | | | -| id | [string](#string) | | | - - - - - - - - -### GetResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| messages | [Get](#resource.Get) | repeated | | - - - - - - - - -### ListRequest -rpc List -The ListResponse message contains the Resource returned. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| namespace | [string](#string) | | | -| type | [string](#string) | | | - - - - - - - - -### ListResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| metadata | [common.Metadata](#common.Metadata) | | | -| definition | [Resource](#resource.Resource) | | | -| resource | [Resource](#resource.Resource) | | | - - - - - - - - -### Metadata - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| namespace | [string](#string) | | | -| type | [string](#string) | | | -| id | [string](#string) | | | -| version | [string](#string) | | | -| owner | [string](#string) | | | -| phase | [string](#string) | | | -| created | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| updated | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| finalizers | [string](#string) | repeated | | -| labels | [Metadata.LabelsEntry](#resource.Metadata.LabelsEntry) | repeated | | -| annotations | [Metadata.AnnotationsEntry](#resource.Metadata.AnnotationsEntry) | repeated | | - - - - - - - - -### Metadata.AnnotationsEntry - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [string](#string) | | | -| value | [string](#string) | | | - - - - - - - - -### Metadata.LabelsEntry - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [string](#string) | | | -| value | [string](#string) | | | - - - - - - - - -### Resource - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| metadata | [Metadata](#resource.Metadata) | | | -| spec | [Spec](#resource.Spec) | | | - - - - - - - - -### Spec - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| yaml | [bytes](#bytes) | | | - - - - - - - - -### WatchRequest -rpc Watch -The WatchResponse message contains the Resource returned. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| namespace | [string](#string) | | | -| type | [string](#string) | | | -| id | [string](#string) | | | -| tail_events | [uint32](#uint32) | | | - - - - - - - - -### WatchResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| metadata | [common.Metadata](#common.Metadata) | | | -| event_type | [EventType](#resource.EventType) | | | -| definition | [Resource](#resource.Resource) | | | -| resource | [Resource](#resource.Resource) | | | - - - - - - - - - - -### EventType - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| CREATED | 0 | | -| UPDATED | 1 | | -| DESTROYED | 2 | | - - - - - - - - - -### ResourceService -The resource service definition. - -ResourceService provides user-facing API for the Talos resources. - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Get | [GetRequest](#resource.GetRequest) | [GetResponse](#resource.GetResponse) | | -| List | [ListRequest](#resource.ListRequest) | [ListResponse](#resource.ListResponse) stream | | -| Watch | [WatchRequest](#resource.WatchRequest) | [WatchResponse](#resource.WatchResponse) stream | | - - - - -

Top