From 25f71f8c1acd892172b0eff2b2b93d12efc83b23 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 4 Nov 2024 13:45:23 +0100 Subject: [PATCH 1/6] rebase: update csi-addons spec updating csi-addons spec to the latest main which GetFenceClients API. Signed-off-by: Madhu Rajanna --- go.mod | 2 +- go.sum | 4 +- .../csi-addons/spec/lib/go/fence/fence.pb.go | 345 +++++++++++++++--- .../spec/lib/go/fence/fence_grpc.pb.go | 41 +++ .../spec/lib/go/identity/identity.pb.go | 142 +++---- .../lib/go/volumegroup/volumegroup_grpc.pb.go | 4 +- vendor/modules.txt | 2 +- 7 files changed, 420 insertions(+), 120 deletions(-) diff --git a/go.mod b/go.mod index 84daf9a1c68..16bd76384b7 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000 github.com/ceph/go-ceph v0.30.0 github.com/container-storage-interface/spec v1.10.0 - github.com/csi-addons/spec v0.2.1-0.20240730084235-3958a5b17d24 + github.com/csi-addons/spec v0.2.1-0.20241104111131-27825f744db5 github.com/gemalto/kmip-go v0.0.10 github.com/golang/protobuf v1.5.4 github.com/google/fscrypt v0.3.6-0.20240502174735-068b9f8f5dec diff --git a/go.sum b/go.sum index 7854169a56a..474e77dedbd 100644 --- a/go.sum +++ b/go.sum @@ -1504,8 +1504,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/csi-addons/spec v0.2.1-0.20240730084235-3958a5b17d24 h1:tJETaYbnnzlCSaqDXQzbszYyuAtG/sFzm6DargeVzJA= -github.com/csi-addons/spec v0.2.1-0.20240730084235-3958a5b17d24/go.mod h1:Mwq4iLiUV4s+K1bszcWU6aMsR5KPsbIYzzszJ6+56vI= +github.com/csi-addons/spec v0.2.1-0.20241104111131-27825f744db5 h1:j9NaWj5KmzEVarmsjxS/NDAhes6Uzq1qhkUGHvDlVBk= +github.com/csi-addons/spec v0.2.1-0.20241104111131-27825f744db5/go.mod h1:Mwq4iLiUV4s+K1bszcWU6aMsR5KPsbIYzzszJ6+56vI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= diff --git a/vendor/github.com/csi-addons/spec/lib/go/fence/fence.pb.go b/vendor/github.com/csi-addons/spec/lib/go/fence/fence.pb.go index a1cf68475d1..54915db24c7 100644 --- a/vendor/github.com/csi-addons/spec/lib/go/fence/fence.pb.go +++ b/vendor/github.com/csi-addons/spec/lib/go/fence/fence.pb.go @@ -402,6 +402,175 @@ func (x *CIDR) GetCidr() string { return "" } +// GetFenceClientsRequest contains the necessary information to identify +// the clients that need fencing. +type GetFenceClientsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Plugin-specific parameters passed in as opaque key-value pairs. + Parameters map[string]string `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Secrets required by the plugin to complete the request. + Secrets map[string]string `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GetFenceClientsRequest) Reset() { + *x = GetFenceClientsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fence_fence_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFenceClientsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFenceClientsRequest) ProtoMessage() {} + +func (x *GetFenceClientsRequest) ProtoReflect() protoreflect.Message { + mi := &file_fence_fence_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 GetFenceClientsRequest.ProtoReflect.Descriptor instead. +func (*GetFenceClientsRequest) Descriptor() ([]byte, []int) { + return file_fence_fence_proto_rawDescGZIP(), []int{7} +} + +func (x *GetFenceClientsRequest) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *GetFenceClientsRequest) GetSecrets() map[string]string { + if x != nil { + return x.Secrets + } + return nil +} + +// GetFenceClientsResponse holds the information about clients that require +// fencing. +type GetFenceClientsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of clients that need to be fenced. + Clients []*ClientDetails `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` +} + +func (x *GetFenceClientsResponse) Reset() { + *x = GetFenceClientsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fence_fence_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFenceClientsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFenceClientsResponse) ProtoMessage() {} + +func (x *GetFenceClientsResponse) ProtoReflect() protoreflect.Message { + mi := &file_fence_fence_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 GetFenceClientsResponse.ProtoReflect.Descriptor instead. +func (*GetFenceClientsResponse) Descriptor() ([]byte, []int) { + return file_fence_fence_proto_rawDescGZIP(), []int{8} +} + +func (x *GetFenceClientsResponse) GetClients() []*ClientDetails { + if x != nil { + return x.Clients + } + return nil +} + +// ClientDetails holds the information about the client that requires fencing. +type ClientDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id represents the unique identifier of the client. + // Required field. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // list of IP addresses that represent the client's local addresses. + // Required field. + Addresses []*CIDR `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *ClientDetails) Reset() { + *x = ClientDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_fence_fence_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientDetails) ProtoMessage() {} + +func (x *ClientDetails) ProtoReflect() protoreflect.Message { + mi := &file_fence_fence_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 ClientDetails.ProtoReflect.Descriptor instead. +func (*ClientDetails) Descriptor() ([]byte, []int) { + return file_fence_fence_proto_rawDescGZIP(), []int{9} +} + +func (x *ClientDetails) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ClientDetails) GetAddresses() []*CIDR { + if x != nil { + return x.Addresses + } + return nil +} + var File_fence_fence_proto protoreflect.FileDescriptor var file_fence_fence_proto_rawDesc = []byte{ @@ -486,29 +655,62 @@ var file_fence_fence_proto_rawDesc = []byte{ 0x32, 0x0b, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x05, 0x63, 0x69, 0x64, 0x72, 0x73, 0x22, 0x1a, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, - 0x32, 0xae, 0x02, 0x0a, 0x0f, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x13, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x21, 0x2e, 0x66, 0x65, - 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, - 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x15, 0x55, 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x23, 0x2e, - 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x66, 0x65, 0x6e, - 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1e, - 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x73, 0x69, 0x2d, 0x61, 0x64, 0x64, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2f, - 0x6c, 0x69, 0x62, 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0xad, 0x02, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0a, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x49, 0x0a, 0x07, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x66, 0x65, + 0x6e, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0x98, 0x42, 0x01, 0x52, 0x07, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 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, 0x3a, 0x0a, 0x0c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 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, 0x49, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x66, + 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x0d, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x09, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x09, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x32, 0x82, 0x03, 0x0a, 0x0f, 0x46, 0x65, 0x6e, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x13, 0x46, + 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x12, 0x21, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, 0x6e, 0x63, 0x65, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, + 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x15, 0x55, + 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x23, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x66, + 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x65, 0x6e, 0x63, + 0x65, 0x2e, 0x55, 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x46, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x46, + 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x66, 0x65, + 0x6e, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x66, 0x65, 0x6e, + 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x29, 0x5a, 0x27, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x73, 0x69, 0x2d, 0x61, + 0x64, 0x64, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x6c, 0x69, 0x62, 0x2f, 0x67, + 0x6f, 0x2f, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -523,7 +725,7 @@ func file_fence_fence_proto_rawDescGZIP() []byte { return file_fence_fence_proto_rawDescData } -var file_fence_fence_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_fence_fence_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_fence_fence_proto_goTypes = []interface{}{ (*FenceClusterNetworkRequest)(nil), // 0: fence.FenceClusterNetworkRequest (*FenceClusterNetworkResponse)(nil), // 1: fence.FenceClusterNetworkResponse @@ -532,34 +734,45 @@ var file_fence_fence_proto_goTypes = []interface{}{ (*ListClusterFenceRequest)(nil), // 4: fence.ListClusterFenceRequest (*ListClusterFenceResponse)(nil), // 5: fence.ListClusterFenceResponse (*CIDR)(nil), // 6: fence.CIDR - nil, // 7: fence.FenceClusterNetworkRequest.ParametersEntry - nil, // 8: fence.FenceClusterNetworkRequest.SecretsEntry - nil, // 9: fence.UnfenceClusterNetworkRequest.ParametersEntry - nil, // 10: fence.UnfenceClusterNetworkRequest.SecretsEntry - nil, // 11: fence.ListClusterFenceRequest.ParametersEntry - nil, // 12: fence.ListClusterFenceRequest.SecretsEntry + (*GetFenceClientsRequest)(nil), // 7: fence.GetFenceClientsRequest + (*GetFenceClientsResponse)(nil), // 8: fence.GetFenceClientsResponse + (*ClientDetails)(nil), // 9: fence.ClientDetails + nil, // 10: fence.FenceClusterNetworkRequest.ParametersEntry + nil, // 11: fence.FenceClusterNetworkRequest.SecretsEntry + nil, // 12: fence.UnfenceClusterNetworkRequest.ParametersEntry + nil, // 13: fence.UnfenceClusterNetworkRequest.SecretsEntry + nil, // 14: fence.ListClusterFenceRequest.ParametersEntry + nil, // 15: fence.ListClusterFenceRequest.SecretsEntry + nil, // 16: fence.GetFenceClientsRequest.ParametersEntry + nil, // 17: fence.GetFenceClientsRequest.SecretsEntry } var file_fence_fence_proto_depIdxs = []int32{ - 7, // 0: fence.FenceClusterNetworkRequest.parameters:type_name -> fence.FenceClusterNetworkRequest.ParametersEntry - 8, // 1: fence.FenceClusterNetworkRequest.secrets:type_name -> fence.FenceClusterNetworkRequest.SecretsEntry + 10, // 0: fence.FenceClusterNetworkRequest.parameters:type_name -> fence.FenceClusterNetworkRequest.ParametersEntry + 11, // 1: fence.FenceClusterNetworkRequest.secrets:type_name -> fence.FenceClusterNetworkRequest.SecretsEntry 6, // 2: fence.FenceClusterNetworkRequest.cidrs:type_name -> fence.CIDR - 9, // 3: fence.UnfenceClusterNetworkRequest.parameters:type_name -> fence.UnfenceClusterNetworkRequest.ParametersEntry - 10, // 4: fence.UnfenceClusterNetworkRequest.secrets:type_name -> fence.UnfenceClusterNetworkRequest.SecretsEntry + 12, // 3: fence.UnfenceClusterNetworkRequest.parameters:type_name -> fence.UnfenceClusterNetworkRequest.ParametersEntry + 13, // 4: fence.UnfenceClusterNetworkRequest.secrets:type_name -> fence.UnfenceClusterNetworkRequest.SecretsEntry 6, // 5: fence.UnfenceClusterNetworkRequest.cidrs:type_name -> fence.CIDR - 11, // 6: fence.ListClusterFenceRequest.parameters:type_name -> fence.ListClusterFenceRequest.ParametersEntry - 12, // 7: fence.ListClusterFenceRequest.secrets:type_name -> fence.ListClusterFenceRequest.SecretsEntry + 14, // 6: fence.ListClusterFenceRequest.parameters:type_name -> fence.ListClusterFenceRequest.ParametersEntry + 15, // 7: fence.ListClusterFenceRequest.secrets:type_name -> fence.ListClusterFenceRequest.SecretsEntry 6, // 8: fence.ListClusterFenceResponse.cidrs:type_name -> fence.CIDR - 0, // 9: fence.FenceController.FenceClusterNetwork:input_type -> fence.FenceClusterNetworkRequest - 2, // 10: fence.FenceController.UnfenceClusterNetwork:input_type -> fence.UnfenceClusterNetworkRequest - 4, // 11: fence.FenceController.ListClusterFence:input_type -> fence.ListClusterFenceRequest - 1, // 12: fence.FenceController.FenceClusterNetwork:output_type -> fence.FenceClusterNetworkResponse - 3, // 13: fence.FenceController.UnfenceClusterNetwork:output_type -> fence.UnfenceClusterNetworkResponse - 5, // 14: fence.FenceController.ListClusterFence:output_type -> fence.ListClusterFenceResponse - 12, // [12:15] is the sub-list for method output_type - 9, // [9:12] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 16, // 9: fence.GetFenceClientsRequest.parameters:type_name -> fence.GetFenceClientsRequest.ParametersEntry + 17, // 10: fence.GetFenceClientsRequest.secrets:type_name -> fence.GetFenceClientsRequest.SecretsEntry + 9, // 11: fence.GetFenceClientsResponse.clients:type_name -> fence.ClientDetails + 6, // 12: fence.ClientDetails.addresses:type_name -> fence.CIDR + 0, // 13: fence.FenceController.FenceClusterNetwork:input_type -> fence.FenceClusterNetworkRequest + 2, // 14: fence.FenceController.UnfenceClusterNetwork:input_type -> fence.UnfenceClusterNetworkRequest + 4, // 15: fence.FenceController.ListClusterFence:input_type -> fence.ListClusterFenceRequest + 7, // 16: fence.FenceController.GetFenceClients:input_type -> fence.GetFenceClientsRequest + 1, // 17: fence.FenceController.FenceClusterNetwork:output_type -> fence.FenceClusterNetworkResponse + 3, // 18: fence.FenceController.UnfenceClusterNetwork:output_type -> fence.UnfenceClusterNetworkResponse + 5, // 19: fence.FenceController.ListClusterFence:output_type -> fence.ListClusterFenceResponse + 8, // 20: fence.FenceController.GetFenceClients:output_type -> fence.GetFenceClientsResponse + 17, // [17:21] is the sub-list for method output_type + 13, // [13:17] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_fence_fence_proto_init() } @@ -652,6 +865,42 @@ func file_fence_fence_proto_init() { return nil } } + file_fence_fence_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFenceClientsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fence_fence_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFenceClientsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fence_fence_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientDetails); 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{ @@ -659,7 +908,7 @@ func file_fence_fence_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_fence_fence_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/csi-addons/spec/lib/go/fence/fence_grpc.pb.go b/vendor/github.com/csi-addons/spec/lib/go/fence/fence_grpc.pb.go index 87043d2ed17..1652e235fe2 100644 --- a/vendor/github.com/csi-addons/spec/lib/go/fence/fence_grpc.pb.go +++ b/vendor/github.com/csi-addons/spec/lib/go/fence/fence_grpc.pb.go @@ -24,6 +24,7 @@ const ( FenceController_FenceClusterNetwork_FullMethodName = "/fence.FenceController/FenceClusterNetwork" FenceController_UnfenceClusterNetwork_FullMethodName = "/fence.FenceController/UnfenceClusterNetwork" FenceController_ListClusterFence_FullMethodName = "/fence.FenceController/ListClusterFence" + FenceController_GetFenceClients_FullMethodName = "/fence.FenceController/GetFenceClients" ) // FenceControllerClient is the client API for FenceController service. @@ -37,6 +38,9 @@ type FenceControllerClient interface { UnfenceClusterNetwork(ctx context.Context, in *UnfenceClusterNetworkRequest, opts ...grpc.CallOption) (*UnfenceClusterNetworkResponse, error) // ListClusterFence RPC call to provide a list of blocklisted/fenced clients. ListClusterFence(ctx context.Context, in *ListClusterFenceRequest, opts ...grpc.CallOption) (*ListClusterFenceResponse, error) + // GetFenceClients RPC calls to get the client information to use in a + // FenceClusterNetwork or UnfenceClusterNetwork RPC. + GetFenceClients(ctx context.Context, in *GetFenceClientsRequest, opts ...grpc.CallOption) (*GetFenceClientsResponse, error) } type fenceControllerClient struct { @@ -74,6 +78,15 @@ func (c *fenceControllerClient) ListClusterFence(ctx context.Context, in *ListCl return out, nil } +func (c *fenceControllerClient) GetFenceClients(ctx context.Context, in *GetFenceClientsRequest, opts ...grpc.CallOption) (*GetFenceClientsResponse, error) { + out := new(GetFenceClientsResponse) + err := c.cc.Invoke(ctx, FenceController_GetFenceClients_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // FenceControllerServer is the server API for FenceController service. // All implementations must embed UnimplementedFenceControllerServer // for forward compatibility @@ -85,6 +98,9 @@ type FenceControllerServer interface { UnfenceClusterNetwork(context.Context, *UnfenceClusterNetworkRequest) (*UnfenceClusterNetworkResponse, error) // ListClusterFence RPC call to provide a list of blocklisted/fenced clients. ListClusterFence(context.Context, *ListClusterFenceRequest) (*ListClusterFenceResponse, error) + // GetFenceClients RPC calls to get the client information to use in a + // FenceClusterNetwork or UnfenceClusterNetwork RPC. + GetFenceClients(context.Context, *GetFenceClientsRequest) (*GetFenceClientsResponse, error) mustEmbedUnimplementedFenceControllerServer() } @@ -101,6 +117,9 @@ func (UnimplementedFenceControllerServer) UnfenceClusterNetwork(context.Context, func (UnimplementedFenceControllerServer) ListClusterFence(context.Context, *ListClusterFenceRequest) (*ListClusterFenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListClusterFence not implemented") } +func (UnimplementedFenceControllerServer) GetFenceClients(context.Context, *GetFenceClientsRequest) (*GetFenceClientsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFenceClients not implemented") +} func (UnimplementedFenceControllerServer) mustEmbedUnimplementedFenceControllerServer() {} // UnsafeFenceControllerServer may be embedded to opt out of forward compatibility for this service. @@ -168,6 +187,24 @@ func _FenceController_ListClusterFence_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _FenceController_GetFenceClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFenceClientsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FenceControllerServer).GetFenceClients(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: FenceController_GetFenceClients_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FenceControllerServer).GetFenceClients(ctx, req.(*GetFenceClientsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // FenceController_ServiceDesc is the grpc.ServiceDesc for FenceController service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -187,6 +224,10 @@ var FenceController_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListClusterFence", Handler: _FenceController_ListClusterFence_Handler, }, + { + MethodName: "GetFenceClients", + Handler: _FenceController_GetFenceClients_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "fence/fence.proto", diff --git a/vendor/github.com/csi-addons/spec/lib/go/identity/identity.pb.go b/vendor/github.com/csi-addons/spec/lib/go/identity/identity.pb.go index bc102c7c23e..fac79ee5dcd 100644 --- a/vendor/github.com/csi-addons/spec/lib/go/identity/identity.pb.go +++ b/vendor/github.com/csi-addons/spec/lib/go/identity/identity.pb.go @@ -165,6 +165,12 @@ const ( // plugin can invoke RPCs that require access to the storage system, // similar to the CSI Controller (provisioner). Capability_NetworkFence_NETWORK_FENCE Capability_NetworkFence_Type = 1 + // GET_CLIENTS_TO_FENCE indicates that the CSI-driver provides RPCs for a + // GET_CLIENTS_TO_FENCE operation to get the clients to fence. + // The presence of this capability determines whether the CSI-Addons CO + // plugin can invoke RPCs that require access to the storage system, + // similar to the CSI Controller (provisioner). + Capability_NetworkFence_GET_CLIENTS_TO_FENCE Capability_NetworkFence_Type = 2 ) // Enum value maps for Capability_NetworkFence_Type. @@ -172,10 +178,12 @@ var ( Capability_NetworkFence_Type_name = map[int32]string{ 0: "UNKNOWN", 1: "NETWORK_FENCE", + 2: "GET_CLIENTS_TO_FENCE", } Capability_NetworkFence_Type_value = map[string]int32{ - "UNKNOWN": 0, - "NETWORK_FENCE": 1, + "UNKNOWN": 0, + "NETWORK_FENCE": 1, + "GET_CLIENTS_TO_FENCE": 2, } ) @@ -1183,7 +1191,7 @@ var file_identity_identity_proto_rawDesc = []byte{ 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, - 0x73, 0x22, 0xf1, 0x0a, 0x0a, 0x0a, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x73, 0x22, 0x8c, 0x0b, 0x0a, 0x0a, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x48, @@ -1229,69 +1237,71 @@ var file_identity_identity_proto_rawDesc = []byte{ 0x65, 0x22, 0x2c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x1a, - 0x72, 0x0a, 0x0c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x3a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x46, 0x65, 0x6e, 0x63, 0x65, - 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x26, 0x0a, 0x04, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x46, 0x45, 0x4e, 0x43, - 0x45, 0x10, 0x01, 0x1a, 0x81, 0x01, 0x0a, 0x11, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2b, 0x0a, 0x04, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x16, 0x0a, 0x12, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x49, 0x43, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x1a, 0x84, 0x02, 0x0a, 0x0b, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x39, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x4c, 0x55, - 0x4d, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x01, 0x12, 0x24, 0x0a, 0x20, 0x4c, 0x49, - 0x4d, 0x49, 0x54, 0x5f, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x54, 0x4f, 0x5f, 0x4f, 0x4e, - 0x45, 0x5f, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, - 0x12, 0x25, 0x0a, 0x21, 0x44, 0x4f, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, - 0x5f, 0x56, 0x47, 0x5f, 0x54, 0x4f, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x56, 0x4f, - 0x4c, 0x55, 0x4d, 0x45, 0x53, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x4f, 0x44, 0x49, 0x46, - 0x59, 0x5f, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x04, - 0x12, 0x14, 0x0a, 0x10, 0x47, 0x45, 0x54, 0x5f, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x47, - 0x52, 0x4f, 0x55, 0x50, 0x10, 0x05, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x56, - 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x53, 0x10, 0x06, 0x1a, 0x8c, - 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, - 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2e, 0x0a, - 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, - 0x4b, 0x45, 0x59, 0x52, 0x4f, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x42, 0x06, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x41, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x32, 0xee, 0x01, 0x0a, 0x08, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x12, 0x1c, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, - 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x65, - 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, - 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, 0x16, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, - 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x69, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x8c, 0x01, 0x0a, 0x0c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x46, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x3a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, + 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x46, 0x65, 0x6e, 0x63, + 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x40, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x46, 0x45, 0x4e, + 0x43, 0x45, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x47, 0x45, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, + 0x4e, 0x54, 0x53, 0x5f, 0x54, 0x4f, 0x5f, 0x46, 0x45, 0x4e, 0x43, 0x45, 0x10, 0x02, 0x1a, 0x81, + 0x01, 0x0a, 0x11, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x61, + 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2b, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, + 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x4f, + 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x01, 0x1a, 0x84, 0x02, 0x0a, 0x0b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x12, 0x39, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x25, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xb9, 0x01, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x47, 0x52, + 0x4f, 0x55, 0x50, 0x10, 0x01, 0x12, 0x24, 0x0a, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x5f, 0x56, + 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x54, 0x4f, 0x5f, 0x4f, 0x4e, 0x45, 0x5f, 0x56, 0x4f, 0x4c, + 0x55, 0x4d, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x25, 0x0a, 0x21, 0x44, + 0x4f, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x56, 0x47, 0x5f, 0x54, + 0x4f, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x53, + 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, 0x5f, 0x56, 0x4f, 0x4c, + 0x55, 0x4d, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x47, + 0x45, 0x54, 0x5f, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, + 0x05, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x56, 0x4f, 0x4c, 0x55, 0x4d, 0x45, + 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x53, 0x10, 0x06, 0x1a, 0x8c, 0x01, 0x0a, 0x15, 0x45, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2f, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2e, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x19, 0x0a, + 0x15, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x4b, 0x45, 0x59, 0x52, 0x4f, + 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x41, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x72, 0x65, + 0x61, 0x64, 0x79, 0x32, 0xee, 0x01, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x12, 0x4c, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x1c, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x12, 0x20, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, + 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, + 0x65, 0x12, 0x16, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, + 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/vendor/github.com/csi-addons/spec/lib/go/volumegroup/volumegroup_grpc.pb.go b/vendor/github.com/csi-addons/spec/lib/go/volumegroup/volumegroup_grpc.pb.go index d41b597f938..d658ee6f1c2 100644 --- a/vendor/github.com/csi-addons/spec/lib/go/volumegroup/volumegroup_grpc.pb.go +++ b/vendor/github.com/csi-addons/spec/lib/go/volumegroup/volumegroup_grpc.pb.go @@ -40,7 +40,7 @@ type ControllerClient interface { DeleteVolumeGroup(ctx context.Context, in *DeleteVolumeGroupRequest, opts ...grpc.CallOption) (*DeleteVolumeGroupResponse, error) // ListVolumeGroups RPC call to list volume groups. ListVolumeGroups(ctx context.Context, in *ListVolumeGroupsRequest, opts ...grpc.CallOption) (*ListVolumeGroupsResponse, error) - // CreateVolumeGroup RPC call to get a volume group. + // ControllerGetVolumeGroup RPC call to get a volume group. ControllerGetVolumeGroup(ctx context.Context, in *ControllerGetVolumeGroupRequest, opts ...grpc.CallOption) (*ControllerGetVolumeGroupResponse, error) } @@ -109,7 +109,7 @@ type ControllerServer interface { DeleteVolumeGroup(context.Context, *DeleteVolumeGroupRequest) (*DeleteVolumeGroupResponse, error) // ListVolumeGroups RPC call to list volume groups. ListVolumeGroups(context.Context, *ListVolumeGroupsRequest) (*ListVolumeGroupsResponse, error) - // CreateVolumeGroup RPC call to get a volume group. + // ControllerGetVolumeGroup RPC call to get a volume group. ControllerGetVolumeGroup(context.Context, *ControllerGetVolumeGroupRequest) (*ControllerGetVolumeGroupResponse, error) mustEmbedUnimplementedControllerServer() } diff --git a/vendor/modules.txt b/vendor/modules.txt index 715eb146e62..0b21d18b9d9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -235,7 +235,7 @@ github.com/coreos/go-semver/semver ## explicit; go 1.12 github.com/coreos/go-systemd/v22/daemon github.com/coreos/go-systemd/v22/journal -# github.com/csi-addons/spec v0.2.1-0.20240730084235-3958a5b17d24 +# github.com/csi-addons/spec v0.2.1-0.20241104111131-27825f744db5 ## explicit github.com/csi-addons/spec/lib/go/encryptionkeyrotation github.com/csi-addons/spec/lib/go/fence From f19cd5bda9ccb52a56f70dcedcd0b4efe0e42f7d Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 4 Nov 2024 14:32:26 +0100 Subject: [PATCH 2/6] rbd: register GET_CLIENTS_TO_FENCE caps register Capability_NetworkFence_ GET_CLIENTS_TO_FENCE capability and start a NetworkFence controllers as part of rbd nodeplugin. Signed-off-by: Madhu Rajanna --- internal/csi-addons/rbd/identity.go | 7 +++++++ internal/rbd/driver/driver.go | 3 +++ 2 files changed, 10 insertions(+) diff --git a/internal/csi-addons/rbd/identity.go b/internal/csi-addons/rbd/identity.go index 68d7882e684..0e84e9ee0c5 100644 --- a/internal/csi-addons/rbd/identity.go +++ b/internal/csi-addons/rbd/identity.go @@ -152,6 +152,13 @@ func (is *IdentityServer) GetCapabilities( Type: identity.Capability_EncryptionKeyRotation_ENCRYPTIONKEYROTATION, }, }, + }, + &identity.Capability{ + Type: &identity.Capability_NetworkFence_{ + NetworkFence: &identity.Capability_NetworkFence{ + Type: identity.Capability_NetworkFence_GET_CLIENTS_TO_FENCE, + }, + }, }) } diff --git a/internal/rbd/driver/driver.go b/internal/rbd/driver/driver.go index 0ad8109f81a..0bf6cfe04b5 100644 --- a/internal/rbd/driver/driver.go +++ b/internal/rbd/driver/driver.go @@ -227,6 +227,9 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error { } if conf.IsNodeServer { + fcs := casrbd.NewFenceControllerServer() + r.cas.RegisterService(fcs) + rs := casrbd.NewReclaimSpaceNodeServer(r.ns.VolumeLocks) r.cas.RegisterService(rs) From 4b777e4da0b8e22f6f1f4a1bce8d367237de77b5 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 4 Nov 2024 14:59:26 +0100 Subject: [PATCH 3/6] rebase: update go-ceph to latest commit updating go-ceph to the latest commit to pull the new function to get client address Signed-off-by: Madhu Rajanna --- go.mod | 2 +- go.sum | 4 +-- .../ceph/go-ceph/cephfs/admin/clone.go | 12 ++++++-- .../ceph/go-ceph/rados/rados_getaddrs.go | 30 +++++++++++++++++++ vendor/modules.txt | 2 +- 5 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 vendor/github.com/ceph/go-ceph/rados/rados_getaddrs.go diff --git a/go.mod b/go.mod index 16bd76384b7..e0a4210ceff 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go v1.55.5 github.com/aws/aws-sdk-go-v2/service/sts v1.32.3 github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000 - github.com/ceph/go-ceph v0.30.0 + github.com/ceph/go-ceph v0.30.1-0.20241102143109-75d1af3ed638 github.com/container-storage-interface/spec v1.10.0 github.com/csi-addons/spec v0.2.1-0.20241104111131-27825f744db5 github.com/gemalto/kmip-go v0.0.10 diff --git a/go.sum b/go.sum index 474e77dedbd..bb20e50240d 100644 --- a/go.sum +++ b/go.sum @@ -1445,8 +1445,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/ceph/go-ceph v0.30.0 h1:p/+rNnn9dUByrDhXfBFilVriRZKJghMJcts8N2wQ+ws= -github.com/ceph/go-ceph v0.30.0/go.mod h1:OJFju/Xmtb7ihHo/aXOayw6RhVOUGNke5EwTipwaf6A= +github.com/ceph/go-ceph v0.30.1-0.20241102143109-75d1af3ed638 h1:J/IBLjrHABhgi8okkxodSxhOPPCXhdBSt/i5OjyA9Ug= +github.com/ceph/go-ceph v0.30.1-0.20241102143109-75d1af3ed638/go.mod h1:E2MAGzr1oBwrWpN6OPgQ8fjxqmJAwr4/0+ZixxTvs7A= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= diff --git a/vendor/github.com/ceph/go-ceph/cephfs/admin/clone.go b/vendor/github.com/ceph/go-ceph/cephfs/admin/clone.go index d8281359c78..9a00402fed5 100644 --- a/vendor/github.com/ceph/go-ceph/cephfs/admin/clone.go +++ b/vendor/github.com/ceph/go-ceph/cephfs/admin/clone.go @@ -81,10 +81,18 @@ type CloneSource struct { Snapshot string `json:"snapshot"` } +// CloneProgressReport contains the progress report of a subvolume clone. +type CloneProgressReport struct { + PercentageCloned string `json:"percentage cloned"` + AmountCloned string `json:"amount cloned"` + FilesCloned string `json:"files cloned"` +} + // CloneStatus reports on the status of a subvolume clone. type CloneStatus struct { - State CloneState `json:"state"` - Source CloneSource `json:"source"` + State CloneState `json:"state"` + Source CloneSource `json:"source"` + ProgressReport CloneProgressReport `json:"progress_report"` // failure can be obtained through .GetFailure() failure *CloneFailure diff --git a/vendor/github.com/ceph/go-ceph/rados/rados_getaddrs.go b/vendor/github.com/ceph/go-ceph/rados/rados_getaddrs.go new file mode 100644 index 00000000000..093e373d40f --- /dev/null +++ b/vendor/github.com/ceph/go-ceph/rados/rados_getaddrs.go @@ -0,0 +1,30 @@ +//go:build ceph_preview + +package rados + +// #cgo LDFLAGS: -lrados +// #include +// #include +import "C" + +import ( + "unsafe" +) + +// GetAddrs returns the addresses of the RADOS session, +// suitable for blocklisting. +// +// Implements: +// +// int rados_getaddrs(rados_t cluster, char **addrs) +func (c *Conn) GetAddrs() (string, error) { + var cAddrs *C.char + defer C.free(unsafe.Pointer(cAddrs)) + + ret := C.rados_getaddrs(c.cluster, &cAddrs) + if ret < 0 { + return "", getError(ret) + } + + return C.GoString(cAddrs), nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 0b21d18b9d9..a73850409be 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -204,7 +204,7 @@ github.com/ceph/ceph-csi/api/deploy/kubernetes/cephfs github.com/ceph/ceph-csi/api/deploy/kubernetes/nfs github.com/ceph/ceph-csi/api/deploy/kubernetes/rbd github.com/ceph/ceph-csi/api/deploy/ocp -# github.com/ceph/go-ceph v0.30.0 +# github.com/ceph/go-ceph v0.30.1-0.20241102143109-75d1af3ed638 ## explicit; go 1.19 github.com/ceph/go-ceph/cephfs github.com/ceph/go-ceph/cephfs/admin From c1382e0fef25ae0545a8f274aed9325d7dab77c7 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 4 Nov 2024 15:05:29 +0100 Subject: [PATCH 4/6] util: add GetAddrs method added GetAddrs to get the client Adress of the rados connection which is helpful for NetworkFencing Signed-off-by: Madhu Rajanna --- internal/util/connection.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/util/connection.go b/internal/util/connection.go index a052ddca472..c3b285d9884 100644 --- a/internal/util/connection.go +++ b/internal/util/connection.go @@ -151,3 +151,13 @@ func (cc *ClusterConnection) GetNFSAdmin() (*nfs.Admin, error) { return nfs.NewFromConn(cc.conn), nil } + +// GetAddrs returns the addresses of the RADOS session, +// suitable for blocklisting. +func (cc *ClusterConnection) GetAddrs() (string, error) { + if cc.conn == nil { + return "", errors.New("cluster is not connected yet") + } + + return cc.conn.GetAddrs() +} From ce25e1611060ef718a25fc8ac08c32c0b697487a Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 4 Nov 2024 15:12:41 +0100 Subject: [PATCH 5/6] rbd: implement GetFenceClients implemented GetFenceClients which connects to the ceph cluster and returns the ceph clusterID and the clientaddress that is used for rados connection. Signed-off-by: Madhu Rajanna --- internal/csi-addons/rbd/network_fence.go | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/internal/csi-addons/rbd/network_fence.go b/internal/csi-addons/rbd/network_fence.go index b7f4d6bba0f..2a258ff7e14 100644 --- a/internal/csi-addons/rbd/network_fence.go +++ b/internal/csi-addons/rbd/network_fence.go @@ -114,3 +114,59 @@ func (fcs *FenceControllerServer) UnfenceClusterNetwork( return &fence.UnfenceClusterNetworkResponse{}, nil } + +// GetFenceClients fetches the ceph cluster ID and the client address that need to be fenced. +func (fcs *FenceControllerServer) GetFenceClients( + ctx context.Context, + req *fence.GetFenceClientsRequest, +) (*fence.GetFenceClientsResponse, error) { + options := req.GetParameters() + clusterID, err := util.GetClusterID(options) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + cr, err := util.NewUserCredentials(req.GetSecrets()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + defer cr.DeleteCredentials() + + monitors, _ /* clusterID*/, err := util.GetMonsAndClusterID(ctx, clusterID, false) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + // Get the cluster ID of the ceph cluster. + conn := &util.ClusterConnection{} + err = conn.Connect(monitors, cr) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to connect to MONs %q: %s", monitors, err) + } + defer conn.Destroy() + + fsID, err := conn.GetFSID() + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get cephfs id: %s", err) + } + + address, err := conn.GetAddrs() + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get client address: %s", err) + } + + resp := &fence.GetFenceClientsResponse{ + Clients: []*fence.ClientDetails{ + { + Id: fsID, + Addresses: []*fence.CIDR{ + { + Cidr: address, + }, + }, + }, + }, + } + + return resp, nil +} From 828c041c8ade09669e77ce451dfa797903d1fb5c Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 5 Nov 2024 11:17:22 +0100 Subject: [PATCH 6/6] rbd: parse IP address The address we get from ceph contains the ip in the format of 10.244.0.1:0/2686266785 we need to extract the client IP from this address, we already have a helper to extract it, This makes the helper more generic can be reused by multiple packages in the fence controller. Signed-off-by: Madhu Rajanna --- internal/csi-addons/networkfence/fencing.go | 52 ++++++++++--------- .../csi-addons/networkfence/fencing_test.go | 42 +++++++++++++++ internal/csi-addons/rbd/network_fence.go | 12 ++++- 3 files changed, 80 insertions(+), 26 deletions(-) diff --git a/internal/csi-addons/networkfence/fencing.go b/internal/csi-addons/networkfence/fencing.go index 1f1eff72ac8..efa0de0fc76 100644 --- a/internal/csi-addons/networkfence/fencing.go +++ b/internal/csi-addons/networkfence/fencing.go @@ -217,31 +217,7 @@ func isIPInCIDR(ctx context.Context, ip, cidr string) bool { func (ac *activeClient) fetchIP() (string, error) { // example: "inst": "client.4305 172.21.9.34:0/422650892", // then returning value will be 172.21.9.34 - clientInfo := ac.Inst - - // Attempt to extract the IP address using a regular expression - // the regular expression aims to match either a complete IPv6 - // address or a complete IPv4 address follows by any prefix (v1 or v2) - // if exists - // (?:v[0-9]+:): this allows for an optional prefix starting with "v" - // followed by one or more digits and a colon. - // The ? outside the group makes the entire prefix section optional. - // (?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}: this allows to check for - // standard IPv6 address. - // |: Alternation operator to allow matching either the IPv6 pattern - // with a prefix or the IPv4 pattern. - // '(?:\d+\.){3}\d+: This part matches a standard IPv4 address. - re := regexp.MustCompile(`(?:v[0-9]+:)?([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}|(?:\d+\.){3}\d+)`) - ipMatches := re.FindStringSubmatch(clientInfo) - - if len(ipMatches) > 0 { - ip := net.ParseIP(ipMatches[1]) - if ip != nil { - return ip.String(), nil - } - } - - return "", fmt.Errorf("failed to extract IP address, incorrect format: %s", clientInfo) + return ParseClientIP(ac.Inst) } func (ac *activeClient) fetchID() (int, error) { @@ -526,3 +502,29 @@ func (nf *NetworkFence) parseBlocklistForCIDR(ctx context.Context, blocklist, ci return matchingHosts } + +func ParseClientIP(addr string) (string, error) { + // Attempt to extract the IP address using a regular expression + // the regular expression aims to match either a complete IPv6 + // address or a complete IPv4 address follows by any prefix (v1 or v2) + // if exists + // (?:v[0-9]+:): this allows for an optional prefix starting with "v" + // followed by one or more digits and a colon. + // The ? outside the group makes the entire prefix section optional. + // (?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}: this allows to check for + // standard IPv6 address. + // |: Alternation operator to allow matching either the IPv6 pattern + // with a prefix or the IPv4 pattern. + // '(?:\d+\.){3}\d+: This part matches a standard IPv4 address. + re := regexp.MustCompile(`(?:v[0-9]+:)?([0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}|(?:\d+\.){3}\d+)`) + ipMatches := re.FindStringSubmatch(addr) + + if len(ipMatches) > 0 { + ip := net.ParseIP(ipMatches[1]) + if ip != nil { + return ip.String(), nil + } + } + + return "", fmt.Errorf("failed to extract IP address, incorrect format: %s", addr) +} diff --git a/internal/csi-addons/networkfence/fencing_test.go b/internal/csi-addons/networkfence/fencing_test.go index 4bd7636acf3..4a6914685e0 100644 --- a/internal/csi-addons/networkfence/fencing_test.go +++ b/internal/csi-addons/networkfence/fencing_test.go @@ -257,3 +257,45 @@ listed 1 entries`, }) } } + +func TestParseClientIP(t *testing.T) { + t.Parallel() + tests := []struct { + name string + addr string + want string + wantErr bool + }{ + { + name: "IPv4 address", + addr: "10.244.0.1:0/2686266785", + want: "10.244.0.1", + wantErr: false, + }, + { + name: "IPv6 address", + addr: "2001:0db8:85a3:0000:0000:8a2e:0370:7334:0/2686266785", + want: "2001:db8:85a3::8a2e:370:7334", + wantErr: false, + }, + { + name: "Invalid address", + addr: "invalid", + want: "", + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + got, err := ParseClientIP(tt.addr) + if (err != nil) != tt.wantErr { + t.Errorf("ParseClientIP() error = %v, wantErr %v", err, tt.wantErr) + } + + if got != tt.want { + t.Errorf("ParseClientIP() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/internal/csi-addons/rbd/network_fence.go b/internal/csi-addons/rbd/network_fence.go index 2a258ff7e14..4ff46d7d90d 100644 --- a/internal/csi-addons/rbd/network_fence.go +++ b/internal/csi-addons/rbd/network_fence.go @@ -155,13 +155,23 @@ func (fcs *FenceControllerServer) GetFenceClients( return nil, status.Errorf(codes.Internal, "failed to get client address: %s", err) } + // The example address we get is 10.244.0.1:0/2686266785 from + // which we need to extract the IP address. + addr, err := nf.ParseClientIP(address) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to parse client address: %s", err) + } + + // adding /32 to the IP address to make it a CIDR block. + addr += "/32" + resp := &fence.GetFenceClientsResponse{ Clients: []*fence.ClientDetails{ { Id: fsID, Addresses: []*fence.CIDR{ { - Cidr: address, + Cidr: addr, }, }, },