diff --git a/pkg/storage/unified/resource/resource_grpc.pb.go b/pkg/storage/unified/resource/resource_grpc.pb.go index 950788f001e..4186147ef7c 100644 --- a/pkg/storage/unified/resource/resource_grpc.pb.go +++ b/pkg/storage/unified/resource/resource_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.4.0 // - protoc (unknown) // source: resource.proto @@ -15,8 +15,8 @@ import ( // 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.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( ResourceStore_Read_FullMethodName = "/resource.ResourceStore/Read" @@ -47,7 +47,7 @@ type ResourceStoreClient interface { // The results *may* include values that should not be returned to the user // This will perform best-effort filtering to increase performace. // NOTE: storage.Interface is ultimatly responsible for the final filtering - Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[WatchEvent], error) + Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (ResourceStore_WatchClient, error) } type resourceStoreClient struct { @@ -108,13 +108,13 @@ func (c *resourceStoreClient) List(ctx context.Context, in *ListRequest, opts .. return out, nil } -func (c *resourceStoreClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[WatchEvent], error) { +func (c *resourceStoreClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (ResourceStore_WatchClient, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &ResourceStore_ServiceDesc.Streams[0], ResourceStore_Watch_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[WatchRequest, WatchEvent]{ClientStream: stream} + x := &resourceStoreWatchClient{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -124,12 +124,26 @@ func (c *resourceStoreClient) Watch(ctx context.Context, in *WatchRequest, opts return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type ResourceStore_WatchClient = grpc.ServerStreamingClient[WatchEvent] +type ResourceStore_WatchClient interface { + Recv() (*WatchEvent, error) + grpc.ClientStream +} + +type resourceStoreWatchClient struct { + grpc.ClientStream +} + +func (x *resourceStoreWatchClient) Recv() (*WatchEvent, error) { + m := new(WatchEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // ResourceStoreServer is the server API for ResourceStore service. // All implementations should embed UnimplementedResourceStoreServer -// for forward compatibility. +// for forward compatibility // // This provides the CRUD+List+Watch support needed for a k8s apiserver // The semantics and behaviors of this service are constrained by kubernetes @@ -147,15 +161,12 @@ type ResourceStoreServer interface { // The results *may* include values that should not be returned to the user // This will perform best-effort filtering to increase performace. // NOTE: storage.Interface is ultimatly responsible for the final filtering - Watch(*WatchRequest, grpc.ServerStreamingServer[WatchEvent]) error + Watch(*WatchRequest, ResourceStore_WatchServer) error } -// UnimplementedResourceStoreServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedResourceStoreServer struct{} +// UnimplementedResourceStoreServer should be embedded to have forward compatible implementations. +type UnimplementedResourceStoreServer struct { +} func (UnimplementedResourceStoreServer) Read(context.Context, *ReadRequest) (*ReadResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") @@ -172,10 +183,9 @@ func (UnimplementedResourceStoreServer) Delete(context.Context, *DeleteRequest) func (UnimplementedResourceStoreServer) List(context.Context, *ListRequest) (*ListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } -func (UnimplementedResourceStoreServer) Watch(*WatchRequest, grpc.ServerStreamingServer[WatchEvent]) error { +func (UnimplementedResourceStoreServer) Watch(*WatchRequest, ResourceStore_WatchServer) error { return status.Errorf(codes.Unimplemented, "method Watch not implemented") } -func (UnimplementedResourceStoreServer) testEmbeddedByValue() {} // UnsafeResourceStoreServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ResourceStoreServer will @@ -185,13 +195,6 @@ type UnsafeResourceStoreServer interface { } func RegisterResourceStoreServer(s grpc.ServiceRegistrar, srv ResourceStoreServer) { - // If the following call pancis, it indicates UnimplementedResourceStoreServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&ResourceStore_ServiceDesc, srv) } @@ -290,11 +293,21 @@ func _ResourceStore_Watch_Handler(srv interface{}, stream grpc.ServerStream) err if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ResourceStoreServer).Watch(m, &grpc.GenericServerStream[WatchRequest, WatchEvent]{ServerStream: stream}) + return srv.(ResourceStoreServer).Watch(m, &resourceStoreWatchServer{ServerStream: stream}) } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type ResourceStore_WatchServer = grpc.ServerStreamingServer[WatchEvent] +type ResourceStore_WatchServer interface { + Send(*WatchEvent) error + grpc.ServerStream +} + +type resourceStoreWatchServer struct { + grpc.ServerStream +} + +func (x *resourceStoreWatchServer) Send(m *WatchEvent) error { + return x.ServerStream.SendMsg(m) +} // ResourceStore_ServiceDesc is the grpc.ServiceDesc for ResourceStore service. // It's only intended for direct use with grpc.RegisterService, @@ -345,7 +358,7 @@ type BulkStoreClient interface { // Write multiple resources to the same Namespace/Group/Resource // Events will not be sent until the stream is complete // Only the *create* permissions is checked - BulkProcess(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[BulkRequest, BulkResponse], error) + BulkProcess(ctx context.Context, opts ...grpc.CallOption) (BulkStore_BulkProcessClient, error) } type bulkStoreClient struct { @@ -356,40 +369,58 @@ func NewBulkStoreClient(cc grpc.ClientConnInterface) BulkStoreClient { return &bulkStoreClient{cc} } -func (c *bulkStoreClient) BulkProcess(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[BulkRequest, BulkResponse], error) { +func (c *bulkStoreClient) BulkProcess(ctx context.Context, opts ...grpc.CallOption) (BulkStore_BulkProcessClient, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &BulkStore_ServiceDesc.Streams[0], BulkStore_BulkProcess_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[BulkRequest, BulkResponse]{ClientStream: stream} + x := &bulkStoreBulkProcessClient{ClientStream: stream} return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BulkStore_BulkProcessClient = grpc.ClientStreamingClient[BulkRequest, BulkResponse] +type BulkStore_BulkProcessClient interface { + Send(*BulkRequest) error + CloseAndRecv() (*BulkResponse, error) + grpc.ClientStream +} + +type bulkStoreBulkProcessClient struct { + grpc.ClientStream +} + +func (x *bulkStoreBulkProcessClient) Send(m *BulkRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *bulkStoreBulkProcessClient) CloseAndRecv() (*BulkResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(BulkResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // BulkStoreServer is the server API for BulkStore service. // All implementations should embed UnimplementedBulkStoreServer -// for forward compatibility. +// for forward compatibility type BulkStoreServer interface { // Write multiple resources to the same Namespace/Group/Resource // Events will not be sent until the stream is complete // Only the *create* permissions is checked - BulkProcess(grpc.ClientStreamingServer[BulkRequest, BulkResponse]) error + BulkProcess(BulkStore_BulkProcessServer) error } -// UnimplementedBulkStoreServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBulkStoreServer struct{} +// UnimplementedBulkStoreServer should be embedded to have forward compatible implementations. +type UnimplementedBulkStoreServer struct { +} -func (UnimplementedBulkStoreServer) BulkProcess(grpc.ClientStreamingServer[BulkRequest, BulkResponse]) error { +func (UnimplementedBulkStoreServer) BulkProcess(BulkStore_BulkProcessServer) error { return status.Errorf(codes.Unimplemented, "method BulkProcess not implemented") } -func (UnimplementedBulkStoreServer) testEmbeddedByValue() {} // UnsafeBulkStoreServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BulkStoreServer will @@ -399,22 +430,34 @@ type UnsafeBulkStoreServer interface { } func RegisterBulkStoreServer(s grpc.ServiceRegistrar, srv BulkStoreServer) { - // If the following call pancis, it indicates UnimplementedBulkStoreServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&BulkStore_ServiceDesc, srv) } func _BulkStore_BulkProcess_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(BulkStoreServer).BulkProcess(&grpc.GenericServerStream[BulkRequest, BulkResponse]{ServerStream: stream}) + return srv.(BulkStoreServer).BulkProcess(&bulkStoreBulkProcessServer{ServerStream: stream}) } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BulkStore_BulkProcessServer = grpc.ClientStreamingServer[BulkRequest, BulkResponse] +type BulkStore_BulkProcessServer interface { + SendAndClose(*BulkResponse) error + Recv() (*BulkRequest, error) + grpc.ServerStream +} + +type bulkStoreBulkProcessServer struct { + grpc.ServerStream +} + +func (x *bulkStoreBulkProcessServer) SendAndClose(m *BulkResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *bulkStoreBulkProcessServer) Recv() (*BulkRequest, error) { + m := new(BulkRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // BulkStore_ServiceDesc is the grpc.ServiceDesc for BulkStore service. // It's only intended for direct use with grpc.RegisterService, @@ -480,7 +523,7 @@ func (c *resourceIndexClient) GetStats(ctx context.Context, in *ResourceStatsReq // ResourceIndexServer is the server API for ResourceIndex service. // All implementations should embed UnimplementedResourceIndexServer -// for forward compatibility. +// for forward compatibility // // Unlike the ResourceStore, this service can be exposed to clients directly // It should be implemented with efficient indexes and does not need read-after-write semantics @@ -490,12 +533,9 @@ type ResourceIndexServer interface { GetStats(context.Context, *ResourceStatsRequest) (*ResourceStatsResponse, error) } -// UnimplementedResourceIndexServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedResourceIndexServer struct{} +// UnimplementedResourceIndexServer should be embedded to have forward compatible implementations. +type UnimplementedResourceIndexServer struct { +} func (UnimplementedResourceIndexServer) Search(context.Context, *ResourceSearchRequest) (*ResourceSearchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") @@ -503,7 +543,6 @@ func (UnimplementedResourceIndexServer) Search(context.Context, *ResourceSearchR func (UnimplementedResourceIndexServer) GetStats(context.Context, *ResourceStatsRequest) (*ResourceStatsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented") } -func (UnimplementedResourceIndexServer) testEmbeddedByValue() {} // UnsafeResourceIndexServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ResourceIndexServer will @@ -513,13 +552,6 @@ type UnsafeResourceIndexServer interface { } func RegisterResourceIndexServer(s grpc.ServiceRegistrar, srv ResourceIndexServer) { - // If the following call pancis, it indicates UnimplementedResourceIndexServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&ResourceIndex_ServiceDesc, srv) } @@ -627,7 +659,7 @@ func (c *managedObjectIndexClient) ListManagedObjects(ctx context.Context, in *L // ManagedObjectIndexServer is the server API for ManagedObjectIndex service. // All implementations should embed UnimplementedManagedObjectIndexServer -// for forward compatibility. +// for forward compatibility // // Query managed objects // Results access control is based on access to the repository *not* the items @@ -638,12 +670,9 @@ type ManagedObjectIndexServer interface { ListManagedObjects(context.Context, *ListManagedObjectsRequest) (*ListManagedObjectsResponse, error) } -// UnimplementedManagedObjectIndexServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedManagedObjectIndexServer struct{} +// UnimplementedManagedObjectIndexServer should be embedded to have forward compatible implementations. +type UnimplementedManagedObjectIndexServer struct { +} func (UnimplementedManagedObjectIndexServer) CountManagedObjects(context.Context, *CountManagedObjectsRequest) (*CountManagedObjectsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CountManagedObjects not implemented") @@ -651,7 +680,6 @@ func (UnimplementedManagedObjectIndexServer) CountManagedObjects(context.Context func (UnimplementedManagedObjectIndexServer) ListManagedObjects(context.Context, *ListManagedObjectsRequest) (*ListManagedObjectsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListManagedObjects not implemented") } -func (UnimplementedManagedObjectIndexServer) testEmbeddedByValue() {} // UnsafeManagedObjectIndexServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ManagedObjectIndexServer will @@ -661,13 +689,6 @@ type UnsafeManagedObjectIndexServer interface { } func RegisterManagedObjectIndexServer(s grpc.ServiceRegistrar, srv ManagedObjectIndexServer) { - // If the following call pancis, it indicates UnimplementedManagedObjectIndexServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&ManagedObjectIndex_ServiceDesc, srv) } @@ -773,7 +794,7 @@ func (c *blobStoreClient) GetBlob(ctx context.Context, in *GetBlobRequest, opts // BlobStoreServer is the server API for BlobStore service. // All implementations should embed UnimplementedBlobStoreServer -// for forward compatibility. +// for forward compatibility type BlobStoreServer interface { // Upload a blob that will be saved in a resource PutBlob(context.Context, *PutBlobRequest) (*PutBlobResponse, error) @@ -782,12 +803,9 @@ type BlobStoreServer interface { GetBlob(context.Context, *GetBlobRequest) (*GetBlobResponse, error) } -// UnimplementedBlobStoreServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBlobStoreServer struct{} +// UnimplementedBlobStoreServer should be embedded to have forward compatible implementations. +type UnimplementedBlobStoreServer struct { +} func (UnimplementedBlobStoreServer) PutBlob(context.Context, *PutBlobRequest) (*PutBlobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PutBlob not implemented") @@ -795,7 +813,6 @@ func (UnimplementedBlobStoreServer) PutBlob(context.Context, *PutBlobRequest) (* func (UnimplementedBlobStoreServer) GetBlob(context.Context, *GetBlobRequest) (*GetBlobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBlob not implemented") } -func (UnimplementedBlobStoreServer) testEmbeddedByValue() {} // UnsafeBlobStoreServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BlobStoreServer will @@ -805,13 +822,6 @@ type UnsafeBlobStoreServer interface { } func RegisterBlobStoreServer(s grpc.ServiceRegistrar, srv BlobStoreServer) { - // If the following call pancis, it indicates UnimplementedBlobStoreServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&BlobStore_ServiceDesc, srv) } @@ -906,7 +916,7 @@ func (c *diagnosticsClient) IsHealthy(ctx context.Context, in *HealthCheckReques // DiagnosticsServer is the server API for Diagnostics service. // All implementations should embed UnimplementedDiagnosticsServer -// for forward compatibility. +// for forward compatibility // // Clients can use this service directly // NOTE: This is read only, and no read afer write guarantees @@ -915,17 +925,13 @@ type DiagnosticsServer interface { IsHealthy(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) } -// UnimplementedDiagnosticsServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedDiagnosticsServer struct{} +// UnimplementedDiagnosticsServer should be embedded to have forward compatible implementations. +type UnimplementedDiagnosticsServer struct { +} func (UnimplementedDiagnosticsServer) IsHealthy(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method IsHealthy not implemented") } -func (UnimplementedDiagnosticsServer) testEmbeddedByValue() {} // UnsafeDiagnosticsServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to DiagnosticsServer will @@ -935,13 +941,6 @@ type UnsafeDiagnosticsServer interface { } func RegisterDiagnosticsServer(s grpc.ServiceRegistrar, srv DiagnosticsServer) { - // If the following call pancis, it indicates UnimplementedDiagnosticsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&Diagnostics_ServiceDesc, srv) }