From 0251c6da8ddb40ffff7b9eb655e27bc983fa456c Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Wed, 26 May 2021 22:52:18 +0000 Subject: [PATCH 1/4] Changes in the filesystem v1beta2 API --- client/api/filesystem/v1beta2/api.pb.go | 201 +++++++----------- client/api/filesystem/v1beta2/api.proto | 31 +-- integrationtests/filesystem_test.go | 34 ++- integrationtests/utils.go | 2 +- internal/os/filesystem/api.go | 40 ++-- internal/os/filesystem/api_test.go | 2 - internal/server/filesystem/internal/types.go | 9 - .../internal/v1alpha1/conversion_generated.go | 10 - .../internal/v1beta1/conversion_generated.go | 10 - .../internal/v1beta2/conversion_generated.go | 10 - internal/server/filesystem/server.go | 83 +++----- .../client/api/filesystem/v1beta2/api.pb.go | 201 +++++++----------- .../client/api/filesystem/v1beta2/api.proto | 31 +-- 13 files changed, 234 insertions(+), 430 deletions(-) diff --git a/client/api/filesystem/v1beta2/api.pb.go b/client/api/filesystem/v1beta2/api.pb.go index ed8bf3e3..c2b6f5b5 100644 --- a/client/api/filesystem/v1beta2/api.pb.go +++ b/client/api/filesystem/v1beta2/api.pb.go @@ -142,10 +142,8 @@ type PathExistsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // Indicates whether the path in PathExistsRequest exists in the host's filesystem - Exists bool `protobuf:"varint,2,opt,name=exists,proto3" json:"exists,omitempty"` + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` } func (x *PathExistsResponse) Reset() { @@ -180,13 +178,6 @@ func (*PathExistsResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{1} } -func (x *PathExistsResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - func (x *PathExistsResponse) GetExists() bool { if x != nil { return x.Exists @@ -273,9 +264,6 @@ type MkdirResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *MkdirResponse) Reset() { @@ -310,13 +298,6 @@ func (*MkdirResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{3} } -func (x *MkdirResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - type RmdirRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -402,9 +383,6 @@ type RmdirResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *RmdirResponse) Reset() { @@ -439,13 +417,6 @@ func (*RmdirResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{5} } -func (x *RmdirResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - type LinkPathRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -534,9 +505,6 @@ type LinkPathResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *LinkPathResponse) Reset() { @@ -571,13 +539,6 @@ func (*LinkPathResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{7} } -func (x *LinkPathResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - type IsMountPointRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -631,10 +592,8 @@ type IsMountPointResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // Indicates whether the path in PathExistsRequest exists in the host's filesystem - IsMountPoint bool `protobuf:"varint,2,opt,name=is_mount_point,json=isMountPoint,proto3" json:"is_mount_point,omitempty"` + IsMountPoint bool `protobuf:"varint,1,opt,name=is_mount_point,json=isMountPoint,proto3" json:"is_mount_point,omitempty"` } func (x *IsMountPointResponse) Reset() { @@ -669,13 +628,6 @@ func (*IsMountPointResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{9} } -func (x *IsMountPointResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - func (x *IsMountPointResponse) GetIsMountPoint() bool { if x != nil { return x.IsMountPoint @@ -697,72 +649,65 @@ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_p 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, - 0x42, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x22, 0x52, 0x0a, 0x0c, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x25, 0x0a, 0x0d, 0x4d, 0x6b, 0x64, 0x69, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x68, - 0x0a, 0x0c, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, - 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x0d, 0x52, 0x6d, 0x64, 0x69, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x53, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, - 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x50, 0x61, 0x74, 0x68, 0x22, 0x28, 0x0a, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x29, - 0x0a, 0x13, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x52, 0x0a, 0x14, 0x49, 0x73, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x69, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2a, 0x22, 0x0a, - 0x0b, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, 0x0a, 0x06, - 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, 0x44, 0x10, - 0x01, 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1a, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, 0x6b, 0x64, - 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, - 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, - 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, - 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, - 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x4d, 0x0a, 0x0c, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, - 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, - 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, - 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, 0x73, 0x69, - 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2c, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x52, 0x0a, + 0x0c, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, + 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x68, 0x0a, 0x0c, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, + 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x0a, + 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, + 0x74, 0x68, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x13, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, + 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x22, 0x3c, 0x0a, 0x14, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2a, + 0x22, 0x0a, 0x0b, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, + 0x0a, 0x06, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, + 0x44, 0x10, 0x01, 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, + 0x12, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, + 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, + 0x6b, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, + 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, + 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x41, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, + 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, + 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, + 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, + 0x73, 0x69, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -973,17 +918,17 @@ const _ = grpc.SupportPackageIsVersion6 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type FilesystemClient interface { - // PathExists checks if the requested path exists in the host's filesystem + // PathExists checks if the requested path exists in the host filesystem. PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host's filesystem + // Mkdir creates a directory at the requested path in the host filesystem Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath + // Rmdir removes the directory at the requested path in the host filesystem. + // This may be used for unlinking a symlink created through LinkPath. Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem + // and target path in the host's filesystem. LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) - //IsMountPoint checks if a given path is mount or not + // IsMountPoint checks if a given path is a mount point. IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) } @@ -1042,17 +987,17 @@ func (c *filesystemClient) IsMountPoint(ctx context.Context, in *IsMountPointReq // FilesystemServer is the server API for Filesystem service. type FilesystemServer interface { - // PathExists checks if the requested path exists in the host's filesystem + // PathExists checks if the requested path exists in the host filesystem. PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host's filesystem + // Mkdir creates a directory at the requested path in the host filesystem Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath + // Rmdir removes the directory at the requested path in the host filesystem. + // This may be used for unlinking a symlink created through LinkPath. Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem + // and target path in the host's filesystem. LinkPath(context.Context, *LinkPathRequest) (*LinkPathResponse, error) - //IsMountPoint checks if a given path is mount or not + // IsMountPoint checks if a given path is a mount point. IsMountPoint(context.Context, *IsMountPointRequest) (*IsMountPointResponse, error) } diff --git a/client/api/filesystem/v1beta2/api.proto b/client/api/filesystem/v1beta2/api.proto index 411fd5a0..ec29c5d0 100644 --- a/client/api/filesystem/v1beta2/api.proto +++ b/client/api/filesystem/v1beta2/api.proto @@ -5,21 +5,21 @@ package v1beta2; option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2"; service Filesystem { - // PathExists checks if the requested path exists in the host's filesystem + // PathExists checks if the requested path exists in the host filesystem. rpc PathExists(PathExistsRequest) returns (PathExistsResponse) {} - // Mkdir creates a directory at the requested path in the host's filesystem + // Mkdir creates a directory at the requested path in the host filesystem rpc Mkdir(MkdirRequest) returns (MkdirResponse) {} - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath + // Rmdir removes the directory at the requested path in the host filesystem. + // This may be used for unlinking a symlink created through LinkPath. rpc Rmdir(RmdirRequest) returns (RmdirResponse) {} // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem + // and target path in the host's filesystem. rpc LinkPath(LinkPathRequest) returns (LinkPathResponse) {} - //IsMountPoint checks if a given path is mount or not + // IsMountPoint checks if a given path is a mount point. rpc IsMountPoint(IsMountPointRequest) returns (IsMountPointResponse) {} } @@ -47,11 +47,8 @@ message PathExistsRequest { } message PathExistsResponse { - // Error message if any. Empty string indicates success - string error = 1; - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool exists = 2; + bool exists = 1; } message MkdirRequest { @@ -81,8 +78,7 @@ message MkdirRequest { } message MkdirResponse { - // Error message if any. Empty string indicates success - string error = 1; + // Intentionally empty. } message RmdirRequest { @@ -112,8 +108,7 @@ message RmdirRequest { } message RmdirResponse { - // Error message if any. Empty string indicates success - string error = 1; + // Intentionally empty. } message LinkPathRequest { @@ -152,8 +147,7 @@ message LinkPathRequest { } message LinkPathResponse { - // Error message if any. Empty string indicates success - string error = 1; + // Intentionally empty. } message IsMountPointRequest { @@ -162,9 +156,6 @@ message IsMountPointRequest { } message IsMountPointResponse { - // Error message if any. Empty string indicates success - string error = 1; - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool is_mount_point = 2; + bool is_mount_point = 1; } diff --git a/integrationtests/filesystem_test.go b/integrationtests/filesystem_test.go index 7cbebdcd..69edee89 100644 --- a/integrationtests/filesystem_test.go +++ b/integrationtests/filesystem_test.go @@ -38,37 +38,31 @@ func TestFilesystemAPIGroup(t *testing.T) { r1 := rand.New(s1) // simulate FS operations around staging a volume on a node - stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", r1.Intn(100), r1.Intn(100)), t) + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d\\", r1.Intn(100), r1.Intn(100)), t) mkdirReq := &v1beta2.MkdirRequest{ Path: stagepath, Context: v1beta2.PathContext_PLUGIN, } - mkdirRsp, err := client.Mkdir(context.Background(), mkdirReq) - if assert.Nil(t, err) { - assert.Equal(t, "", mkdirRsp.Error) - } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) exists, err := pathExists(stagepath) assert.True(t, exists, err) // simulate operations around publishing a volume to a pod - podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d", r1.Intn(100)), t) + podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d\\", r1.Intn(100)), t) mkdirReq = &v1beta2.MkdirRequest{ Path: podpath, Context: v1beta2.PathContext_POD, } - mkdirRsp, err = client.Mkdir(context.Background(), mkdirReq) - if assert.Nil(t, err) { - assert.Equal(t, "", mkdirRsp.Error) - } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) linkReq := &v1beta2.LinkPathRequest{ TargetPath: stagepath, SourcePath: podpath + "\\rootvol", } - linkRsp, err := client.LinkPath(context.Background(), linkReq) - if assert.Nil(t, err) { - assert.Equal(t, "", linkRsp.Error) - } + _, err = client.LinkPath(context.Background(), linkReq) + require.NoError(t, err) exists, err = pathExists(podpath + "\\rootvol") assert.True(t, exists, err) @@ -79,10 +73,8 @@ func TestFilesystemAPIGroup(t *testing.T) { Context: v1beta2.PathContext_POD, Force: true, } - rmdirRsp, err := client.Rmdir(context.Background(), rmdirReq) - if assert.Nil(t, err) { - assert.Equal(t, "", rmdirRsp.Error) - } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) exists, err = pathExists(podpath) assert.False(t, exists, err) @@ -93,10 +85,8 @@ func TestFilesystemAPIGroup(t *testing.T) { Context: v1beta2.PathContext_PLUGIN, Force: true, } - rmdirRsp, err = client.Rmdir(context.Background(), rmdirReq) - if assert.Nil(t, err) { - assert.Equal(t, "", rmdirRsp.Error) - } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) exists, err = pathExists(stagepath) assert.False(t, exists, err) diff --git a/integrationtests/utils.go b/integrationtests/utils.go index 2fd0b525..1ff5bc24 100644 --- a/integrationtests/utils.go +++ b/integrationtests/utils.go @@ -132,7 +132,7 @@ func getWorkDirPath(dir string, t *testing.T) string { if err != nil { t.Fatalf("failed to get working directory: %s", err) } - return fmt.Sprintf("%s%ctestdir%c%s", path, os.PathSeparator, os.PathSeparator, dir) + return filepath.Join(path, path, dir) } // returns true if CSI_PROXY_GH_ACTIONS is set to "TRUE" diff --git a/internal/os/filesystem/api.go b/internal/os/filesystem/api.go index 9849ecb6..e83c78cb 100644 --- a/internal/os/filesystem/api.go +++ b/internal/os/filesystem/api.go @@ -12,10 +12,23 @@ import ( // internal/server/filesystem/server.go so that logic can be easily unit-tested // without requiring specific OS environments. -type APIImplementor struct{} +// API is the exposed Filesystem API +type API interface { + PathExists(path string) (bool, error) + PathValid(path string) (bool, error) + Mkdir(path string) error + Rmdir(path string, force bool) error + LinkPath(tgt string, src string) error + IsMountPoint(path string) (bool, error) +} + +type filesystemAPI struct{} + +// check that filesystemAPI implements API +var _ API = &filesystemAPI{} -func New() APIImplementor { - return APIImplementor{} +func New() API { + return filesystemAPI{} } func pathExists(path string) (bool, error) { @@ -29,13 +42,13 @@ func pathExists(path string) (bool, error) { return false, err } -func (APIImplementor) PathExists(path string) (bool, error) { +func (filesystemAPI) PathExists(path string) (bool, error) { return pathExists(path) } func pathValid(path string) (bool, error) { - cmd := exec.Command("powershell", "/c", `Test-Path $Env:remoteapth`) - cmd.Env = append(os.Environ(), fmt.Sprintf("remoteapth=%s", path)) + cmd := exec.Command("powershell", "/c", `Test-Path $Env:remotepath`) + cmd.Env = append(os.Environ(), fmt.Sprintf("remotepath=%s", path)) output, err := cmd.CombinedOutput() if err != nil { return false, fmt.Errorf("returned output: %s, error: %v", string(output), err) @@ -48,31 +61,34 @@ func pathValid(path string) (bool, error) { // https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/test-path?view=powershell-7 // for a remote path, determines whether connection is ok // e.g. in a SMB server connection, if password is changed, connection will be lost, this func will return false -func (APIImplementor) PathValid(path string) (bool, error) { +func (filesystemAPI) PathValid(path string) (bool, error) { return pathValid(path) } -func (APIImplementor) Mkdir(path string) error { +// Mkdir makes a dir with `os.MkdirAll`. +func (filesystemAPI) Mkdir(path string) error { return os.MkdirAll(path, 0755) } -func (APIImplementor) Rmdir(path string, force bool) error { +// Rmdir removes a dir with `os.Remove`, if force is true then `os.RemoveAll` is used instead. +func (filesystemAPI) Rmdir(path string, force bool) error { if force { return os.RemoveAll(path) } return os.Remove(path) } -func (APIImplementor) LinkPath(oldname, newname string) error { +// LinkPath creates newname as a symbolic link to oldname. +func (filesystemAPI) LinkPath(oldname, newname string) error { return os.Symlink(oldname, newname) } -// IsMountPoint - returns true if its a mount point. +// IsMountPoint - returns true if tgt is a mount point. // A path is considered a mount point if: // - directory exists and // - it is a soft link and // - the target path of the link exists. -func (APIImplementor) IsMountPoint(tgt string) (bool, error) { +func (filesystemAPI) IsMountPoint(tgt string) (bool, error) { // This code is similar to k8s.io/kubernetes/pkg/util/mount except the pathExists usage. // Also in a remote call environment the os error cannot be passed directly back, hence the callers // are expected to perform the isExists check before calling this call in CSI proxy. diff --git a/internal/os/filesystem/api_test.go b/internal/os/filesystem/api_test.go index b8fd4dd5..13b81ab0 100644 --- a/internal/os/filesystem/api_test.go +++ b/internal/os/filesystem/api_test.go @@ -1,5 +1,3 @@ -// +build windows - package filesystem import ( diff --git a/internal/server/filesystem/internal/types.go b/internal/server/filesystem/internal/types.go index 356e0f0b..204d4700 100644 --- a/internal/server/filesystem/internal/types.go +++ b/internal/server/filesystem/internal/types.go @@ -20,8 +20,6 @@ type PathExistsRequest struct { // PathExistsResponse is the internal representation of responses from the PathExists endpoint. type PathExistsResponse struct { - // Error message if any. Empty string indicates success - Error string // Indicates whether the path in PathExistsRequest exists in the host's filesystem Exists bool } @@ -54,8 +52,6 @@ type MkdirRequest struct { } type MkdirResponse struct { - // Error message if any. Empty string indicates success - Error string } type RmdirRequest struct { @@ -85,8 +81,6 @@ type RmdirRequest struct { } type RmdirResponse struct { - // Error message if any. Empty string indicates success - Error string } type LinkPathRequest struct { @@ -120,8 +114,6 @@ type LinkPathRequest struct { } type LinkPathResponse struct { - // Error message if any. Empty string indicates success - Error string } type IsMountPointRequest struct { @@ -129,6 +121,5 @@ type IsMountPointRequest struct { } type IsMountPointResponse struct { - Error string IsMountPoint bool } diff --git a/internal/server/filesystem/internal/v1alpha1/conversion_generated.go b/internal/server/filesystem/internal/v1alpha1/conversion_generated.go index 1a6bbc8e..6512b238 100644 --- a/internal/server/filesystem/internal/v1alpha1/conversion_generated.go +++ b/internal/server/filesystem/internal/v1alpha1/conversion_generated.go @@ -28,7 +28,6 @@ func Convert_internal_IsMountPointRequest_To_v1alpha1_IsMountPointRequest(in *in } func autoConvert_v1alpha1_IsMountPointResponse_To_internal_IsMountPointResponse(in *v1alpha1.IsMountPointResponse, out *internal.IsMountPointResponse) error { - out.Error = in.Error out.IsMountPoint = in.IsMountPoint return nil } @@ -39,7 +38,6 @@ func Convert_v1alpha1_IsMountPointResponse_To_internal_IsMountPointResponse(in * } func autoConvert_internal_IsMountPointResponse_To_v1alpha1_IsMountPointResponse(in *internal.IsMountPointResponse, out *v1alpha1.IsMountPointResponse) error { - out.Error = in.Error out.IsMountPoint = in.IsMountPoint return nil } @@ -72,7 +70,6 @@ func Convert_internal_LinkPathRequest_To_v1alpha1_LinkPathRequest(in *internal.L } func autoConvert_v1alpha1_LinkPathResponse_To_internal_LinkPathResponse(in *v1alpha1.LinkPathResponse, out *internal.LinkPathResponse) error { - out.Error = in.Error return nil } @@ -82,7 +79,6 @@ func Convert_v1alpha1_LinkPathResponse_To_internal_LinkPathResponse(in *v1alpha1 } func autoConvert_internal_LinkPathResponse_To_v1alpha1_LinkPathResponse(in *internal.LinkPathResponse, out *v1alpha1.LinkPathResponse) error { - out.Error = in.Error return nil } @@ -114,7 +110,6 @@ func Convert_internal_MkdirRequest_To_v1alpha1_MkdirRequest(in *internal.MkdirRe } func autoConvert_v1alpha1_MkdirResponse_To_internal_MkdirResponse(in *v1alpha1.MkdirResponse, out *internal.MkdirResponse) error { - out.Error = in.Error return nil } @@ -124,7 +119,6 @@ func Convert_v1alpha1_MkdirResponse_To_internal_MkdirResponse(in *v1alpha1.Mkdir } func autoConvert_internal_MkdirResponse_To_v1alpha1_MkdirResponse(in *internal.MkdirResponse, out *v1alpha1.MkdirResponse) error { - out.Error = in.Error return nil } @@ -156,7 +150,6 @@ func Convert_internal_PathExistsRequest_To_v1alpha1_PathExistsRequest(in *intern } func autoConvert_v1alpha1_PathExistsResponse_To_internal_PathExistsResponse(in *v1alpha1.PathExistsResponse, out *internal.PathExistsResponse) error { - out.Error = in.Error out.Exists = in.Exists return nil } @@ -167,7 +160,6 @@ func Convert_v1alpha1_PathExistsResponse_To_internal_PathExistsResponse(in *v1al } func autoConvert_internal_PathExistsResponse_To_v1alpha1_PathExistsResponse(in *internal.PathExistsResponse, out *v1alpha1.PathExistsResponse) error { - out.Error = in.Error out.Exists = in.Exists return nil } @@ -202,7 +194,6 @@ func Convert_internal_RmdirRequest_To_v1alpha1_RmdirRequest(in *internal.RmdirRe } func autoConvert_v1alpha1_RmdirResponse_To_internal_RmdirResponse(in *v1alpha1.RmdirResponse, out *internal.RmdirResponse) error { - out.Error = in.Error return nil } @@ -212,7 +203,6 @@ func Convert_v1alpha1_RmdirResponse_To_internal_RmdirResponse(in *v1alpha1.Rmdir } func autoConvert_internal_RmdirResponse_To_v1alpha1_RmdirResponse(in *internal.RmdirResponse, out *v1alpha1.RmdirResponse) error { - out.Error = in.Error return nil } diff --git a/internal/server/filesystem/internal/v1beta1/conversion_generated.go b/internal/server/filesystem/internal/v1beta1/conversion_generated.go index c03843d8..b6a81ecf 100644 --- a/internal/server/filesystem/internal/v1beta1/conversion_generated.go +++ b/internal/server/filesystem/internal/v1beta1/conversion_generated.go @@ -28,7 +28,6 @@ func Convert_internal_IsMountPointRequest_To_v1beta1_IsMountPointRequest(in *int } func autoConvert_v1beta1_IsMountPointResponse_To_internal_IsMountPointResponse(in *v1beta1.IsMountPointResponse, out *internal.IsMountPointResponse) error { - out.Error = in.Error out.IsMountPoint = in.IsMountPoint return nil } @@ -39,7 +38,6 @@ func Convert_v1beta1_IsMountPointResponse_To_internal_IsMountPointResponse(in *v } func autoConvert_internal_IsMountPointResponse_To_v1beta1_IsMountPointResponse(in *internal.IsMountPointResponse, out *v1beta1.IsMountPointResponse) error { - out.Error = in.Error out.IsMountPoint = in.IsMountPoint return nil } @@ -72,7 +70,6 @@ func Convert_internal_LinkPathRequest_To_v1beta1_LinkPathRequest(in *internal.Li } func autoConvert_v1beta1_LinkPathResponse_To_internal_LinkPathResponse(in *v1beta1.LinkPathResponse, out *internal.LinkPathResponse) error { - out.Error = in.Error return nil } @@ -82,7 +79,6 @@ func Convert_v1beta1_LinkPathResponse_To_internal_LinkPathResponse(in *v1beta1.L } func autoConvert_internal_LinkPathResponse_To_v1beta1_LinkPathResponse(in *internal.LinkPathResponse, out *v1beta1.LinkPathResponse) error { - out.Error = in.Error return nil } @@ -114,7 +110,6 @@ func Convert_internal_MkdirRequest_To_v1beta1_MkdirRequest(in *internal.MkdirReq } func autoConvert_v1beta1_MkdirResponse_To_internal_MkdirResponse(in *v1beta1.MkdirResponse, out *internal.MkdirResponse) error { - out.Error = in.Error return nil } @@ -124,7 +119,6 @@ func Convert_v1beta1_MkdirResponse_To_internal_MkdirResponse(in *v1beta1.MkdirRe } func autoConvert_internal_MkdirResponse_To_v1beta1_MkdirResponse(in *internal.MkdirResponse, out *v1beta1.MkdirResponse) error { - out.Error = in.Error return nil } @@ -156,7 +150,6 @@ func Convert_internal_PathExistsRequest_To_v1beta1_PathExistsRequest(in *interna } func autoConvert_v1beta1_PathExistsResponse_To_internal_PathExistsResponse(in *v1beta1.PathExistsResponse, out *internal.PathExistsResponse) error { - out.Error = in.Error out.Exists = in.Exists return nil } @@ -167,7 +160,6 @@ func Convert_v1beta1_PathExistsResponse_To_internal_PathExistsResponse(in *v1bet } func autoConvert_internal_PathExistsResponse_To_v1beta1_PathExistsResponse(in *internal.PathExistsResponse, out *v1beta1.PathExistsResponse) error { - out.Error = in.Error out.Exists = in.Exists return nil } @@ -202,7 +194,6 @@ func Convert_internal_RmdirRequest_To_v1beta1_RmdirRequest(in *internal.RmdirReq } func autoConvert_v1beta1_RmdirResponse_To_internal_RmdirResponse(in *v1beta1.RmdirResponse, out *internal.RmdirResponse) error { - out.Error = in.Error return nil } @@ -212,7 +203,6 @@ func Convert_v1beta1_RmdirResponse_To_internal_RmdirResponse(in *v1beta1.RmdirRe } func autoConvert_internal_RmdirResponse_To_v1beta1_RmdirResponse(in *internal.RmdirResponse, out *v1beta1.RmdirResponse) error { - out.Error = in.Error return nil } diff --git a/internal/server/filesystem/internal/v1beta2/conversion_generated.go b/internal/server/filesystem/internal/v1beta2/conversion_generated.go index a2c41b22..74098d0f 100644 --- a/internal/server/filesystem/internal/v1beta2/conversion_generated.go +++ b/internal/server/filesystem/internal/v1beta2/conversion_generated.go @@ -28,7 +28,6 @@ func Convert_internal_IsMountPointRequest_To_v1beta2_IsMountPointRequest(in *int } func autoConvert_v1beta2_IsMountPointResponse_To_internal_IsMountPointResponse(in *v1beta2.IsMountPointResponse, out *internal.IsMountPointResponse) error { - out.Error = in.Error out.IsMountPoint = in.IsMountPoint return nil } @@ -39,7 +38,6 @@ func Convert_v1beta2_IsMountPointResponse_To_internal_IsMountPointResponse(in *v } func autoConvert_internal_IsMountPointResponse_To_v1beta2_IsMountPointResponse(in *internal.IsMountPointResponse, out *v1beta2.IsMountPointResponse) error { - out.Error = in.Error out.IsMountPoint = in.IsMountPoint return nil } @@ -72,7 +70,6 @@ func Convert_internal_LinkPathRequest_To_v1beta2_LinkPathRequest(in *internal.Li } func autoConvert_v1beta2_LinkPathResponse_To_internal_LinkPathResponse(in *v1beta2.LinkPathResponse, out *internal.LinkPathResponse) error { - out.Error = in.Error return nil } @@ -82,7 +79,6 @@ func Convert_v1beta2_LinkPathResponse_To_internal_LinkPathResponse(in *v1beta2.L } func autoConvert_internal_LinkPathResponse_To_v1beta2_LinkPathResponse(in *internal.LinkPathResponse, out *v1beta2.LinkPathResponse) error { - out.Error = in.Error return nil } @@ -114,7 +110,6 @@ func Convert_internal_MkdirRequest_To_v1beta2_MkdirRequest(in *internal.MkdirReq } func autoConvert_v1beta2_MkdirResponse_To_internal_MkdirResponse(in *v1beta2.MkdirResponse, out *internal.MkdirResponse) error { - out.Error = in.Error return nil } @@ -124,7 +119,6 @@ func Convert_v1beta2_MkdirResponse_To_internal_MkdirResponse(in *v1beta2.MkdirRe } func autoConvert_internal_MkdirResponse_To_v1beta2_MkdirResponse(in *internal.MkdirResponse, out *v1beta2.MkdirResponse) error { - out.Error = in.Error return nil } @@ -156,7 +150,6 @@ func Convert_internal_PathExistsRequest_To_v1beta2_PathExistsRequest(in *interna } func autoConvert_v1beta2_PathExistsResponse_To_internal_PathExistsResponse(in *v1beta2.PathExistsResponse, out *internal.PathExistsResponse) error { - out.Error = in.Error out.Exists = in.Exists return nil } @@ -167,7 +160,6 @@ func Convert_v1beta2_PathExistsResponse_To_internal_PathExistsResponse(in *v1bet } func autoConvert_internal_PathExistsResponse_To_v1beta2_PathExistsResponse(in *internal.PathExistsResponse, out *v1beta2.PathExistsResponse) error { - out.Error = in.Error out.Exists = in.Exists return nil } @@ -202,7 +194,6 @@ func Convert_internal_RmdirRequest_To_v1beta2_RmdirRequest(in *internal.RmdirReq } func autoConvert_v1beta2_RmdirResponse_To_internal_RmdirResponse(in *v1beta2.RmdirResponse, out *internal.RmdirResponse) error { - out.Error = in.Error return nil } @@ -212,7 +203,6 @@ func Convert_v1beta2_RmdirResponse_To_internal_RmdirResponse(in *v1beta2.RmdirRe } func autoConvert_internal_RmdirResponse_To_v1beta2_RmdirResponse(in *internal.RmdirResponse, out *v1beta2.RmdirResponse) error { - out.Error = in.Error return nil } diff --git a/internal/server/filesystem/server.go b/internal/server/filesystem/server.go index 4e9054ed..0dd5f1a3 100644 --- a/internal/server/filesystem/server.go +++ b/internal/server/filesystem/server.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/kubernetes-csi/csi-proxy/client/apiversion" + "github.com/kubernetes-csi/csi-proxy/internal/os/filesystem" "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal" "github.com/kubernetes-csi/csi-proxy/internal/utils" "k8s.io/klog/v2" @@ -15,22 +16,16 @@ import ( type Server struct { kubeletCSIPluginsPath string kubeletPodPath string - hostAPI API + hostAPI filesystem.API } +// check that Server fulfills internal.ServerInterface +var _ internal.ServerInterface = &Server{} + var invalidPathCharsRegexWindows = regexp.MustCompile(`["/\:\?\*|]`) var absPathRegexWindows = regexp.MustCompile(`^[a-zA-Z]:\\`) -type API interface { - PathExists(path string) (bool, error) - PathValid(path string) (bool, error) - Mkdir(path string) error - Rmdir(path string, force bool) error - LinkPath(tgt string, src string) error - IsMountPoint(path string) (bool, error) -} - -func NewServer(kubeletCSIPluginsPath string, kubeletPodPath string, hostAPI API) (*Server, error) { +func NewServer(kubeletCSIPluginsPath string, kubeletPodPath string, hostAPI filesystem.API) (*Server, error) { return &Server{ kubeletCSIPluginsPath: kubeletCSIPluginsPath, kubeletPodPath: kubeletPodPath, @@ -119,115 +114,87 @@ func (s *Server) validatePathWindows(pathCtx internal.PathContext, path string) // PathExists checks if the given path exists on the host. func (s *Server) PathExists(ctx context.Context, request *internal.PathExistsRequest, version apiversion.Version) (*internal.PathExistsResponse, error) { - klog.V(4).Infof("calling PathExists with path %q", request.Path) + klog.V(2).Infof("Request: PathExists with path=%q", request.Path) err := s.validatePathWindows(request.Context, request.Path) if err != nil { klog.Errorf("failed validatePathWindows %v", err) - return &internal.PathExistsResponse{ - Error: err.Error(), - }, err + return nil, err } exists, err := s.hostAPI.PathExists(request.Path) if err != nil { klog.Errorf("failed check PathExists %v", err) - return &internal.PathExistsResponse{ - Error: err.Error(), - }, err + return nil, err } return &internal.PathExistsResponse{ - Error: "", Exists: exists, }, err } // PathValid checks if the given path is accessiable. func (s *Server) PathValid(ctx context.Context, path string) (bool, error) { - klog.V(4).Infof("calling PathValid with path %q", path) + klog.V(2).Infof("Request: PathValid with path %q", path) return s.hostAPI.PathValid(path) } func (s *Server) Mkdir(ctx context.Context, request *internal.MkdirRequest, version apiversion.Version) (*internal.MkdirResponse, error) { - klog.V(4).Infof("calling Mkdir with path %q", request.Path) + klog.V(2).Infof("Request: Mkdir with path=%q", request.Path) err := s.validatePathWindows(request.Context, request.Path) if err != nil { klog.Errorf("failed validatePathWindows %v", err) - return &internal.MkdirResponse{ - Error: err.Error(), - }, err + return nil, err } err = s.hostAPI.Mkdir(request.Path) if err != nil { klog.Errorf("failed Mkdir %v", err) - return &internal.MkdirResponse{ - Error: err.Error(), - }, err + return nil, err } - return &internal.MkdirResponse{ - Error: "", - }, err + return &internal.MkdirResponse{}, err } func (s *Server) Rmdir(ctx context.Context, request *internal.RmdirRequest, version apiversion.Version) (*internal.RmdirResponse, error) { - klog.V(2).Infof("calling Rmdir with path %q", request.Path) + klog.V(2).Infof("Request: Rmdir with path=%q", request.Path) err := s.validatePathWindows(request.Context, request.Path) if err != nil { klog.Errorf("failed validatePathWindows %v", err) - return &internal.RmdirResponse{ - Error: err.Error(), - }, err + return nil, err } err = s.hostAPI.Rmdir(request.Path, request.Force) if err != nil { klog.Errorf("failed Rmdir %v", err) - return &internal.RmdirResponse{ - Error: err.Error(), - }, err + return nil, err } - return &internal.RmdirResponse{ - Error: "", - }, err + return nil, err } func (s *Server) LinkPath(ctx context.Context, request *internal.LinkPathRequest, version apiversion.Version) (*internal.LinkPathResponse, error) { - klog.V(4).Infof("calling LinkPath with targetPath %q sourcePath %q", request.TargetPath, request.SourcePath) + klog.V(2).Infof("Request: LinkPath with targetPath=%q sourcePath=%q", request.TargetPath, request.SourcePath) err := s.validatePathWindows(internal.POD, request.TargetPath) if err != nil { klog.Errorf("failed validatePathWindows for target path %v", err) - return &internal.LinkPathResponse{ - Error: err.Error(), - }, err + return nil, err } err = s.validatePathWindows(internal.PLUGIN, request.SourcePath) if err != nil { klog.Errorf("failed validatePathWindows for source path %v", err) - return &internal.LinkPathResponse{ - Error: err.Error(), - }, err + return nil, err } err = s.hostAPI.LinkPath(request.SourcePath, request.TargetPath) - errString := "" if err != nil { klog.Errorf("failed LinkPath %v", err) - errString = err.Error() + return nil, err } - return &internal.LinkPathResponse{ - Error: errString, - }, err + return nil, err } func (s *Server) IsMountPoint(ctx context.Context, request *internal.IsMountPointRequest, version apiversion.Version) (*internal.IsMountPointResponse, error) { - klog.V(4).Infof("calling IsMountPoint with path %q", request.Path) + klog.V(2).Infof("Request: IsMountPoint with path=%q", request.Path) isMount, err := s.hostAPI.IsMountPoint(request.Path) if err != nil { klog.Errorf("failed IsMountPoint %v", err) - return &internal.IsMountPointResponse{ - IsMountPoint: false, - Error: err.Error(), - }, err + return nil, err } return &internal.IsMountPointResponse{ - Error: "", IsMountPoint: isMount, }, err } diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go index ed8bf3e3..c2b6f5b5 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go @@ -142,10 +142,8 @@ type PathExistsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // Indicates whether the path in PathExistsRequest exists in the host's filesystem - Exists bool `protobuf:"varint,2,opt,name=exists,proto3" json:"exists,omitempty"` + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` } func (x *PathExistsResponse) Reset() { @@ -180,13 +178,6 @@ func (*PathExistsResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{1} } -func (x *PathExistsResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - func (x *PathExistsResponse) GetExists() bool { if x != nil { return x.Exists @@ -273,9 +264,6 @@ type MkdirResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *MkdirResponse) Reset() { @@ -310,13 +298,6 @@ func (*MkdirResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{3} } -func (x *MkdirResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - type RmdirRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -402,9 +383,6 @@ type RmdirResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *RmdirResponse) Reset() { @@ -439,13 +417,6 @@ func (*RmdirResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{5} } -func (x *RmdirResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - type LinkPathRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -534,9 +505,6 @@ type LinkPathResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *LinkPathResponse) Reset() { @@ -571,13 +539,6 @@ func (*LinkPathResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{7} } -func (x *LinkPathResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - type IsMountPointRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -631,10 +592,8 @@ type IsMountPointResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Error message if any. Empty string indicates success - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // Indicates whether the path in PathExistsRequest exists in the host's filesystem - IsMountPoint bool `protobuf:"varint,2,opt,name=is_mount_point,json=isMountPoint,proto3" json:"is_mount_point,omitempty"` + IsMountPoint bool `protobuf:"varint,1,opt,name=is_mount_point,json=isMountPoint,proto3" json:"is_mount_point,omitempty"` } func (x *IsMountPointResponse) Reset() { @@ -669,13 +628,6 @@ func (*IsMountPointResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{9} } -func (x *IsMountPointResponse) GetError() string { - if x != nil { - return x.Error - } - return "" -} - func (x *IsMountPointResponse) GetIsMountPoint() bool { if x != nil { return x.IsMountPoint @@ -697,72 +649,65 @@ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_p 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, - 0x42, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x22, 0x52, 0x0a, 0x0c, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x25, 0x0a, 0x0d, 0x4d, 0x6b, 0x64, 0x69, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x68, - 0x0a, 0x0c, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, - 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x0d, 0x52, 0x6d, 0x64, 0x69, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x53, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, - 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x50, 0x61, 0x74, 0x68, 0x22, 0x28, 0x0a, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x29, - 0x0a, 0x13, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x52, 0x0a, 0x14, 0x49, 0x73, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x69, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2a, 0x22, 0x0a, - 0x0b, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, 0x0a, 0x06, - 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, 0x44, 0x10, - 0x01, 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1a, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, 0x6b, 0x64, - 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, - 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, - 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, - 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, - 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x4d, 0x0a, 0x0c, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, - 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, - 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, - 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, 0x73, 0x69, - 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2c, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x52, 0x0a, + 0x0c, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, + 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x68, 0x0a, 0x0c, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, + 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x0a, + 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, + 0x74, 0x68, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x13, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, + 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x22, 0x3c, 0x0a, 0x14, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2a, + 0x22, 0x0a, 0x0b, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, + 0x0a, 0x06, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, + 0x44, 0x10, 0x01, 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, + 0x12, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, + 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, + 0x6b, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, + 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, + 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x41, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, + 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, + 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, + 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, + 0x73, 0x69, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -973,17 +918,17 @@ const _ = grpc.SupportPackageIsVersion6 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type FilesystemClient interface { - // PathExists checks if the requested path exists in the host's filesystem + // PathExists checks if the requested path exists in the host filesystem. PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host's filesystem + // Mkdir creates a directory at the requested path in the host filesystem Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath + // Rmdir removes the directory at the requested path in the host filesystem. + // This may be used for unlinking a symlink created through LinkPath. Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem + // and target path in the host's filesystem. LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) - //IsMountPoint checks if a given path is mount or not + // IsMountPoint checks if a given path is a mount point. IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) } @@ -1042,17 +987,17 @@ func (c *filesystemClient) IsMountPoint(ctx context.Context, in *IsMountPointReq // FilesystemServer is the server API for Filesystem service. type FilesystemServer interface { - // PathExists checks if the requested path exists in the host's filesystem + // PathExists checks if the requested path exists in the host filesystem. PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host's filesystem + // Mkdir creates a directory at the requested path in the host filesystem Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath + // Rmdir removes the directory at the requested path in the host filesystem. + // This may be used for unlinking a symlink created through LinkPath. Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem + // and target path in the host's filesystem. LinkPath(context.Context, *LinkPathRequest) (*LinkPathResponse, error) - //IsMountPoint checks if a given path is mount or not + // IsMountPoint checks if a given path is a mount point. IsMountPoint(context.Context, *IsMountPointRequest) (*IsMountPointResponse, error) } diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto index 411fd5a0..ec29c5d0 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto @@ -5,21 +5,21 @@ package v1beta2; option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2"; service Filesystem { - // PathExists checks if the requested path exists in the host's filesystem + // PathExists checks if the requested path exists in the host filesystem. rpc PathExists(PathExistsRequest) returns (PathExistsResponse) {} - // Mkdir creates a directory at the requested path in the host's filesystem + // Mkdir creates a directory at the requested path in the host filesystem rpc Mkdir(MkdirRequest) returns (MkdirResponse) {} - // Rmdir removes the directory at the requested path in the host's filesystem. - // This may be used for unlinking a symlink created through LinkPath + // Rmdir removes the directory at the requested path in the host filesystem. + // This may be used for unlinking a symlink created through LinkPath. rpc Rmdir(RmdirRequest) returns (RmdirResponse) {} // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem + // and target path in the host's filesystem. rpc LinkPath(LinkPathRequest) returns (LinkPathResponse) {} - //IsMountPoint checks if a given path is mount or not + // IsMountPoint checks if a given path is a mount point. rpc IsMountPoint(IsMountPointRequest) returns (IsMountPointResponse) {} } @@ -47,11 +47,8 @@ message PathExistsRequest { } message PathExistsResponse { - // Error message if any. Empty string indicates success - string error = 1; - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool exists = 2; + bool exists = 1; } message MkdirRequest { @@ -81,8 +78,7 @@ message MkdirRequest { } message MkdirResponse { - // Error message if any. Empty string indicates success - string error = 1; + // Intentionally empty. } message RmdirRequest { @@ -112,8 +108,7 @@ message RmdirRequest { } message RmdirResponse { - // Error message if any. Empty string indicates success - string error = 1; + // Intentionally empty. } message LinkPathRequest { @@ -152,8 +147,7 @@ message LinkPathRequest { } message LinkPathResponse { - // Error message if any. Empty string indicates success - string error = 1; + // Intentionally empty. } message IsMountPointRequest { @@ -162,9 +156,6 @@ message IsMountPointRequest { } message IsMountPointResponse { - // Error message if any. Empty string indicates success - string error = 1; - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool is_mount_point = 2; + bool is_mount_point = 1; } From 1d5d9c9336a687f2193fd223e4405a71a4f04cc1 Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Thu, 27 May 2021 20:56:36 +0000 Subject: [PATCH 2/4] fix unit tests --- integrationtests/filesystem_test.go | 16 ++++++++++++---- integrationtests/utils.go | 2 +- internal/server/filesystem/server_test.go | 19 +++++++++++-------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/integrationtests/filesystem_test.go b/integrationtests/filesystem_test.go index 69edee89..d577bbad 100644 --- a/integrationtests/filesystem_test.go +++ b/integrationtests/filesystem_test.go @@ -5,6 +5,7 @@ import ( "fmt" "math/rand" "os" + "path/filepath" "testing" "time" @@ -38,7 +39,7 @@ func TestFilesystemAPIGroup(t *testing.T) { r1 := rand.New(s1) // simulate FS operations around staging a volume on a node - stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d\\", r1.Intn(100), r1.Intn(100)), t) + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", r1.Intn(100), r1.Intn(100)), t) mkdirReq := &v1beta2.MkdirRequest{ Path: stagepath, Context: v1beta2.PathContext_PLUGIN, @@ -50,16 +51,23 @@ func TestFilesystemAPIGroup(t *testing.T) { assert.True(t, exists, err) // simulate operations around publishing a volume to a pod - podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d\\", r1.Intn(100)), t) + podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d", r1.Intn(100)), t) mkdirReq = &v1beta2.MkdirRequest{ Path: podpath, Context: v1beta2.PathContext_POD, } _, err = client.Mkdir(context.Background(), mkdirReq) require.NoError(t, err) + + exists, err = pathExists(podpath) + assert.True(t, exists, err) + + sourcePath := stagepath + targetPath := filepath.Join(podpath, "rootvol") + // source <- target linkReq := &v1beta2.LinkPathRequest{ - TargetPath: stagepath, - SourcePath: podpath + "\\rootvol", + SourcePath: sourcePath, + TargetPath: targetPath, } _, err = client.LinkPath(context.Background(), linkReq) require.NoError(t, err) diff --git a/integrationtests/utils.go b/integrationtests/utils.go index 1ff5bc24..c4593756 100644 --- a/integrationtests/utils.go +++ b/integrationtests/utils.go @@ -132,7 +132,7 @@ func getWorkDirPath(dir string, t *testing.T) string { if err != nil { t.Fatalf("failed to get working directory: %s", err) } - return filepath.Join(path, path, dir) + return filepath.Join(path, "testdir", dir) } // returns true if CSI_PROXY_GH_ACTIONS is set to "TRUE" diff --git a/internal/server/filesystem/server_test.go b/internal/server/filesystem/server_test.go index 8fe4aebd..74005486 100644 --- a/internal/server/filesystem/server_test.go +++ b/internal/server/filesystem/server_test.go @@ -5,11 +5,14 @@ import ( "testing" "github.com/kubernetes-csi/csi-proxy/client/apiversion" + "github.com/kubernetes-csi/csi-proxy/internal/os/filesystem" "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal" ) type fakeFileSystemAPI struct{} +var _ filesystem.API = &fakeFileSystemAPI{} + func (fakeFileSystemAPI) PathExists(path string) (bool, error) { return true, nil } @@ -137,12 +140,12 @@ func TestMkdirWindows(t *testing.T) { Path: tc.path, Context: tc.pathCtx, } - mkdirResponse, _ := srv.Mkdir(context.TODO(), req, tc.version) - if tc.expectError && mkdirResponse.Error == "" { + _, err := srv.Mkdir(context.TODO(), req, tc.version) + if tc.expectError && err == nil { t.Errorf("Expected error but Mkdir returned a nil error") } - if !tc.expectError && mkdirResponse.Error != "" { - t.Errorf("Expected no errors but Mkdir returned error: %s", mkdirResponse.Error) + if !tc.expectError && err != nil { + t.Errorf("Expected no errors but Mkdir returned error: %v", err) } } } @@ -256,12 +259,12 @@ func TestRmdirWindows(t *testing.T) { Context: tc.pathCtx, Force: tc.force, } - rmdirResponse, _ := srv.Rmdir(context.TODO(), req, tc.version) - if tc.expectError && rmdirResponse.Error == "" { + _, err := srv.Rmdir(context.TODO(), req, tc.version) + if tc.expectError && err == nil { t.Errorf("Expected error but Rmdir returned a nil error") } - if !tc.expectError && rmdirResponse.Error != "" { - t.Errorf("Expected no errors but Rmdir returned error: %s", rmdirResponse.Error) + if !tc.expectError && err != nil { + t.Errorf("Expected no errors but Rmdir returned error: %v", err) } } } From a342c456737cc9ed4e8a1ad63f9d9672b8e1f950 Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Fri, 28 May 2021 02:50:47 +0000 Subject: [PATCH 3/4] add filesystem tests for all the api versions --- integrationtests/filesystem_test.go | 152 +---------------- integrationtests/filesystem_v1alpha1_test.go | 154 ++++++++++++++++++ integrationtests/filesystem_v1beta1_test.go | 154 ++++++++++++++++++ integrationtests/filesystem_v1beta2_test.go | 154 ++++++++++++++++++ .../filesystem/v1alpha1/client_generated.go | 86 ++++++++++ .../filesystem/v1beta1/client_generated.go | 86 ++++++++++ vendor/modules.txt | 2 + 7 files changed, 643 insertions(+), 145 deletions(-) create mode 100644 integrationtests/filesystem_v1alpha1_test.go create mode 100644 integrationtests/filesystem_v1beta1_test.go create mode 100644 integrationtests/filesystem_v1beta2_test.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1alpha1/client_generated.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go diff --git a/integrationtests/filesystem_test.go b/integrationtests/filesystem_test.go index d577bbad..17869fa7 100644 --- a/integrationtests/filesystem_test.go +++ b/integrationtests/filesystem_test.go @@ -1,19 +1,8 @@ package integrationtests import ( - "context" - "fmt" - "math/rand" "os" - "path/filepath" "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2" - v1beta2client "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2" ) func pathExists(path string) (bool, error) { @@ -28,140 +17,13 @@ func pathExists(path string) (bool, error) { } func TestFilesystemAPIGroup(t *testing.T) { - t.Run("PathExists positive", func(t *testing.T) { - skipTestOnCondition(t, isRunningOnGhActions()) - - client, err := v1beta2client.NewClient() - require.Nil(t, err) - defer client.Close() - - s1 := rand.NewSource(time.Now().UnixNano()) - r1 := rand.New(s1) - - // simulate FS operations around staging a volume on a node - stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", r1.Intn(100), r1.Intn(100)), t) - mkdirReq := &v1beta2.MkdirRequest{ - Path: stagepath, - Context: v1beta2.PathContext_PLUGIN, - } - _, err = client.Mkdir(context.Background(), mkdirReq) - require.NoError(t, err) - - exists, err := pathExists(stagepath) - assert.True(t, exists, err) - - // simulate operations around publishing a volume to a pod - podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d", r1.Intn(100)), t) - mkdirReq = &v1beta2.MkdirRequest{ - Path: podpath, - Context: v1beta2.PathContext_POD, - } - _, err = client.Mkdir(context.Background(), mkdirReq) - require.NoError(t, err) - - exists, err = pathExists(podpath) - assert.True(t, exists, err) - - sourcePath := stagepath - targetPath := filepath.Join(podpath, "rootvol") - // source <- target - linkReq := &v1beta2.LinkPathRequest{ - SourcePath: sourcePath, - TargetPath: targetPath, - } - _, err = client.LinkPath(context.Background(), linkReq) - require.NoError(t, err) - - exists, err = pathExists(podpath + "\\rootvol") - assert.True(t, exists, err) - - // cleanup pvpath - rmdirReq := &v1beta2.RmdirRequest{ - Path: podpath, - Context: v1beta2.PathContext_POD, - Force: true, - } - _, err = client.Rmdir(context.Background(), rmdirReq) - require.NoError(t, err) - - exists, err = pathExists(podpath) - assert.False(t, exists, err) - - // cleanup plugin path - rmdirReq = &v1beta2.RmdirRequest{ - Path: stagepath, - Context: v1beta2.PathContext_PLUGIN, - Force: true, - } - _, err = client.Rmdir(context.Background(), rmdirReq) - require.NoError(t, err) - - exists, err = pathExists(stagepath) - assert.False(t, exists, err) + t.Run("v1beta2FilesystemTests", func(t *testing.T) { + v1beta2FilesystemTests(t) }) - t.Run("IsMount", func(t *testing.T) { - client, err := v1beta2client.NewClient() - require.Nil(t, err) - defer client.Close() - - s1 := rand.NewSource(time.Now().UnixNano()) - r1 := rand.New(s1) - rand1 := r1.Intn(100) - rand2 := r1.Intn(100) - - testDir := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io", rand1), t) - err = os.MkdirAll(testDir, os.ModeDir) - require.Nil(t, err) - defer os.RemoveAll(testDir) - - // 1. Check the isMount on a path which does not exist. Failure scenario. - stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", rand1, rand2), t) - isMountRequest := &v1beta2.IsMountPointRequest{ - Path: stagepath, - } - isMountResponse, err := client.IsMountPoint(context.Background(), isMountRequest) - require.NotNil(t, err) - - // 2. Create the directory. This time its not a mount point. Failure scenario. - err = os.Mkdir(stagepath, os.ModeDir) - require.Nil(t, err) - defer os.Remove(stagepath) - isMountRequest = &v1beta2.IsMountPointRequest{ - Path: stagepath, - } - isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) - require.Nil(t, err) - require.Equal(t, isMountResponse.IsMountPoint, false) - - err = os.Remove(stagepath) - require.Nil(t, err) - targetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt", rand1, rand2), t) - lnTargetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt-ln", rand1, rand2), t) - - // 3. Create soft link to the directory and make sure target exists. Success scenario. - err = os.Mkdir(targetStagePath, os.ModeDir) - require.Nil(t, err) - defer os.Remove(targetStagePath) - // Create a sym link - err = os.Symlink(targetStagePath, lnTargetStagePath) - require.Nil(t, err) - defer os.Remove(lnTargetStagePath) - - isMountRequest = &v1beta2.IsMountPointRequest{ - Path: lnTargetStagePath, - } - isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) - require.Nil(t, err) - require.Equal(t, isMountResponse.IsMountPoint, true) - - // 4. Remove the path. Failure scenario. - err = os.Remove(targetStagePath) - require.Nil(t, err) - isMountRequest = &v1beta2.IsMountPointRequest{ - Path: lnTargetStagePath, - } - isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) - require.Nil(t, err) - require.Equal(t, isMountResponse.IsMountPoint, false) + t.Run("v1beta1FilesystemTests", func(t *testing.T) { + v1beta1FilesystemTests(t) + }) + t.Run("v1alpha1FilesystemTests", func(t *testing.T) { + v1alpha1FilesystemTests(t) }) } diff --git a/integrationtests/filesystem_v1alpha1_test.go b/integrationtests/filesystem_v1alpha1_test.go new file mode 100644 index 00000000..06731036 --- /dev/null +++ b/integrationtests/filesystem_v1alpha1_test.go @@ -0,0 +1,154 @@ +package integrationtests + +import ( + "context" + "fmt" + "math/rand" + "os" + "path/filepath" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1alpha1" + v1alpha1client "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1alpha1" +) + +func v1alpha1FilesystemTests(t *testing.T) { + t.Run("PathExists positive", func(t *testing.T) { + client, err := v1alpha1client.NewClient() + require.Nil(t, err) + defer client.Close() + + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + + // simulate FS operations around staging a volume on a node + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", r1.Intn(100), r1.Intn(100)), t) + mkdirReq := &v1alpha1.MkdirRequest{ + Path: stagepath, + Context: v1alpha1.PathContext_PLUGIN, + } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) + + exists, err := pathExists(stagepath) + assert.True(t, exists, err) + + // simulate operations around publishing a volume to a pod + podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d", r1.Intn(100)), t) + mkdirReq = &v1alpha1.MkdirRequest{ + Path: podpath, + Context: v1alpha1.PathContext_POD, + } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) + + exists, err = pathExists(podpath) + assert.True(t, exists, err) + + sourcePath := stagepath + targetPath := filepath.Join(podpath, "rootvol") + // source <- target + linkReq := &v1alpha1.LinkPathRequest{ + SourcePath: sourcePath, + TargetPath: targetPath, + } + _, err = client.LinkPath(context.Background(), linkReq) + require.NoError(t, err) + + exists, err = pathExists(podpath + "\\rootvol") + assert.True(t, exists, err) + + // cleanup pvpath + rmdirReq := &v1alpha1.RmdirRequest{ + Path: podpath, + Context: v1alpha1.PathContext_POD, + Force: true, + } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) + + exists, err = pathExists(podpath) + assert.False(t, exists, err) + + // cleanup plugin path + rmdirReq = &v1alpha1.RmdirRequest{ + Path: stagepath, + Context: v1alpha1.PathContext_PLUGIN, + Force: true, + } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) + + exists, err = pathExists(stagepath) + assert.False(t, exists, err) + }) + t.Run("IsMount", func(t *testing.T) { + client, err := v1alpha1client.NewClient() + require.Nil(t, err) + defer client.Close() + + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + rand1 := r1.Intn(100) + rand2 := r1.Intn(100) + + testDir := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io", rand1), t) + err = os.MkdirAll(testDir, os.ModeDir) + require.Nil(t, err) + defer os.RemoveAll(testDir) + + // 1. Check the isMount on a path which does not exist. Failure scenario. + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", rand1, rand2), t) + isMountRequest := &v1alpha1.IsMountPointRequest{ + Path: stagepath, + } + isMountResponse, err := client.IsMountPoint(context.Background(), isMountRequest) + require.NotNil(t, err) + + // 2. Create the directory. This time its not a mount point. Failure scenario. + err = os.Mkdir(stagepath, os.ModeDir) + require.Nil(t, err) + defer os.Remove(stagepath) + isMountRequest = &v1alpha1.IsMountPointRequest{ + Path: stagepath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, false) + + err = os.Remove(stagepath) + require.Nil(t, err) + targetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt", rand1, rand2), t) + lnTargetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt-ln", rand1, rand2), t) + + // 3. Create soft link to the directory and make sure target exists. Success scenario. + err = os.Mkdir(targetStagePath, os.ModeDir) + require.Nil(t, err) + defer os.Remove(targetStagePath) + // Create a sym link + err = os.Symlink(targetStagePath, lnTargetStagePath) + require.Nil(t, err) + defer os.Remove(lnTargetStagePath) + + isMountRequest = &v1alpha1.IsMountPointRequest{ + Path: lnTargetStagePath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, true) + + // 4. Remove the path. Failure scenario. + err = os.Remove(targetStagePath) + require.Nil(t, err) + isMountRequest = &v1alpha1.IsMountPointRequest{ + Path: lnTargetStagePath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, false) + }) +} diff --git a/integrationtests/filesystem_v1beta1_test.go b/integrationtests/filesystem_v1beta1_test.go new file mode 100644 index 00000000..118bf6d6 --- /dev/null +++ b/integrationtests/filesystem_v1beta1_test.go @@ -0,0 +1,154 @@ +package integrationtests + +import ( + "context" + "fmt" + "math/rand" + "os" + "path/filepath" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1" + v1beta1client "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1" +) + +func v1beta1FilesystemTests(t *testing.T) { + t.Run("PathExists positive", func(t *testing.T) { + client, err := v1beta1client.NewClient() + require.Nil(t, err) + defer client.Close() + + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + + // simulate FS operations around staging a volume on a node + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", r1.Intn(100), r1.Intn(100)), t) + mkdirReq := &v1beta1.MkdirRequest{ + Path: stagepath, + Context: v1beta1.PathContext_PLUGIN, + } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) + + exists, err := pathExists(stagepath) + assert.True(t, exists, err) + + // simulate operations around publishing a volume to a pod + podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d", r1.Intn(100)), t) + mkdirReq = &v1beta1.MkdirRequest{ + Path: podpath, + Context: v1beta1.PathContext_POD, + } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) + + exists, err = pathExists(podpath) + assert.True(t, exists, err) + + sourcePath := stagepath + targetPath := filepath.Join(podpath, "rootvol") + // source <- target + linkReq := &v1beta1.LinkPathRequest{ + SourcePath: sourcePath, + TargetPath: targetPath, + } + _, err = client.LinkPath(context.Background(), linkReq) + require.NoError(t, err) + + exists, err = pathExists(podpath + "\\rootvol") + assert.True(t, exists, err) + + // cleanup pvpath + rmdirReq := &v1beta1.RmdirRequest{ + Path: podpath, + Context: v1beta1.PathContext_POD, + Force: true, + } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) + + exists, err = pathExists(podpath) + assert.False(t, exists, err) + + // cleanup plugin path + rmdirReq = &v1beta1.RmdirRequest{ + Path: stagepath, + Context: v1beta1.PathContext_PLUGIN, + Force: true, + } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) + + exists, err = pathExists(stagepath) + assert.False(t, exists, err) + }) + t.Run("IsMount", func(t *testing.T) { + client, err := v1beta1client.NewClient() + require.Nil(t, err) + defer client.Close() + + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + rand1 := r1.Intn(100) + rand2 := r1.Intn(100) + + testDir := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io", rand1), t) + err = os.MkdirAll(testDir, os.ModeDir) + require.Nil(t, err) + defer os.RemoveAll(testDir) + + // 1. Check the isMount on a path which does not exist. Failure scenario. + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", rand1, rand2), t) + isMountRequest := &v1beta1.IsMountPointRequest{ + Path: stagepath, + } + isMountResponse, err := client.IsMountPoint(context.Background(), isMountRequest) + require.NotNil(t, err) + + // 2. Create the directory. This time its not a mount point. Failure scenario. + err = os.Mkdir(stagepath, os.ModeDir) + require.Nil(t, err) + defer os.Remove(stagepath) + isMountRequest = &v1beta1.IsMountPointRequest{ + Path: stagepath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, false) + + err = os.Remove(stagepath) + require.Nil(t, err) + targetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt", rand1, rand2), t) + lnTargetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt-ln", rand1, rand2), t) + + // 3. Create soft link to the directory and make sure target exists. Success scenario. + err = os.Mkdir(targetStagePath, os.ModeDir) + require.Nil(t, err) + defer os.Remove(targetStagePath) + // Create a sym link + err = os.Symlink(targetStagePath, lnTargetStagePath) + require.Nil(t, err) + defer os.Remove(lnTargetStagePath) + + isMountRequest = &v1beta1.IsMountPointRequest{ + Path: lnTargetStagePath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, true) + + // 4. Remove the path. Failure scenario. + err = os.Remove(targetStagePath) + require.Nil(t, err) + isMountRequest = &v1beta1.IsMountPointRequest{ + Path: lnTargetStagePath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, false) + }) +} diff --git a/integrationtests/filesystem_v1beta2_test.go b/integrationtests/filesystem_v1beta2_test.go new file mode 100644 index 00000000..3f824940 --- /dev/null +++ b/integrationtests/filesystem_v1beta2_test.go @@ -0,0 +1,154 @@ +package integrationtests + +import ( + "context" + "fmt" + "math/rand" + "os" + "path/filepath" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2" + v1beta2client "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2" +) + +func v1beta2FilesystemTests(t *testing.T) { + t.Run("PathExists positive", func(t *testing.T) { + client, err := v1beta2client.NewClient() + require.Nil(t, err) + defer client.Close() + + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + + // simulate FS operations around staging a volume on a node + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", r1.Intn(100), r1.Intn(100)), t) + mkdirReq := &v1beta2.MkdirRequest{ + Path: stagepath, + Context: v1beta2.PathContext_PLUGIN, + } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) + + exists, err := pathExists(stagepath) + assert.True(t, exists, err) + + // simulate operations around publishing a volume to a pod + podpath := getWorkDirPath(fmt.Sprintf("test-pod-id\\volumes\\kubernetes.io~csi\\pvc-test%d", r1.Intn(100)), t) + mkdirReq = &v1beta2.MkdirRequest{ + Path: podpath, + Context: v1beta2.PathContext_POD, + } + _, err = client.Mkdir(context.Background(), mkdirReq) + require.NoError(t, err) + + exists, err = pathExists(podpath) + assert.True(t, exists, err) + + sourcePath := stagepath + targetPath := filepath.Join(podpath, "rootvol") + // source <- target + linkReq := &v1beta2.LinkPathRequest{ + SourcePath: sourcePath, + TargetPath: targetPath, + } + _, err = client.LinkPath(context.Background(), linkReq) + require.NoError(t, err) + + exists, err = pathExists(podpath + "\\rootvol") + assert.True(t, exists, err) + + // cleanup pvpath + rmdirReq := &v1beta2.RmdirRequest{ + Path: podpath, + Context: v1beta2.PathContext_POD, + Force: true, + } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) + + exists, err = pathExists(podpath) + assert.False(t, exists, err) + + // cleanup plugin path + rmdirReq = &v1beta2.RmdirRequest{ + Path: stagepath, + Context: v1beta2.PathContext_PLUGIN, + Force: true, + } + _, err = client.Rmdir(context.Background(), rmdirReq) + require.NoError(t, err) + + exists, err = pathExists(stagepath) + assert.False(t, exists, err) + }) + t.Run("IsMount", func(t *testing.T) { + client, err := v1beta2client.NewClient() + require.Nil(t, err) + defer client.Close() + + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + rand1 := r1.Intn(100) + rand2 := r1.Intn(100) + + testDir := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io", rand1), t) + err = os.MkdirAll(testDir, os.ModeDir) + require.Nil(t, err) + defer os.RemoveAll(testDir) + + // 1. Check the isMount on a path which does not exist. Failure scenario. + stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", rand1, rand2), t) + isMountRequest := &v1beta2.IsMountPointRequest{ + Path: stagepath, + } + isMountResponse, err := client.IsMountPoint(context.Background(), isMountRequest) + require.NotNil(t, err) + + // 2. Create the directory. This time its not a mount point. Failure scenario. + err = os.Mkdir(stagepath, os.ModeDir) + require.Nil(t, err) + defer os.Remove(stagepath) + isMountRequest = &v1beta2.IsMountPointRequest{ + Path: stagepath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, false) + + err = os.Remove(stagepath) + require.Nil(t, err) + targetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt", rand1, rand2), t) + lnTargetStagePath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d-tgt-ln", rand1, rand2), t) + + // 3. Create soft link to the directory and make sure target exists. Success scenario. + err = os.Mkdir(targetStagePath, os.ModeDir) + require.Nil(t, err) + defer os.Remove(targetStagePath) + // Create a sym link + err = os.Symlink(targetStagePath, lnTargetStagePath) + require.Nil(t, err) + defer os.Remove(lnTargetStagePath) + + isMountRequest = &v1beta2.IsMountPointRequest{ + Path: lnTargetStagePath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, true) + + // 4. Remove the path. Failure scenario. + err = os.Remove(targetStagePath) + require.Nil(t, err) + isMountRequest = &v1beta2.IsMountPointRequest{ + Path: lnTargetStagePath, + } + isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + require.Nil(t, err) + require.Equal(t, isMountResponse.IsMountPoint, false) + }) +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1alpha1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1alpha1/client_generated.go new file mode 100644 index 00000000..04849011 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1alpha1/client_generated.go @@ -0,0 +1,86 @@ +// Code generated by csi-proxy-api-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "net" + + "github.com/Microsoft/go-winio" + "github.com/kubernetes-csi/csi-proxy/client" + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1alpha1" + "github.com/kubernetes-csi/csi-proxy/client/apiversion" + "google.golang.org/grpc" +) + +// GroupName is the group name of this API. +const GroupName = "filesystem" + +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") + +type Client struct { + client v1alpha1.FilesystemClient + connection *grpc.ClientConn +} + +// NewClient returns a client to make calls to the filesystem API group version v1alpha1. +// It's the caller's responsibility to Close the client when done. +func NewClient() (*Client, error) { + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } + + connection, err := grpc.Dial(pipePath, + grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { + return winio.DialPipeContext(context, s) + }), + grpc.WithInsecure()) + if err != nil { + return nil, err + } + + client := v1alpha1.NewFilesystemClient(connection) + return &Client{ + client: client, + connection: connection, + }, nil +} + +// Close closes the client. It must be called before the client gets GC-ed. +func (w *Client) Close() error { + return w.connection.Close() +} + +// ensures we implement all the required methods +var _ v1alpha1.FilesystemClient = &Client{} + +func (w *Client) IsMountPoint(context context.Context, request *v1alpha1.IsMountPointRequest, opts ...grpc.CallOption) (*v1alpha1.IsMountPointResponse, error) { + return w.client.IsMountPoint(context, request, opts...) +} + +func (w *Client) LinkPath(context context.Context, request *v1alpha1.LinkPathRequest, opts ...grpc.CallOption) (*v1alpha1.LinkPathResponse, error) { + return w.client.LinkPath(context, request, opts...) +} + +func (w *Client) Mkdir(context context.Context, request *v1alpha1.MkdirRequest, opts ...grpc.CallOption) (*v1alpha1.MkdirResponse, error) { + return w.client.Mkdir(context, request, opts...) +} + +func (w *Client) PathExists(context context.Context, request *v1alpha1.PathExistsRequest, opts ...grpc.CallOption) (*v1alpha1.PathExistsResponse, error) { + return w.client.PathExists(context, request, opts...) +} + +func (w *Client) Rmdir(context context.Context, request *v1alpha1.RmdirRequest, opts ...grpc.CallOption) (*v1alpha1.RmdirResponse, error) { + return w.client.Rmdir(context, request, opts...) +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go new file mode 100644 index 00000000..b7584725 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go @@ -0,0 +1,86 @@ +// Code generated by csi-proxy-api-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "net" + + "github.com/Microsoft/go-winio" + "github.com/kubernetes-csi/csi-proxy/client" + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1" + "github.com/kubernetes-csi/csi-proxy/client/apiversion" + "google.golang.org/grpc" +) + +// GroupName is the group name of this API. +const GroupName = "filesystem" + +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1beta1") + +type Client struct { + client v1beta1.FilesystemClient + connection *grpc.ClientConn +} + +// NewClient returns a client to make calls to the filesystem API group version v1beta1. +// It's the caller's responsibility to Close the client when done. +func NewClient() (*Client, error) { + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } + + connection, err := grpc.Dial(pipePath, + grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { + return winio.DialPipeContext(context, s) + }), + grpc.WithInsecure()) + if err != nil { + return nil, err + } + + client := v1beta1.NewFilesystemClient(connection) + return &Client{ + client: client, + connection: connection, + }, nil +} + +// Close closes the client. It must be called before the client gets GC-ed. +func (w *Client) Close() error { + return w.connection.Close() +} + +// ensures we implement all the required methods +var _ v1beta1.FilesystemClient = &Client{} + +func (w *Client) IsMountPoint(context context.Context, request *v1beta1.IsMountPointRequest, opts ...grpc.CallOption) (*v1beta1.IsMountPointResponse, error) { + return w.client.IsMountPoint(context, request, opts...) +} + +func (w *Client) LinkPath(context context.Context, request *v1beta1.LinkPathRequest, opts ...grpc.CallOption) (*v1beta1.LinkPathResponse, error) { + return w.client.LinkPath(context, request, opts...) +} + +func (w *Client) Mkdir(context context.Context, request *v1beta1.MkdirRequest, opts ...grpc.CallOption) (*v1beta1.MkdirResponse, error) { + return w.client.Mkdir(context, request, opts...) +} + +func (w *Client) PathExists(context context.Context, request *v1beta1.PathExistsRequest, opts ...grpc.CallOption) (*v1beta1.PathExistsResponse, error) { + return w.client.PathExists(context, request, opts...) +} + +func (w *Client) Rmdir(context context.Context, request *v1beta1.RmdirRequest, opts ...grpc.CallOption) (*v1beta1.RmdirResponse, error) { + return w.client.Rmdir(context, request, opts...) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index e3893d0a..aea7ee50 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -48,6 +48,8 @@ github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1alpha1 github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta1 github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2 github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta3 +github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1alpha1 +github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1 github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2 github.com/kubernetes-csi/csi-proxy/client/groups/iscsi/v1alpha2 github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1beta2 From 484c217f3de3c42935cb3f2552fdf9d8508a7339 Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Wed, 2 Jun 2021 21:04:35 +0000 Subject: [PATCH 4/4] Rename LinkPath to CreateSymlink and IsMountPoint to IsSymlink --- client/api/filesystem/v1beta2/api.pb.go | 287 +++++++++--------- client/api/filesystem/v1beta2/api.proto | 33 +- .../filesystem/v1beta2/client_generated.go | 8 +- integrationtests/filesystem_v1beta2_test.go | 26 +- internal/os/filesystem/api.go | 14 +- internal/server/filesystem/internal/types.go | 47 +++ .../filesystem/internal/types_generated.go | 2 + .../internal/v1beta2/conversion_generated.go | 80 ++--- .../internal/v1beta2/server_generated.go | 24 +- internal/server/filesystem/server.go | 43 ++- internal/server/filesystem/server_test.go | 4 +- internal/server/smb/server_test.go | 7 +- .../client/api/filesystem/v1beta2/api.pb.go | 287 +++++++++--------- .../client/api/filesystem/v1beta2/api.proto | 33 +- .../filesystem/v1beta2/client_generated.go | 8 +- 15 files changed, 496 insertions(+), 407 deletions(-) diff --git a/client/api/filesystem/v1beta2/api.pb.go b/client/api/filesystem/v1beta2/api.pb.go index c2b6f5b5..0219d023 100644 --- a/client/api/filesystem/v1beta2/api.pb.go +++ b/client/api/filesystem/v1beta2/api.pb.go @@ -417,12 +417,12 @@ func (*RmdirResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{5} } -type LinkPathRequest struct { +type CreateSymlinkRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The path where the symlink is created in the host's filesystem. + // The path of the existing directory to be linked. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -437,7 +437,7 @@ type LinkPathRequest struct { // source_path cannot already exist in the host filesystem. // Maximum path length will be capped to 260 characters. SourcePath string `protobuf:"bytes,1,opt,name=source_path,json=sourcePath,proto3" json:"source_path,omitempty"` - // Target path in the host's filesystem used for the symlink creation. + // Target path is the location of the new directory entry to be created in the host's filesystem. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -455,8 +455,8 @@ type LinkPathRequest struct { TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` } -func (x *LinkPathRequest) Reset() { - *x = LinkPathRequest{} +func (x *CreateSymlinkRequest) Reset() { + *x = CreateSymlinkRequest{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -464,13 +464,13 @@ func (x *LinkPathRequest) Reset() { } } -func (x *LinkPathRequest) String() string { +func (x *CreateSymlinkRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*LinkPathRequest) ProtoMessage() {} +func (*CreateSymlinkRequest) ProtoMessage() {} -func (x *LinkPathRequest) ProtoReflect() protoreflect.Message { +func (x *CreateSymlinkRequest) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -482,33 +482,33 @@ func (x *LinkPathRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LinkPathRequest.ProtoReflect.Descriptor instead. -func (*LinkPathRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateSymlinkRequest.ProtoReflect.Descriptor instead. +func (*CreateSymlinkRequest) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{6} } -func (x *LinkPathRequest) GetSourcePath() string { +func (x *CreateSymlinkRequest) GetSourcePath() string { if x != nil { return x.SourcePath } return "" } -func (x *LinkPathRequest) GetTargetPath() string { +func (x *CreateSymlinkRequest) GetTargetPath() string { if x != nil { return x.TargetPath } return "" } -type LinkPathResponse struct { +type CreateSymlinkResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *LinkPathResponse) Reset() { - *x = LinkPathResponse{} +func (x *CreateSymlinkResponse) Reset() { + *x = CreateSymlinkResponse{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -516,13 +516,13 @@ func (x *LinkPathResponse) Reset() { } } -func (x *LinkPathResponse) String() string { +func (x *CreateSymlinkResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*LinkPathResponse) ProtoMessage() {} +func (*CreateSymlinkResponse) ProtoMessage() {} -func (x *LinkPathResponse) ProtoReflect() protoreflect.Message { +func (x *CreateSymlinkResponse) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -534,22 +534,22 @@ func (x *LinkPathResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LinkPathResponse.ProtoReflect.Descriptor instead. -func (*LinkPathResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateSymlinkResponse.ProtoReflect.Descriptor instead. +func (*CreateSymlinkResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{7} } -type IsMountPointRequest struct { +type IsSymlinkRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The path whose existence we want to check in the host's filesystem + // The path whose existence as a symlink we want to check in the host's filesystem. Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` } -func (x *IsMountPointRequest) Reset() { - *x = IsMountPointRequest{} +func (x *IsSymlinkRequest) Reset() { + *x = IsSymlinkRequest{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -557,13 +557,13 @@ func (x *IsMountPointRequest) Reset() { } } -func (x *IsMountPointRequest) String() string { +func (x *IsSymlinkRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*IsMountPointRequest) ProtoMessage() {} +func (*IsSymlinkRequest) ProtoMessage() {} -func (x *IsMountPointRequest) ProtoReflect() protoreflect.Message { +func (x *IsSymlinkRequest) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -575,29 +575,29 @@ func (x *IsMountPointRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use IsMountPointRequest.ProtoReflect.Descriptor instead. -func (*IsMountPointRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use IsSymlinkRequest.ProtoReflect.Descriptor instead. +func (*IsSymlinkRequest) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{8} } -func (x *IsMountPointRequest) GetPath() string { +func (x *IsSymlinkRequest) GetPath() string { if x != nil { return x.Path } return "" } -type IsMountPointResponse struct { +type IsSymlinkResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - IsMountPoint bool `protobuf:"varint,1,opt,name=is_mount_point,json=isMountPoint,proto3" json:"is_mount_point,omitempty"` + // Indicates whether the path in IsSymlinkRequest is a symlink. + IsSymlink bool `protobuf:"varint,1,opt,name=is_symlink,json=isSymlink,proto3" json:"is_symlink,omitempty"` } -func (x *IsMountPointResponse) Reset() { - *x = IsMountPointResponse{} +func (x *IsSymlinkResponse) Reset() { + *x = IsSymlinkResponse{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -605,13 +605,13 @@ func (x *IsMountPointResponse) Reset() { } } -func (x *IsMountPointResponse) String() string { +func (x *IsSymlinkResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*IsMountPointResponse) ProtoMessage() {} +func (*IsSymlinkResponse) ProtoMessage() {} -func (x *IsMountPointResponse) ProtoReflect() protoreflect.Message { +func (x *IsSymlinkResponse) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -623,14 +623,14 @@ func (x *IsMountPointResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use IsMountPointResponse.ProtoReflect.Descriptor instead. -func (*IsMountPointResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use IsSymlinkResponse.ProtoReflect.Descriptor instead. +func (*IsSymlinkResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{9} } -func (x *IsMountPointResponse) GetIsMountPoint() bool { +func (x *IsSymlinkResponse) GetIsSymlink() bool { if x != nil { - return x.IsMountPoint + return x.IsSymlink } return false } @@ -665,49 +665,50 @@ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_p 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, - 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x0a, - 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, - 0x74, 0x68, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x13, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, - 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x22, 0x3c, 0x0a, 0x14, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2a, - 0x22, 0x0a, 0x0b, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, - 0x0a, 0x06, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, - 0x44, 0x10, 0x01, 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, - 0x12, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, - 0x6b, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, - 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, - 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x41, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, - 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, - 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, - 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, - 0x73, 0x69, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x0a, + 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x26, 0x0a, 0x10, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x32, 0x0a, 0x11, 0x49, 0x73, 0x53, 0x79, + 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x2a, 0x22, 0x0a, 0x0b, + 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x50, + 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, 0x44, 0x10, 0x01, + 0x32, 0xe1, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, + 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1a, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, 0x6b, 0x64, 0x69, + 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, + 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0d, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1d, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, + 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, + 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, + 0x0a, 0x09, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x19, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, + 0x2e, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, + 0x69, 0x2f, 0x63, 0x73, 0x69, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -725,17 +726,17 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_goTypes = []interface{}{ - (PathContext)(0), // 0: v1beta2.PathContext - (*PathExistsRequest)(nil), // 1: v1beta2.PathExistsRequest - (*PathExistsResponse)(nil), // 2: v1beta2.PathExistsResponse - (*MkdirRequest)(nil), // 3: v1beta2.MkdirRequest - (*MkdirResponse)(nil), // 4: v1beta2.MkdirResponse - (*RmdirRequest)(nil), // 5: v1beta2.RmdirRequest - (*RmdirResponse)(nil), // 6: v1beta2.RmdirResponse - (*LinkPathRequest)(nil), // 7: v1beta2.LinkPathRequest - (*LinkPathResponse)(nil), // 8: v1beta2.LinkPathResponse - (*IsMountPointRequest)(nil), // 9: v1beta2.IsMountPointRequest - (*IsMountPointResponse)(nil), // 10: v1beta2.IsMountPointResponse + (PathContext)(0), // 0: v1beta2.PathContext + (*PathExistsRequest)(nil), // 1: v1beta2.PathExistsRequest + (*PathExistsResponse)(nil), // 2: v1beta2.PathExistsResponse + (*MkdirRequest)(nil), // 3: v1beta2.MkdirRequest + (*MkdirResponse)(nil), // 4: v1beta2.MkdirResponse + (*RmdirRequest)(nil), // 5: v1beta2.RmdirRequest + (*RmdirResponse)(nil), // 6: v1beta2.RmdirResponse + (*CreateSymlinkRequest)(nil), // 7: v1beta2.CreateSymlinkRequest + (*CreateSymlinkResponse)(nil), // 8: v1beta2.CreateSymlinkResponse + (*IsSymlinkRequest)(nil), // 9: v1beta2.IsSymlinkRequest + (*IsSymlinkResponse)(nil), // 10: v1beta2.IsSymlinkResponse } var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_depIdxs = []int32{ 0, // 0: v1beta2.PathExistsRequest.context:type_name -> v1beta2.PathContext @@ -744,13 +745,13 @@ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_p 1, // 3: v1beta2.Filesystem.PathExists:input_type -> v1beta2.PathExistsRequest 3, // 4: v1beta2.Filesystem.Mkdir:input_type -> v1beta2.MkdirRequest 5, // 5: v1beta2.Filesystem.Rmdir:input_type -> v1beta2.RmdirRequest - 7, // 6: v1beta2.Filesystem.LinkPath:input_type -> v1beta2.LinkPathRequest - 9, // 7: v1beta2.Filesystem.IsMountPoint:input_type -> v1beta2.IsMountPointRequest + 7, // 6: v1beta2.Filesystem.CreateSymlink:input_type -> v1beta2.CreateSymlinkRequest + 9, // 7: v1beta2.Filesystem.IsSymlink:input_type -> v1beta2.IsSymlinkRequest 2, // 8: v1beta2.Filesystem.PathExists:output_type -> v1beta2.PathExistsResponse 4, // 9: v1beta2.Filesystem.Mkdir:output_type -> v1beta2.MkdirResponse 6, // 10: v1beta2.Filesystem.Rmdir:output_type -> v1beta2.RmdirResponse - 8, // 11: v1beta2.Filesystem.LinkPath:output_type -> v1beta2.LinkPathResponse - 10, // 12: v1beta2.Filesystem.IsMountPoint:output_type -> v1beta2.IsMountPointResponse + 8, // 11: v1beta2.Filesystem.CreateSymlink:output_type -> v1beta2.CreateSymlinkResponse + 10, // 12: v1beta2.Filesystem.IsSymlink:output_type -> v1beta2.IsSymlinkResponse 8, // [8:13] is the sub-list for method output_type 3, // [3:8] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -837,7 +838,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinkPathRequest); i { + switch v := v.(*CreateSymlinkRequest); i { case 0: return &v.state case 1: @@ -849,7 +850,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinkPathResponse); i { + switch v := v.(*CreateSymlinkResponse); i { case 0: return &v.state case 1: @@ -861,7 +862,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsMountPointRequest); i { + switch v := v.(*IsSymlinkRequest); i { case 0: return &v.state case 1: @@ -873,7 +874,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsMountPointResponse); i { + switch v := v.(*IsSymlinkResponse); i { case 0: return &v.state case 1: @@ -920,16 +921,17 @@ const _ = grpc.SupportPackageIsVersion6 type FilesystemClient interface { // PathExists checks if the requested path exists in the host filesystem. PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host filesystem + // Mkdir creates a directory at the requested path in the host filesystem. Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through LinkPath. + // This may be used for unlinking a symlink created through CreateSymlink. Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem. - LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) - // IsMountPoint checks if a given path is a mount point. - IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) + // CreateSymlink creates a symbolic link called target_path that points to source_path + // in the host filesystem (target_path is the name of the symbolic link created, + // source_path is the existing path). + CreateSymlink(ctx context.Context, in *CreateSymlinkRequest, opts ...grpc.CallOption) (*CreateSymlinkResponse, error) + // IsSymlink checks if a given path is a symlink. + IsSymlink(ctx context.Context, in *IsSymlinkRequest, opts ...grpc.CallOption) (*IsSymlinkResponse, error) } type filesystemClient struct { @@ -967,18 +969,18 @@ func (c *filesystemClient) Rmdir(ctx context.Context, in *RmdirRequest, opts ... return out, nil } -func (c *filesystemClient) LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) { - out := new(LinkPathResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/LinkPath", in, out, opts...) +func (c *filesystemClient) CreateSymlink(ctx context.Context, in *CreateSymlinkRequest, opts ...grpc.CallOption) (*CreateSymlinkResponse, error) { + out := new(CreateSymlinkResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/CreateSymlink", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *filesystemClient) IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) { - out := new(IsMountPointResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/IsMountPoint", in, out, opts...) +func (c *filesystemClient) IsSymlink(ctx context.Context, in *IsSymlinkRequest, opts ...grpc.CallOption) (*IsSymlinkResponse, error) { + out := new(IsSymlinkResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/IsSymlink", in, out, opts...) if err != nil { return nil, err } @@ -989,16 +991,17 @@ func (c *filesystemClient) IsMountPoint(ctx context.Context, in *IsMountPointReq type FilesystemServer interface { // PathExists checks if the requested path exists in the host filesystem. PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host filesystem + // Mkdir creates a directory at the requested path in the host filesystem. Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through LinkPath. + // This may be used for unlinking a symlink created through CreateSymlink. Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem. - LinkPath(context.Context, *LinkPathRequest) (*LinkPathResponse, error) - // IsMountPoint checks if a given path is a mount point. - IsMountPoint(context.Context, *IsMountPointRequest) (*IsMountPointResponse, error) + // CreateSymlink creates a symbolic link called target_path that points to source_path + // in the host filesystem (target_path is the name of the symbolic link created, + // source_path is the existing path). + CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error) + // IsSymlink checks if a given path is a symlink. + IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error) } // UnimplementedFilesystemServer can be embedded to have forward compatible implementations. @@ -1014,11 +1017,11 @@ func (*UnimplementedFilesystemServer) Mkdir(context.Context, *MkdirRequest) (*Mk func (*UnimplementedFilesystemServer) Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Rmdir not implemented") } -func (*UnimplementedFilesystemServer) LinkPath(context.Context, *LinkPathRequest) (*LinkPathResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LinkPath not implemented") +func (*UnimplementedFilesystemServer) CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSymlink not implemented") } -func (*UnimplementedFilesystemServer) IsMountPoint(context.Context, *IsMountPointRequest) (*IsMountPointResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsMountPoint not implemented") +func (*UnimplementedFilesystemServer) IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsSymlink not implemented") } func RegisterFilesystemServer(s *grpc.Server, srv FilesystemServer) { @@ -1079,38 +1082,38 @@ func _Filesystem_Rmdir_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Filesystem_LinkPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LinkPathRequest) +func _Filesystem_CreateSymlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSymlinkRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FilesystemServer).LinkPath(ctx, in) + return srv.(FilesystemServer).CreateSymlink(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1beta2.Filesystem/LinkPath", + FullMethod: "/v1beta2.Filesystem/CreateSymlink", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).LinkPath(ctx, req.(*LinkPathRequest)) + return srv.(FilesystemServer).CreateSymlink(ctx, req.(*CreateSymlinkRequest)) } return interceptor(ctx, in, info, handler) } -func _Filesystem_IsMountPoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsMountPointRequest) +func _Filesystem_IsSymlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsSymlinkRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FilesystemServer).IsMountPoint(ctx, in) + return srv.(FilesystemServer).IsSymlink(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1beta2.Filesystem/IsMountPoint", + FullMethod: "/v1beta2.Filesystem/IsSymlink", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).IsMountPoint(ctx, req.(*IsMountPointRequest)) + return srv.(FilesystemServer).IsSymlink(ctx, req.(*IsSymlinkRequest)) } return interceptor(ctx, in, info, handler) } @@ -1132,12 +1135,12 @@ var _Filesystem_serviceDesc = grpc.ServiceDesc{ Handler: _Filesystem_Rmdir_Handler, }, { - MethodName: "LinkPath", - Handler: _Filesystem_LinkPath_Handler, + MethodName: "CreateSymlink", + Handler: _Filesystem_CreateSymlink_Handler, }, { - MethodName: "IsMountPoint", - Handler: _Filesystem_IsMountPoint_Handler, + MethodName: "IsSymlink", + Handler: _Filesystem_IsSymlink_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/client/api/filesystem/v1beta2/api.proto b/client/api/filesystem/v1beta2/api.proto index ec29c5d0..938182e1 100644 --- a/client/api/filesystem/v1beta2/api.proto +++ b/client/api/filesystem/v1beta2/api.proto @@ -8,19 +8,20 @@ service Filesystem { // PathExists checks if the requested path exists in the host filesystem. rpc PathExists(PathExistsRequest) returns (PathExistsResponse) {} - // Mkdir creates a directory at the requested path in the host filesystem + // Mkdir creates a directory at the requested path in the host filesystem. rpc Mkdir(MkdirRequest) returns (MkdirResponse) {} // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through LinkPath. + // This may be used for unlinking a symlink created through CreateSymlink. rpc Rmdir(RmdirRequest) returns (RmdirResponse) {} - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem. - rpc LinkPath(LinkPathRequest) returns (LinkPathResponse) {} + // CreateSymlink creates a symbolic link called target_path that points to source_path + // in the host filesystem (target_path is the name of the symbolic link created, + // source_path is the existing path). + rpc CreateSymlink(CreateSymlinkRequest) returns (CreateSymlinkResponse) {} - // IsMountPoint checks if a given path is a mount point. - rpc IsMountPoint(IsMountPointRequest) returns (IsMountPointResponse) {} + // IsSymlink checks if a given path is a symlink. + rpc IsSymlink(IsSymlinkRequest) returns (IsSymlinkResponse) {} } // Context of the paths used for path prefix validation @@ -111,8 +112,8 @@ message RmdirResponse { // Intentionally empty. } -message LinkPathRequest { - // The path where the symlink is created in the host's filesystem. +message CreateSymlinkRequest { + // The path of the existing directory to be linked. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -128,7 +129,7 @@ message LinkPathRequest { // Maximum path length will be capped to 260 characters. string source_path = 1; - // Target path in the host's filesystem used for the symlink creation. + // Target path is the location of the new directory entry to be created in the host's filesystem. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -146,16 +147,16 @@ message LinkPathRequest { string target_path = 2; } -message LinkPathResponse { +message CreateSymlinkResponse { // Intentionally empty. } -message IsMountPointRequest { - // The path whose existence we want to check in the host's filesystem +message IsSymlinkRequest { + // The path whose existence as a symlink we want to check in the host's filesystem. string path = 1; } -message IsMountPointResponse { - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool is_mount_point = 1; +message IsSymlinkResponse { + // Indicates whether the path in IsSymlinkRequest is a symlink. + bool is_symlink = 1; } diff --git a/client/groups/filesystem/v1beta2/client_generated.go b/client/groups/filesystem/v1beta2/client_generated.go index de152607..6619eeda 100644 --- a/client/groups/filesystem/v1beta2/client_generated.go +++ b/client/groups/filesystem/v1beta2/client_generated.go @@ -65,12 +65,12 @@ func (w *Client) Close() error { // ensures we implement all the required methods var _ v1beta2.FilesystemClient = &Client{} -func (w *Client) IsMountPoint(context context.Context, request *v1beta2.IsMountPointRequest, opts ...grpc.CallOption) (*v1beta2.IsMountPointResponse, error) { - return w.client.IsMountPoint(context, request, opts...) +func (w *Client) CreateSymlink(context context.Context, request *v1beta2.CreateSymlinkRequest, opts ...grpc.CallOption) (*v1beta2.CreateSymlinkResponse, error) { + return w.client.CreateSymlink(context, request, opts...) } -func (w *Client) LinkPath(context context.Context, request *v1beta2.LinkPathRequest, opts ...grpc.CallOption) (*v1beta2.LinkPathResponse, error) { - return w.client.LinkPath(context, request, opts...) +func (w *Client) IsSymlink(context context.Context, request *v1beta2.IsSymlinkRequest, opts ...grpc.CallOption) (*v1beta2.IsSymlinkResponse, error) { + return w.client.IsSymlink(context, request, opts...) } func (w *Client) Mkdir(context context.Context, request *v1beta2.MkdirRequest, opts ...grpc.CallOption) (*v1beta2.MkdirResponse, error) { diff --git a/integrationtests/filesystem_v1beta2_test.go b/integrationtests/filesystem_v1beta2_test.go index 3f824940..566d6214 100644 --- a/integrationtests/filesystem_v1beta2_test.go +++ b/integrationtests/filesystem_v1beta2_test.go @@ -52,11 +52,11 @@ func v1beta2FilesystemTests(t *testing.T) { sourcePath := stagepath targetPath := filepath.Join(podpath, "rootvol") // source <- target - linkReq := &v1beta2.LinkPathRequest{ + linkReq := &v1beta2.CreateSymlinkRequest{ SourcePath: sourcePath, TargetPath: targetPath, } - _, err = client.LinkPath(context.Background(), linkReq) + _, err = client.CreateSymlink(context.Background(), linkReq) require.NoError(t, err) exists, err = pathExists(podpath + "\\rootvol") @@ -103,22 +103,22 @@ func v1beta2FilesystemTests(t *testing.T) { // 1. Check the isMount on a path which does not exist. Failure scenario. stagepath := getWorkDirPath(fmt.Sprintf("testplugin-%d.csi.io\\volume%d", rand1, rand2), t) - isMountRequest := &v1beta2.IsMountPointRequest{ + IsSymlinkRequest := &v1beta2.IsSymlinkRequest{ Path: stagepath, } - isMountResponse, err := client.IsMountPoint(context.Background(), isMountRequest) + isSymlink, err := client.IsSymlink(context.Background(), IsSymlinkRequest) require.NotNil(t, err) // 2. Create the directory. This time its not a mount point. Failure scenario. err = os.Mkdir(stagepath, os.ModeDir) require.Nil(t, err) defer os.Remove(stagepath) - isMountRequest = &v1beta2.IsMountPointRequest{ + IsSymlinkRequest = &v1beta2.IsSymlinkRequest{ Path: stagepath, } - isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + isSymlink, err = client.IsSymlink(context.Background(), IsSymlinkRequest) require.Nil(t, err) - require.Equal(t, isMountResponse.IsMountPoint, false) + require.Equal(t, isSymlink.IsSymlink, false) err = os.Remove(stagepath) require.Nil(t, err) @@ -134,21 +134,21 @@ func v1beta2FilesystemTests(t *testing.T) { require.Nil(t, err) defer os.Remove(lnTargetStagePath) - isMountRequest = &v1beta2.IsMountPointRequest{ + IsSymlinkRequest = &v1beta2.IsSymlinkRequest{ Path: lnTargetStagePath, } - isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + isSymlink, err = client.IsSymlink(context.Background(), IsSymlinkRequest) require.Nil(t, err) - require.Equal(t, isMountResponse.IsMountPoint, true) + require.Equal(t, isSymlink.IsSymlink, true) // 4. Remove the path. Failure scenario. err = os.Remove(targetStagePath) require.Nil(t, err) - isMountRequest = &v1beta2.IsMountPointRequest{ + IsSymlinkRequest = &v1beta2.IsSymlinkRequest{ Path: lnTargetStagePath, } - isMountResponse, err = client.IsMountPoint(context.Background(), isMountRequest) + isSymlink, err = client.IsSymlink(context.Background(), IsSymlinkRequest) require.Nil(t, err) - require.Equal(t, isMountResponse.IsMountPoint, false) + require.Equal(t, isSymlink.IsSymlink, false) }) } diff --git a/internal/os/filesystem/api.go b/internal/os/filesystem/api.go index e83c78cb..adfeab0e 100644 --- a/internal/os/filesystem/api.go +++ b/internal/os/filesystem/api.go @@ -18,8 +18,8 @@ type API interface { PathValid(path string) (bool, error) Mkdir(path string) error Rmdir(path string, force bool) error - LinkPath(tgt string, src string) error - IsMountPoint(path string) (bool, error) + CreateSymlink(oldname string, newname string) error + IsSymlink(path string) (bool, error) } type filesystemAPI struct{} @@ -78,17 +78,19 @@ func (filesystemAPI) Rmdir(path string, force bool) error { return os.Remove(path) } -// LinkPath creates newname as a symbolic link to oldname. -func (filesystemAPI) LinkPath(oldname, newname string) error { +// CreateSymlink creates newname as a symbolic link to oldname. +func (filesystemAPI) CreateSymlink(oldname, newname string) error { return os.Symlink(oldname, newname) } -// IsMountPoint - returns true if tgt is a mount point. +// IsSymlink - returns true if tgt is a mount point. // A path is considered a mount point if: // - directory exists and // - it is a soft link and // - the target path of the link exists. -func (filesystemAPI) IsMountPoint(tgt string) (bool, error) { +// If tgt path does not exist, it returns an error +// if tgt path exists, but the source path tgt points to does not exist, it returns false without error. +func (filesystemAPI) IsSymlink(tgt string) (bool, error) { // This code is similar to k8s.io/kubernetes/pkg/util/mount except the pathExists usage. // Also in a remote call environment the os error cannot be passed directly back, hence the callers // are expected to perform the isExists check before calling this call in CSI proxy. diff --git a/internal/server/filesystem/internal/types.go b/internal/server/filesystem/internal/types.go index 204d4700..2a74b5f0 100644 --- a/internal/server/filesystem/internal/types.go +++ b/internal/server/filesystem/internal/types.go @@ -83,6 +83,53 @@ type RmdirRequest struct { type RmdirResponse struct { } +type CreateSymlinkRequest struct { + // The path of the existing directory to be linked. + // All special characters allowed by Windows in path names will be allowed + // except for restrictions noted below. For details, please check: + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // + // Restrictions: + // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. + // The path prefix needs needs to match the paths specified as + // kubelet-csi-plugins-path parameter of csi-proxy. + // UNC paths of the form "\\server\share\path\file" are not allowed. + // All directory separators need to be backslash character: "\". + // Characters: .. / : | ? * in the path are not allowed. + // source_path cannot already exist in the host filesystem. + // Maximum path length will be capped to 260 characters. + SourcePath string + // Target path is the location of the new directory entry to be created in the host's filesystem. + // All special characters allowed by Windows in path names will be allowed + // except for restrictions noted below. For details, please check: + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + // + // Restrictions: + // Only absolute path (indicated by a drive letter prefix: e.g. "C:\") is accepted. + // The path prefix needs to match the paths specified as + // kubelet-pod-path parameter of csi-proxy. + // UNC paths of the form "\\server\share\path\file" are not allowed. + // All directory separators need to be backslash character: "\". + // Characters: .. / : | ? * in the path are not allowed. + // target_path needs to exist as a directory in the host that is empty. + // target_path cannot be a symbolic link. + // Maximum path length will be capped to 260 characters. + TargetPath string +} + +type CreateSymlinkResponse struct { +} + +type IsSymlinkRequest struct { + Path string +} + +type IsSymlinkResponse struct { + IsSymlink bool +} + +// Compatibility for pre v1beta2 APIs + type LinkPathRequest struct { // The path where the symlink is created in the host's filesystem. // All special characters allowed by Windows in path names will be allowed diff --git a/internal/server/filesystem/internal/types_generated.go b/internal/server/filesystem/internal/types_generated.go index a43027f0..2bf9abbf 100644 --- a/internal/server/filesystem/internal/types_generated.go +++ b/internal/server/filesystem/internal/types_generated.go @@ -15,7 +15,9 @@ type VersionedAPI interface { // All the functions this group's server needs to define. type ServerInterface interface { + CreateSymlink(context.Context, *CreateSymlinkRequest, apiversion.Version) (*CreateSymlinkResponse, error) IsMountPoint(context.Context, *IsMountPointRequest, apiversion.Version) (*IsMountPointResponse, error) + IsSymlink(context.Context, *IsSymlinkRequest, apiversion.Version) (*IsSymlinkResponse, error) LinkPath(context.Context, *LinkPathRequest, apiversion.Version) (*LinkPathResponse, error) Mkdir(context.Context, *MkdirRequest, apiversion.Version) (*MkdirResponse, error) PathExists(context.Context, *PathExistsRequest, apiversion.Version) (*PathExistsResponse, error) diff --git a/internal/server/filesystem/internal/v1beta2/conversion_generated.go b/internal/server/filesystem/internal/v1beta2/conversion_generated.go index 74098d0f..b2e36818 100644 --- a/internal/server/filesystem/internal/v1beta2/conversion_generated.go +++ b/internal/server/filesystem/internal/v1beta2/conversion_generated.go @@ -7,84 +7,84 @@ import ( internal "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal" ) -func autoConvert_v1beta2_IsMountPointRequest_To_internal_IsMountPointRequest(in *v1beta2.IsMountPointRequest, out *internal.IsMountPointRequest) error { - out.Path = in.Path +func autoConvert_v1beta2_CreateSymlinkRequest_To_internal_CreateSymlinkRequest(in *v1beta2.CreateSymlinkRequest, out *internal.CreateSymlinkRequest) error { + out.SourcePath = in.SourcePath + out.TargetPath = in.TargetPath return nil } -// Convert_v1beta2_IsMountPointRequest_To_internal_IsMountPointRequest is an autogenerated conversion function. -func Convert_v1beta2_IsMountPointRequest_To_internal_IsMountPointRequest(in *v1beta2.IsMountPointRequest, out *internal.IsMountPointRequest) error { - return autoConvert_v1beta2_IsMountPointRequest_To_internal_IsMountPointRequest(in, out) +// Convert_v1beta2_CreateSymlinkRequest_To_internal_CreateSymlinkRequest is an autogenerated conversion function. +func Convert_v1beta2_CreateSymlinkRequest_To_internal_CreateSymlinkRequest(in *v1beta2.CreateSymlinkRequest, out *internal.CreateSymlinkRequest) error { + return autoConvert_v1beta2_CreateSymlinkRequest_To_internal_CreateSymlinkRequest(in, out) } -func autoConvert_internal_IsMountPointRequest_To_v1beta2_IsMountPointRequest(in *internal.IsMountPointRequest, out *v1beta2.IsMountPointRequest) error { - out.Path = in.Path +func autoConvert_internal_CreateSymlinkRequest_To_v1beta2_CreateSymlinkRequest(in *internal.CreateSymlinkRequest, out *v1beta2.CreateSymlinkRequest) error { + out.SourcePath = in.SourcePath + out.TargetPath = in.TargetPath return nil } -// Convert_internal_IsMountPointRequest_To_v1beta2_IsMountPointRequest is an autogenerated conversion function. -func Convert_internal_IsMountPointRequest_To_v1beta2_IsMountPointRequest(in *internal.IsMountPointRequest, out *v1beta2.IsMountPointRequest) error { - return autoConvert_internal_IsMountPointRequest_To_v1beta2_IsMountPointRequest(in, out) +// Convert_internal_CreateSymlinkRequest_To_v1beta2_CreateSymlinkRequest is an autogenerated conversion function. +func Convert_internal_CreateSymlinkRequest_To_v1beta2_CreateSymlinkRequest(in *internal.CreateSymlinkRequest, out *v1beta2.CreateSymlinkRequest) error { + return autoConvert_internal_CreateSymlinkRequest_To_v1beta2_CreateSymlinkRequest(in, out) } -func autoConvert_v1beta2_IsMountPointResponse_To_internal_IsMountPointResponse(in *v1beta2.IsMountPointResponse, out *internal.IsMountPointResponse) error { - out.IsMountPoint = in.IsMountPoint +func autoConvert_v1beta2_CreateSymlinkResponse_To_internal_CreateSymlinkResponse(in *v1beta2.CreateSymlinkResponse, out *internal.CreateSymlinkResponse) error { return nil } -// Convert_v1beta2_IsMountPointResponse_To_internal_IsMountPointResponse is an autogenerated conversion function. -func Convert_v1beta2_IsMountPointResponse_To_internal_IsMountPointResponse(in *v1beta2.IsMountPointResponse, out *internal.IsMountPointResponse) error { - return autoConvert_v1beta2_IsMountPointResponse_To_internal_IsMountPointResponse(in, out) +// Convert_v1beta2_CreateSymlinkResponse_To_internal_CreateSymlinkResponse is an autogenerated conversion function. +func Convert_v1beta2_CreateSymlinkResponse_To_internal_CreateSymlinkResponse(in *v1beta2.CreateSymlinkResponse, out *internal.CreateSymlinkResponse) error { + return autoConvert_v1beta2_CreateSymlinkResponse_To_internal_CreateSymlinkResponse(in, out) } -func autoConvert_internal_IsMountPointResponse_To_v1beta2_IsMountPointResponse(in *internal.IsMountPointResponse, out *v1beta2.IsMountPointResponse) error { - out.IsMountPoint = in.IsMountPoint +func autoConvert_internal_CreateSymlinkResponse_To_v1beta2_CreateSymlinkResponse(in *internal.CreateSymlinkResponse, out *v1beta2.CreateSymlinkResponse) error { return nil } -// Convert_internal_IsMountPointResponse_To_v1beta2_IsMountPointResponse is an autogenerated conversion function. -func Convert_internal_IsMountPointResponse_To_v1beta2_IsMountPointResponse(in *internal.IsMountPointResponse, out *v1beta2.IsMountPointResponse) error { - return autoConvert_internal_IsMountPointResponse_To_v1beta2_IsMountPointResponse(in, out) +// Convert_internal_CreateSymlinkResponse_To_v1beta2_CreateSymlinkResponse is an autogenerated conversion function. +func Convert_internal_CreateSymlinkResponse_To_v1beta2_CreateSymlinkResponse(in *internal.CreateSymlinkResponse, out *v1beta2.CreateSymlinkResponse) error { + return autoConvert_internal_CreateSymlinkResponse_To_v1beta2_CreateSymlinkResponse(in, out) } -func autoConvert_v1beta2_LinkPathRequest_To_internal_LinkPathRequest(in *v1beta2.LinkPathRequest, out *internal.LinkPathRequest) error { - out.SourcePath = in.SourcePath - out.TargetPath = in.TargetPath +func autoConvert_v1beta2_IsSymlinkRequest_To_internal_IsSymlinkRequest(in *v1beta2.IsSymlinkRequest, out *internal.IsSymlinkRequest) error { + out.Path = in.Path return nil } -// Convert_v1beta2_LinkPathRequest_To_internal_LinkPathRequest is an autogenerated conversion function. -func Convert_v1beta2_LinkPathRequest_To_internal_LinkPathRequest(in *v1beta2.LinkPathRequest, out *internal.LinkPathRequest) error { - return autoConvert_v1beta2_LinkPathRequest_To_internal_LinkPathRequest(in, out) +// Convert_v1beta2_IsSymlinkRequest_To_internal_IsSymlinkRequest is an autogenerated conversion function. +func Convert_v1beta2_IsSymlinkRequest_To_internal_IsSymlinkRequest(in *v1beta2.IsSymlinkRequest, out *internal.IsSymlinkRequest) error { + return autoConvert_v1beta2_IsSymlinkRequest_To_internal_IsSymlinkRequest(in, out) } -func autoConvert_internal_LinkPathRequest_To_v1beta2_LinkPathRequest(in *internal.LinkPathRequest, out *v1beta2.LinkPathRequest) error { - out.SourcePath = in.SourcePath - out.TargetPath = in.TargetPath +func autoConvert_internal_IsSymlinkRequest_To_v1beta2_IsSymlinkRequest(in *internal.IsSymlinkRequest, out *v1beta2.IsSymlinkRequest) error { + out.Path = in.Path return nil } -// Convert_internal_LinkPathRequest_To_v1beta2_LinkPathRequest is an autogenerated conversion function. -func Convert_internal_LinkPathRequest_To_v1beta2_LinkPathRequest(in *internal.LinkPathRequest, out *v1beta2.LinkPathRequest) error { - return autoConvert_internal_LinkPathRequest_To_v1beta2_LinkPathRequest(in, out) +// Convert_internal_IsSymlinkRequest_To_v1beta2_IsSymlinkRequest is an autogenerated conversion function. +func Convert_internal_IsSymlinkRequest_To_v1beta2_IsSymlinkRequest(in *internal.IsSymlinkRequest, out *v1beta2.IsSymlinkRequest) error { + return autoConvert_internal_IsSymlinkRequest_To_v1beta2_IsSymlinkRequest(in, out) } -func autoConvert_v1beta2_LinkPathResponse_To_internal_LinkPathResponse(in *v1beta2.LinkPathResponse, out *internal.LinkPathResponse) error { +func autoConvert_v1beta2_IsSymlinkResponse_To_internal_IsSymlinkResponse(in *v1beta2.IsSymlinkResponse, out *internal.IsSymlinkResponse) error { + out.IsSymlink = in.IsSymlink return nil } -// Convert_v1beta2_LinkPathResponse_To_internal_LinkPathResponse is an autogenerated conversion function. -func Convert_v1beta2_LinkPathResponse_To_internal_LinkPathResponse(in *v1beta2.LinkPathResponse, out *internal.LinkPathResponse) error { - return autoConvert_v1beta2_LinkPathResponse_To_internal_LinkPathResponse(in, out) +// Convert_v1beta2_IsSymlinkResponse_To_internal_IsSymlinkResponse is an autogenerated conversion function. +func Convert_v1beta2_IsSymlinkResponse_To_internal_IsSymlinkResponse(in *v1beta2.IsSymlinkResponse, out *internal.IsSymlinkResponse) error { + return autoConvert_v1beta2_IsSymlinkResponse_To_internal_IsSymlinkResponse(in, out) } -func autoConvert_internal_LinkPathResponse_To_v1beta2_LinkPathResponse(in *internal.LinkPathResponse, out *v1beta2.LinkPathResponse) error { +func autoConvert_internal_IsSymlinkResponse_To_v1beta2_IsSymlinkResponse(in *internal.IsSymlinkResponse, out *v1beta2.IsSymlinkResponse) error { + out.IsSymlink = in.IsSymlink return nil } -// Convert_internal_LinkPathResponse_To_v1beta2_LinkPathResponse is an autogenerated conversion function. -func Convert_internal_LinkPathResponse_To_v1beta2_LinkPathResponse(in *internal.LinkPathResponse, out *v1beta2.LinkPathResponse) error { - return autoConvert_internal_LinkPathResponse_To_v1beta2_LinkPathResponse(in, out) +// Convert_internal_IsSymlinkResponse_To_v1beta2_IsSymlinkResponse is an autogenerated conversion function. +func Convert_internal_IsSymlinkResponse_To_v1beta2_IsSymlinkResponse(in *internal.IsSymlinkResponse, out *v1beta2.IsSymlinkResponse) error { + return autoConvert_internal_IsSymlinkResponse_To_v1beta2_IsSymlinkResponse(in, out) } func autoConvert_v1beta2_MkdirRequest_To_internal_MkdirRequest(in *v1beta2.MkdirRequest, out *internal.MkdirRequest) error { diff --git a/internal/server/filesystem/internal/v1beta2/server_generated.go b/internal/server/filesystem/internal/v1beta2/server_generated.go index 55426586..bae6fd36 100644 --- a/internal/server/filesystem/internal/v1beta2/server_generated.go +++ b/internal/server/filesystem/internal/v1beta2/server_generated.go @@ -27,38 +27,38 @@ func (s *versionedAPI) Register(grpcServer *grpc.Server) { v1beta2.RegisterFilesystemServer(grpcServer, s) } -func (s *versionedAPI) IsMountPoint(context context.Context, versionedRequest *v1beta2.IsMountPointRequest) (*v1beta2.IsMountPointResponse, error) { - request := &internal.IsMountPointRequest{} - if err := Convert_v1beta2_IsMountPointRequest_To_internal_IsMountPointRequest(versionedRequest, request); err != nil { +func (s *versionedAPI) CreateSymlink(context context.Context, versionedRequest *v1beta2.CreateSymlinkRequest) (*v1beta2.CreateSymlinkResponse, error) { + request := &internal.CreateSymlinkRequest{} + if err := Convert_v1beta2_CreateSymlinkRequest_To_internal_CreateSymlinkRequest(versionedRequest, request); err != nil { return nil, err } - response, err := s.apiGroupServer.IsMountPoint(context, request, version) + response, err := s.apiGroupServer.CreateSymlink(context, request, version) if err != nil { return nil, err } - versionedResponse := &v1beta2.IsMountPointResponse{} - if err := Convert_internal_IsMountPointResponse_To_v1beta2_IsMountPointResponse(response, versionedResponse); err != nil { + versionedResponse := &v1beta2.CreateSymlinkResponse{} + if err := Convert_internal_CreateSymlinkResponse_To_v1beta2_CreateSymlinkResponse(response, versionedResponse); err != nil { return nil, err } return versionedResponse, err } -func (s *versionedAPI) LinkPath(context context.Context, versionedRequest *v1beta2.LinkPathRequest) (*v1beta2.LinkPathResponse, error) { - request := &internal.LinkPathRequest{} - if err := Convert_v1beta2_LinkPathRequest_To_internal_LinkPathRequest(versionedRequest, request); err != nil { +func (s *versionedAPI) IsSymlink(context context.Context, versionedRequest *v1beta2.IsSymlinkRequest) (*v1beta2.IsSymlinkResponse, error) { + request := &internal.IsSymlinkRequest{} + if err := Convert_v1beta2_IsSymlinkRequest_To_internal_IsSymlinkRequest(versionedRequest, request); err != nil { return nil, err } - response, err := s.apiGroupServer.LinkPath(context, request, version) + response, err := s.apiGroupServer.IsSymlink(context, request, version) if err != nil { return nil, err } - versionedResponse := &v1beta2.LinkPathResponse{} - if err := Convert_internal_LinkPathResponse_To_v1beta2_LinkPathResponse(response, versionedResponse); err != nil { + versionedResponse := &v1beta2.IsSymlinkResponse{} + if err := Convert_internal_IsSymlinkResponse_To_v1beta2_IsSymlinkResponse(response, versionedResponse); err != nil { return nil, err } diff --git a/internal/server/filesystem/server.go b/internal/server/filesystem/server.go index 0dd5f1a3..b9ee115b 100644 --- a/internal/server/filesystem/server.go +++ b/internal/server/filesystem/server.go @@ -166,9 +166,21 @@ func (s *Server) Rmdir(ctx context.Context, request *internal.RmdirRequest, vers } return nil, err } - func (s *Server) LinkPath(ctx context.Context, request *internal.LinkPathRequest, version apiversion.Version) (*internal.LinkPathResponse, error) { klog.V(2).Infof("Request: LinkPath with targetPath=%q sourcePath=%q", request.TargetPath, request.SourcePath) + createSymlinkRequest := &internal.CreateSymlinkRequest{ + SourcePath: request.SourcePath, + TargetPath: request.TargetPath, + } + if _, err := s.CreateSymlink(ctx, createSymlinkRequest, version); err != nil { + klog.Errorf("Failed to forward to CreateSymlink: %v", err) + return nil, err + } + return &internal.LinkPathResponse{}, nil +} + +func (s *Server) CreateSymlink(ctx context.Context, request *internal.CreateSymlinkRequest, version apiversion.Version) (*internal.CreateSymlinkResponse, error) { + klog.V(2).Infof("Request: CreateSymlink with targetPath=%q sourcePath=%q", request.TargetPath, request.SourcePath) err := s.validatePathWindows(internal.POD, request.TargetPath) if err != nil { klog.Errorf("failed validatePathWindows for target path %v", err) @@ -179,22 +191,37 @@ func (s *Server) LinkPath(ctx context.Context, request *internal.LinkPathRequest klog.Errorf("failed validatePathWindows for source path %v", err) return nil, err } - err = s.hostAPI.LinkPath(request.SourcePath, request.TargetPath) + err = s.hostAPI.CreateSymlink(request.SourcePath, request.TargetPath) if err != nil { - klog.Errorf("failed LinkPath %v", err) + klog.Errorf("failed CreateSymlink: %v", err) return nil, err } - return nil, err + return &internal.CreateSymlinkResponse{}, nil } func (s *Server) IsMountPoint(ctx context.Context, request *internal.IsMountPointRequest, version apiversion.Version) (*internal.IsMountPointResponse, error) { klog.V(2).Infof("Request: IsMountPoint with path=%q", request.Path) - isMount, err := s.hostAPI.IsMountPoint(request.Path) + isSymlinkRequest := &internal.IsSymlinkRequest{ + Path: request.Path, + } + isSymlinkResponse, err := s.IsSymlink(ctx, isSymlinkRequest, version) if err != nil { - klog.Errorf("failed IsMountPoint %v", err) + klog.Errorf("Failed to forward to IsSymlink: %v", err) return nil, err } return &internal.IsMountPointResponse{ - IsMountPoint: isMount, - }, err + IsMountPoint: isSymlinkResponse.IsSymlink, + }, nil +} + +func (s *Server) IsSymlink(ctx context.Context, request *internal.IsSymlinkRequest, version apiversion.Version) (*internal.IsSymlinkResponse, error) { + klog.V(2).Infof("Request: IsSymlink with path=%q", request.Path) + isSymlink, err := s.hostAPI.IsSymlink(request.Path) + if err != nil { + klog.Errorf("failed IsSymlink %v", err) + return nil, err + } + return &internal.IsSymlinkResponse{ + IsSymlink: isSymlink, + }, nil } diff --git a/internal/server/filesystem/server_test.go b/internal/server/filesystem/server_test.go index 74005486..815cb011 100644 --- a/internal/server/filesystem/server_test.go +++ b/internal/server/filesystem/server_test.go @@ -25,11 +25,11 @@ func (fakeFileSystemAPI) Mkdir(path string) error { func (fakeFileSystemAPI) Rmdir(path string, force bool) error { return nil } -func (fakeFileSystemAPI) LinkPath(tgt string, src string) error { +func (fakeFileSystemAPI) CreateSymlink(tgt string, src string) error { return nil } -func (fakeFileSystemAPI) IsMountPoint(path string) (bool, error) { +func (fakeFileSystemAPI) IsSymlink(path string) (bool, error) { return true, nil } diff --git a/internal/server/smb/server_test.go b/internal/server/smb/server_test.go index 450c4362..614323fb 100644 --- a/internal/server/smb/server_test.go +++ b/internal/server/smb/server_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/kubernetes-csi/csi-proxy/client/apiversion" + "github.com/kubernetes-csi/csi-proxy/internal/os/filesystem" fsserver "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem" "github.com/kubernetes-csi/csi-proxy/internal/server/smb/internal" ) @@ -29,6 +30,8 @@ func (fakeSmbAPI) NewSmbLink(remotePath, localPath string) error { type fakeFileSystemAPI struct{} +var _ filesystem.API = &fakeFileSystemAPI{} + func (fakeFileSystemAPI) PathExists(path string) (bool, error) { return true, nil } @@ -41,11 +44,11 @@ func (fakeFileSystemAPI) Mkdir(path string) error { func (fakeFileSystemAPI) Rmdir(path string, force bool) error { return nil } -func (fakeFileSystemAPI) LinkPath(tgt string, src string) error { +func (fakeFileSystemAPI) CreateSymlink(tgt string, src string) error { return nil } -func (fakeFileSystemAPI) IsMountPoint(path string) (bool, error) { +func (fakeFileSystemAPI) IsSymlink(path string) (bool, error) { return true, nil } diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go index c2b6f5b5..0219d023 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.pb.go @@ -417,12 +417,12 @@ func (*RmdirResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{5} } -type LinkPathRequest struct { +type CreateSymlinkRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The path where the symlink is created in the host's filesystem. + // The path of the existing directory to be linked. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -437,7 +437,7 @@ type LinkPathRequest struct { // source_path cannot already exist in the host filesystem. // Maximum path length will be capped to 260 characters. SourcePath string `protobuf:"bytes,1,opt,name=source_path,json=sourcePath,proto3" json:"source_path,omitempty"` - // Target path in the host's filesystem used for the symlink creation. + // Target path is the location of the new directory entry to be created in the host's filesystem. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -455,8 +455,8 @@ type LinkPathRequest struct { TargetPath string `protobuf:"bytes,2,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"` } -func (x *LinkPathRequest) Reset() { - *x = LinkPathRequest{} +func (x *CreateSymlinkRequest) Reset() { + *x = CreateSymlinkRequest{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -464,13 +464,13 @@ func (x *LinkPathRequest) Reset() { } } -func (x *LinkPathRequest) String() string { +func (x *CreateSymlinkRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*LinkPathRequest) ProtoMessage() {} +func (*CreateSymlinkRequest) ProtoMessage() {} -func (x *LinkPathRequest) ProtoReflect() protoreflect.Message { +func (x *CreateSymlinkRequest) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -482,33 +482,33 @@ func (x *LinkPathRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LinkPathRequest.ProtoReflect.Descriptor instead. -func (*LinkPathRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateSymlinkRequest.ProtoReflect.Descriptor instead. +func (*CreateSymlinkRequest) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{6} } -func (x *LinkPathRequest) GetSourcePath() string { +func (x *CreateSymlinkRequest) GetSourcePath() string { if x != nil { return x.SourcePath } return "" } -func (x *LinkPathRequest) GetTargetPath() string { +func (x *CreateSymlinkRequest) GetTargetPath() string { if x != nil { return x.TargetPath } return "" } -type LinkPathResponse struct { +type CreateSymlinkResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *LinkPathResponse) Reset() { - *x = LinkPathResponse{} +func (x *CreateSymlinkResponse) Reset() { + *x = CreateSymlinkResponse{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -516,13 +516,13 @@ func (x *LinkPathResponse) Reset() { } } -func (x *LinkPathResponse) String() string { +func (x *CreateSymlinkResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*LinkPathResponse) ProtoMessage() {} +func (*CreateSymlinkResponse) ProtoMessage() {} -func (x *LinkPathResponse) ProtoReflect() protoreflect.Message { +func (x *CreateSymlinkResponse) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -534,22 +534,22 @@ func (x *LinkPathResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LinkPathResponse.ProtoReflect.Descriptor instead. -func (*LinkPathResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateSymlinkResponse.ProtoReflect.Descriptor instead. +func (*CreateSymlinkResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{7} } -type IsMountPointRequest struct { +type IsSymlinkRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The path whose existence we want to check in the host's filesystem + // The path whose existence as a symlink we want to check in the host's filesystem. Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` } -func (x *IsMountPointRequest) Reset() { - *x = IsMountPointRequest{} +func (x *IsSymlinkRequest) Reset() { + *x = IsSymlinkRequest{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -557,13 +557,13 @@ func (x *IsMountPointRequest) Reset() { } } -func (x *IsMountPointRequest) String() string { +func (x *IsSymlinkRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*IsMountPointRequest) ProtoMessage() {} +func (*IsSymlinkRequest) ProtoMessage() {} -func (x *IsMountPointRequest) ProtoReflect() protoreflect.Message { +func (x *IsSymlinkRequest) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -575,29 +575,29 @@ func (x *IsMountPointRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use IsMountPointRequest.ProtoReflect.Descriptor instead. -func (*IsMountPointRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use IsSymlinkRequest.ProtoReflect.Descriptor instead. +func (*IsSymlinkRequest) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{8} } -func (x *IsMountPointRequest) GetPath() string { +func (x *IsSymlinkRequest) GetPath() string { if x != nil { return x.Path } return "" } -type IsMountPointResponse struct { +type IsSymlinkResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - IsMountPoint bool `protobuf:"varint,1,opt,name=is_mount_point,json=isMountPoint,proto3" json:"is_mount_point,omitempty"` + // Indicates whether the path in IsSymlinkRequest is a symlink. + IsSymlink bool `protobuf:"varint,1,opt,name=is_symlink,json=isSymlink,proto3" json:"is_symlink,omitempty"` } -func (x *IsMountPointResponse) Reset() { - *x = IsMountPointResponse{} +func (x *IsSymlinkResponse) Reset() { + *x = IsSymlinkResponse{} if protoimpl.UnsafeEnabled { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -605,13 +605,13 @@ func (x *IsMountPointResponse) Reset() { } } -func (x *IsMountPointResponse) String() string { +func (x *IsSymlinkResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*IsMountPointResponse) ProtoMessage() {} +func (*IsSymlinkResponse) ProtoMessage() {} -func (x *IsMountPointResponse) ProtoReflect() protoreflect.Message { +func (x *IsSymlinkResponse) ProtoReflect() protoreflect.Message { mi := &file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -623,14 +623,14 @@ func (x *IsMountPointResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use IsMountPointResponse.ProtoReflect.Descriptor instead. -func (*IsMountPointResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use IsSymlinkResponse.ProtoReflect.Descriptor instead. +func (*IsSymlinkResponse) Descriptor() ([]byte, []int) { return file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_rawDescGZIP(), []int{9} } -func (x *IsMountPointResponse) GetIsMountPoint() bool { +func (x *IsSymlinkResponse) GetIsSymlink() bool { if x != nil { - return x.IsMountPoint + return x.IsSymlink } return false } @@ -665,49 +665,50 @@ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_p 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, - 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x0a, - 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, - 0x74, 0x68, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x13, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, - 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x22, 0x3c, 0x0a, 0x14, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2a, - 0x22, 0x0a, 0x0b, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, - 0x0a, 0x06, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, - 0x44, 0x10, 0x01, 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, - 0x12, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, - 0x6b, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, - 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, - 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x41, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, - 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x49, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, - 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x4d, 0x6f, 0x75, - 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, 0x69, 0x2f, 0x63, - 0x73, 0x69, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x0a, + 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x26, 0x0a, 0x10, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x32, 0x0a, 0x11, 0x49, 0x73, 0x53, 0x79, + 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x2a, 0x22, 0x0a, 0x0b, + 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x50, + 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4f, 0x44, 0x10, 0x01, + 0x32, 0xe1, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, + 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1a, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x4d, 0x6b, 0x64, 0x69, + 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x32, 0x2e, 0x4d, 0x6b, 0x64, 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x38, 0x0a, 0x05, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, 0x69, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x52, 0x6d, 0x64, + 0x69, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0d, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x1d, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, + 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6d, + 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, + 0x0a, 0x09, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x19, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, + 0x2e, 0x49, 0x73, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2d, 0x63, 0x73, + 0x69, 0x2f, 0x63, 0x73, 0x69, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -725,17 +726,17 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_goTypes = []interface{}{ - (PathContext)(0), // 0: v1beta2.PathContext - (*PathExistsRequest)(nil), // 1: v1beta2.PathExistsRequest - (*PathExistsResponse)(nil), // 2: v1beta2.PathExistsResponse - (*MkdirRequest)(nil), // 3: v1beta2.MkdirRequest - (*MkdirResponse)(nil), // 4: v1beta2.MkdirResponse - (*RmdirRequest)(nil), // 5: v1beta2.RmdirRequest - (*RmdirResponse)(nil), // 6: v1beta2.RmdirResponse - (*LinkPathRequest)(nil), // 7: v1beta2.LinkPathRequest - (*LinkPathResponse)(nil), // 8: v1beta2.LinkPathResponse - (*IsMountPointRequest)(nil), // 9: v1beta2.IsMountPointRequest - (*IsMountPointResponse)(nil), // 10: v1beta2.IsMountPointResponse + (PathContext)(0), // 0: v1beta2.PathContext + (*PathExistsRequest)(nil), // 1: v1beta2.PathExistsRequest + (*PathExistsResponse)(nil), // 2: v1beta2.PathExistsResponse + (*MkdirRequest)(nil), // 3: v1beta2.MkdirRequest + (*MkdirResponse)(nil), // 4: v1beta2.MkdirResponse + (*RmdirRequest)(nil), // 5: v1beta2.RmdirRequest + (*RmdirResponse)(nil), // 6: v1beta2.RmdirResponse + (*CreateSymlinkRequest)(nil), // 7: v1beta2.CreateSymlinkRequest + (*CreateSymlinkResponse)(nil), // 8: v1beta2.CreateSymlinkResponse + (*IsSymlinkRequest)(nil), // 9: v1beta2.IsSymlinkRequest + (*IsSymlinkResponse)(nil), // 10: v1beta2.IsSymlinkResponse } var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_depIdxs = []int32{ 0, // 0: v1beta2.PathExistsRequest.context:type_name -> v1beta2.PathContext @@ -744,13 +745,13 @@ var file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_p 1, // 3: v1beta2.Filesystem.PathExists:input_type -> v1beta2.PathExistsRequest 3, // 4: v1beta2.Filesystem.Mkdir:input_type -> v1beta2.MkdirRequest 5, // 5: v1beta2.Filesystem.Rmdir:input_type -> v1beta2.RmdirRequest - 7, // 6: v1beta2.Filesystem.LinkPath:input_type -> v1beta2.LinkPathRequest - 9, // 7: v1beta2.Filesystem.IsMountPoint:input_type -> v1beta2.IsMountPointRequest + 7, // 6: v1beta2.Filesystem.CreateSymlink:input_type -> v1beta2.CreateSymlinkRequest + 9, // 7: v1beta2.Filesystem.IsSymlink:input_type -> v1beta2.IsSymlinkRequest 2, // 8: v1beta2.Filesystem.PathExists:output_type -> v1beta2.PathExistsResponse 4, // 9: v1beta2.Filesystem.Mkdir:output_type -> v1beta2.MkdirResponse 6, // 10: v1beta2.Filesystem.Rmdir:output_type -> v1beta2.RmdirResponse - 8, // 11: v1beta2.Filesystem.LinkPath:output_type -> v1beta2.LinkPathResponse - 10, // 12: v1beta2.Filesystem.IsMountPoint:output_type -> v1beta2.IsMountPointResponse + 8, // 11: v1beta2.Filesystem.CreateSymlink:output_type -> v1beta2.CreateSymlinkResponse + 10, // 12: v1beta2.Filesystem.IsSymlink:output_type -> v1beta2.IsSymlinkResponse 8, // [8:13] is the sub-list for method output_type 3, // [3:8] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -837,7 +838,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinkPathRequest); i { + switch v := v.(*CreateSymlinkRequest); i { case 0: return &v.state case 1: @@ -849,7 +850,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinkPathResponse); i { + switch v := v.(*CreateSymlinkResponse); i { case 0: return &v.state case 1: @@ -861,7 +862,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsMountPointRequest); i { + switch v := v.(*IsSymlinkRequest); i { case 0: return &v.state case 1: @@ -873,7 +874,7 @@ func file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_ } } file_github_com_kubernetes_csi_csi_proxy_client_api_filesystem_v1beta2_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IsMountPointResponse); i { + switch v := v.(*IsSymlinkResponse); i { case 0: return &v.state case 1: @@ -920,16 +921,17 @@ const _ = grpc.SupportPackageIsVersion6 type FilesystemClient interface { // PathExists checks if the requested path exists in the host filesystem. PathExists(ctx context.Context, in *PathExistsRequest, opts ...grpc.CallOption) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host filesystem + // Mkdir creates a directory at the requested path in the host filesystem. Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through LinkPath. + // This may be used for unlinking a symlink created through CreateSymlink. Rmdir(ctx context.Context, in *RmdirRequest, opts ...grpc.CallOption) (*RmdirResponse, error) - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem. - LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) - // IsMountPoint checks if a given path is a mount point. - IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) + // CreateSymlink creates a symbolic link called target_path that points to source_path + // in the host filesystem (target_path is the name of the symbolic link created, + // source_path is the existing path). + CreateSymlink(ctx context.Context, in *CreateSymlinkRequest, opts ...grpc.CallOption) (*CreateSymlinkResponse, error) + // IsSymlink checks if a given path is a symlink. + IsSymlink(ctx context.Context, in *IsSymlinkRequest, opts ...grpc.CallOption) (*IsSymlinkResponse, error) } type filesystemClient struct { @@ -967,18 +969,18 @@ func (c *filesystemClient) Rmdir(ctx context.Context, in *RmdirRequest, opts ... return out, nil } -func (c *filesystemClient) LinkPath(ctx context.Context, in *LinkPathRequest, opts ...grpc.CallOption) (*LinkPathResponse, error) { - out := new(LinkPathResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/LinkPath", in, out, opts...) +func (c *filesystemClient) CreateSymlink(ctx context.Context, in *CreateSymlinkRequest, opts ...grpc.CallOption) (*CreateSymlinkResponse, error) { + out := new(CreateSymlinkResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/CreateSymlink", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *filesystemClient) IsMountPoint(ctx context.Context, in *IsMountPointRequest, opts ...grpc.CallOption) (*IsMountPointResponse, error) { - out := new(IsMountPointResponse) - err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/IsMountPoint", in, out, opts...) +func (c *filesystemClient) IsSymlink(ctx context.Context, in *IsSymlinkRequest, opts ...grpc.CallOption) (*IsSymlinkResponse, error) { + out := new(IsSymlinkResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Filesystem/IsSymlink", in, out, opts...) if err != nil { return nil, err } @@ -989,16 +991,17 @@ func (c *filesystemClient) IsMountPoint(ctx context.Context, in *IsMountPointReq type FilesystemServer interface { // PathExists checks if the requested path exists in the host filesystem. PathExists(context.Context, *PathExistsRequest) (*PathExistsResponse, error) - // Mkdir creates a directory at the requested path in the host filesystem + // Mkdir creates a directory at the requested path in the host filesystem. Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through LinkPath. + // This may be used for unlinking a symlink created through CreateSymlink. Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem. - LinkPath(context.Context, *LinkPathRequest) (*LinkPathResponse, error) - // IsMountPoint checks if a given path is a mount point. - IsMountPoint(context.Context, *IsMountPointRequest) (*IsMountPointResponse, error) + // CreateSymlink creates a symbolic link called target_path that points to source_path + // in the host filesystem (target_path is the name of the symbolic link created, + // source_path is the existing path). + CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error) + // IsSymlink checks if a given path is a symlink. + IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error) } // UnimplementedFilesystemServer can be embedded to have forward compatible implementations. @@ -1014,11 +1017,11 @@ func (*UnimplementedFilesystemServer) Mkdir(context.Context, *MkdirRequest) (*Mk func (*UnimplementedFilesystemServer) Rmdir(context.Context, *RmdirRequest) (*RmdirResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Rmdir not implemented") } -func (*UnimplementedFilesystemServer) LinkPath(context.Context, *LinkPathRequest) (*LinkPathResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LinkPath not implemented") +func (*UnimplementedFilesystemServer) CreateSymlink(context.Context, *CreateSymlinkRequest) (*CreateSymlinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSymlink not implemented") } -func (*UnimplementedFilesystemServer) IsMountPoint(context.Context, *IsMountPointRequest) (*IsMountPointResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsMountPoint not implemented") +func (*UnimplementedFilesystemServer) IsSymlink(context.Context, *IsSymlinkRequest) (*IsSymlinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsSymlink not implemented") } func RegisterFilesystemServer(s *grpc.Server, srv FilesystemServer) { @@ -1079,38 +1082,38 @@ func _Filesystem_Rmdir_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Filesystem_LinkPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LinkPathRequest) +func _Filesystem_CreateSymlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSymlinkRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FilesystemServer).LinkPath(ctx, in) + return srv.(FilesystemServer).CreateSymlink(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1beta2.Filesystem/LinkPath", + FullMethod: "/v1beta2.Filesystem/CreateSymlink", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).LinkPath(ctx, req.(*LinkPathRequest)) + return srv.(FilesystemServer).CreateSymlink(ctx, req.(*CreateSymlinkRequest)) } return interceptor(ctx, in, info, handler) } -func _Filesystem_IsMountPoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsMountPointRequest) +func _Filesystem_IsSymlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsSymlinkRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FilesystemServer).IsMountPoint(ctx, in) + return srv.(FilesystemServer).IsSymlink(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1beta2.Filesystem/IsMountPoint", + FullMethod: "/v1beta2.Filesystem/IsSymlink", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FilesystemServer).IsMountPoint(ctx, req.(*IsMountPointRequest)) + return srv.(FilesystemServer).IsSymlink(ctx, req.(*IsSymlinkRequest)) } return interceptor(ctx, in, info, handler) } @@ -1132,12 +1135,12 @@ var _Filesystem_serviceDesc = grpc.ServiceDesc{ Handler: _Filesystem_Rmdir_Handler, }, { - MethodName: "LinkPath", - Handler: _Filesystem_LinkPath_Handler, + MethodName: "CreateSymlink", + Handler: _Filesystem_CreateSymlink_Handler, }, { - MethodName: "IsMountPoint", - Handler: _Filesystem_IsMountPoint_Handler, + MethodName: "IsSymlink", + Handler: _Filesystem_IsSymlink_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto index ec29c5d0..938182e1 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta2/api.proto @@ -8,19 +8,20 @@ service Filesystem { // PathExists checks if the requested path exists in the host filesystem. rpc PathExists(PathExistsRequest) returns (PathExistsResponse) {} - // Mkdir creates a directory at the requested path in the host filesystem + // Mkdir creates a directory at the requested path in the host filesystem. rpc Mkdir(MkdirRequest) returns (MkdirResponse) {} // Rmdir removes the directory at the requested path in the host filesystem. - // This may be used for unlinking a symlink created through LinkPath. + // This may be used for unlinking a symlink created through CreateSymlink. rpc Rmdir(RmdirRequest) returns (RmdirResponse) {} - // LinkPath creates a local directory symbolic link between a source path - // and target path in the host's filesystem. - rpc LinkPath(LinkPathRequest) returns (LinkPathResponse) {} + // CreateSymlink creates a symbolic link called target_path that points to source_path + // in the host filesystem (target_path is the name of the symbolic link created, + // source_path is the existing path). + rpc CreateSymlink(CreateSymlinkRequest) returns (CreateSymlinkResponse) {} - // IsMountPoint checks if a given path is a mount point. - rpc IsMountPoint(IsMountPointRequest) returns (IsMountPointResponse) {} + // IsSymlink checks if a given path is a symlink. + rpc IsSymlink(IsSymlinkRequest) returns (IsSymlinkResponse) {} } // Context of the paths used for path prefix validation @@ -111,8 +112,8 @@ message RmdirResponse { // Intentionally empty. } -message LinkPathRequest { - // The path where the symlink is created in the host's filesystem. +message CreateSymlinkRequest { + // The path of the existing directory to be linked. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -128,7 +129,7 @@ message LinkPathRequest { // Maximum path length will be capped to 260 characters. string source_path = 1; - // Target path in the host's filesystem used for the symlink creation. + // Target path is the location of the new directory entry to be created in the host's filesystem. // All special characters allowed by Windows in path names will be allowed // except for restrictions noted below. For details, please check: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file @@ -146,16 +147,16 @@ message LinkPathRequest { string target_path = 2; } -message LinkPathResponse { +message CreateSymlinkResponse { // Intentionally empty. } -message IsMountPointRequest { - // The path whose existence we want to check in the host's filesystem +message IsSymlinkRequest { + // The path whose existence as a symlink we want to check in the host's filesystem. string path = 1; } -message IsMountPointResponse { - // Indicates whether the path in PathExistsRequest exists in the host's filesystem - bool is_mount_point = 1; +message IsSymlinkResponse { + // Indicates whether the path in IsSymlinkRequest is a symlink. + bool is_symlink = 1; } diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2/client_generated.go index de152607..6619eeda 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2/client_generated.go @@ -65,12 +65,12 @@ func (w *Client) Close() error { // ensures we implement all the required methods var _ v1beta2.FilesystemClient = &Client{} -func (w *Client) IsMountPoint(context context.Context, request *v1beta2.IsMountPointRequest, opts ...grpc.CallOption) (*v1beta2.IsMountPointResponse, error) { - return w.client.IsMountPoint(context, request, opts...) +func (w *Client) CreateSymlink(context context.Context, request *v1beta2.CreateSymlinkRequest, opts ...grpc.CallOption) (*v1beta2.CreateSymlinkResponse, error) { + return w.client.CreateSymlink(context, request, opts...) } -func (w *Client) LinkPath(context context.Context, request *v1beta2.LinkPathRequest, opts ...grpc.CallOption) (*v1beta2.LinkPathResponse, error) { - return w.client.LinkPath(context, request, opts...) +func (w *Client) IsSymlink(context context.Context, request *v1beta2.IsSymlinkRequest, opts ...grpc.CallOption) (*v1beta2.IsSymlinkResponse, error) { + return w.client.IsSymlink(context, request, opts...) } func (w *Client) Mkdir(context context.Context, request *v1beta2.MkdirRequest, opts ...grpc.CallOption) (*v1beta2.MkdirResponse, error) {