From c9888028354eab537dea41ef3cd75fa619aa9648 Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Sat, 7 Nov 2020 10:20:28 -0800 Subject: [PATCH] Add disk online/offline into Stage/Unstage volumes Disk might be offline when attaching to VMs due to different reasons. Add disk online logic into NodeStageVolume to make sure disk can be accessed. Also add disk offline logic into NodeUnstageVolume to make sure disk is in a clean state when detaching from VM. Disk online/offline API is in csi proxy disk.v1beta2 api group, so updating to use this group --- deploy/kubernetes/base/node_windows/node.yaml | 2 + go.mod | 2 +- go.sum | 3 + pkg/mount-manager/safe-mounter_windows.go | 35 +- .../client/api/disk/v1beta2/api.pb.go | 1028 +++++++++++++++++ .../client/api/disk/v1beta2/api.proto | 109 ++ .../groups/disk/v1beta2/client_generated.go | 80 ++ vendor/modules.txt | 6 +- 8 files changed, 1261 insertions(+), 4 deletions(-) create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go diff --git a/deploy/kubernetes/base/node_windows/node.yaml b/deploy/kubernetes/base/node_windows/node.yaml index 0e9ecf29c..e7c24a015 100644 --- a/deploy/kubernetes/base/node_windows/node.yaml +++ b/deploy/kubernetes/base/node_windows/node.yaml @@ -83,3 +83,5 @@ spec: hostPath: path: \var\lib\kubelet\plugins\pd.csi.storage.gke.io type: DirectoryOrCreate + tolerations: + - operator: Exists diff --git a/go.mod b/go.mod index 5afc6cae0..38802d845 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/golang/protobuf v1.4.2 github.com/google/uuid v1.1.1 github.com/hashicorp/go-multierror v1.0.0 // indirect - github.com/kubernetes-csi/csi-proxy/client v0.2.1 + github.com/kubernetes-csi/csi-proxy/client v0.2.2 github.com/kubernetes-csi/csi-test/v3 v3.0.0 github.com/onsi/ginkgo v1.11.0 github.com/onsi/gomega v1.7.1 diff --git a/go.sum b/go.sum index 4e77a8e37..3370814ed 100644 --- a/go.sum +++ b/go.sum @@ -476,8 +476,11 @@ github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kubernetes-csi/csi-proxy v0.2.2 h1:LqablYFEGw7FYBjwoh5TeXFzlcx8C+YQjKfGy6fFWJs= github.com/kubernetes-csi/csi-proxy/client v0.2.1 h1:n21d2U9HvgQ6jfJayafRv8kXXtLvnRNEqoD0mQNucKc= github.com/kubernetes-csi/csi-proxy/client v0.2.1/go.mod h1:6ptQQmti5QHwBxSsh8Cy00oGdogj0JXewFnu8FFjgOs= +github.com/kubernetes-csi/csi-proxy/client v0.2.2 h1:VpMddHnbYA1oBeU5nrisdyrpOAAT0HqME7fsTi6BG2w= +github.com/kubernetes-csi/csi-proxy/client v0.2.2/go.mod h1:6ptQQmti5QHwBxSsh8Cy00oGdogj0JXewFnu8FFjgOs= github.com/kubernetes-csi/csi-test/v3 v3.0.0 h1:mVsfA4J67uNm8fdF/Pr84oMqL92qjIhjWbEUH8zv1fU= github.com/kubernetes-csi/csi-test/v3 v3.0.0/go.mod h1:VdIKGnDZHOjg4M5yd0OZICtsoEzdn64d0K33N6dm35Q= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= diff --git a/pkg/mount-manager/safe-mounter_windows.go b/pkg/mount-manager/safe-mounter_windows.go index 11645c012..1eb1708c4 100644 --- a/pkg/mount-manager/safe-mounter_windows.go +++ b/pkg/mount-manager/safe-mounter_windows.go @@ -22,10 +22,11 @@ import ( "fmt" "os" "path/filepath" + "strconv" "strings" - diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta1" - diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta1" + diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" + diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2" fsapi "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1" fsclient "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1" @@ -159,6 +160,25 @@ func (mounter *CSIProxyMounter) UnmountDevice(target string) error { if err != nil { return err } + + // Set disk to offline mode to have a clean state + getDiskNumberRequest := &volumeapi.VolumeDiskNumberRequest{ + VolumeId: volumeId, + } + id, err := mounter.VolumeClient.GetVolumeDiskNumber(context.Background(), getDiskNumberRequest) + if err != nil { + return err + } + diskId := id.GetDiskNumber() + klog.V(4).Infof("get disk number %d from volume %s", diskId, volumeId) + setDiskRequest := &diskapi.SetAttachStateRequest{ + DiskID: strconv.FormatInt(diskId, 10), + IsOnline: false, + } + if _, err = mounter.DiskClient.SetAttachState(context.Background(), setDiskRequest); err != nil { + return err + } + return nil } @@ -203,6 +223,17 @@ func (mounter *CSIProxyMounter) FormatAndMount(source string, target string, fst if err != nil { return err } + + // make sure disk is online. if disk is already online, this call should also succeed. + setDiskRequest := &diskapi.SetAttachStateRequest{ + DiskID: source, + IsOnline: true, + } + _, err = mounter.DiskClient.SetAttachState(context.Background(), setDiskRequest) + if err != nil { + return err + } + volumeIDsRequest := &volumeapi.ListVolumesOnDiskRequest{ DiskId: source, } diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go new file mode 100644 index 000000000..27324f1ea --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.pb.go @@ -0,0 +1,1028 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto + +package v1beta2 + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type ListDiskLocationsRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListDiskLocationsRequest) Reset() { *m = ListDiskLocationsRequest{} } +func (m *ListDiskLocationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListDiskLocationsRequest) ProtoMessage() {} +func (*ListDiskLocationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{0} +} + +func (m *ListDiskLocationsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListDiskLocationsRequest.Unmarshal(m, b) +} +func (m *ListDiskLocationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListDiskLocationsRequest.Marshal(b, m, deterministic) +} +func (m *ListDiskLocationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDiskLocationsRequest.Merge(m, src) +} +func (m *ListDiskLocationsRequest) XXX_Size() int { + return xxx_messageInfo_ListDiskLocationsRequest.Size(m) +} +func (m *ListDiskLocationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListDiskLocationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDiskLocationsRequest proto.InternalMessageInfo + +type DiskLocation struct { + Adapter string `protobuf:"bytes,1,opt,name=Adapter,proto3" json:"Adapter,omitempty"` + Bus string `protobuf:"bytes,2,opt,name=Bus,proto3" json:"Bus,omitempty"` + Target string `protobuf:"bytes,3,opt,name=Target,proto3" json:"Target,omitempty"` + LUNID string `protobuf:"bytes,4,opt,name=LUNID,proto3" json:"LUNID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DiskLocation) Reset() { *m = DiskLocation{} } +func (m *DiskLocation) String() string { return proto.CompactTextString(m) } +func (*DiskLocation) ProtoMessage() {} +func (*DiskLocation) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{1} +} + +func (m *DiskLocation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DiskLocation.Unmarshal(m, b) +} +func (m *DiskLocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DiskLocation.Marshal(b, m, deterministic) +} +func (m *DiskLocation) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiskLocation.Merge(m, src) +} +func (m *DiskLocation) XXX_Size() int { + return xxx_messageInfo_DiskLocation.Size(m) +} +func (m *DiskLocation) XXX_DiscardUnknown() { + xxx_messageInfo_DiskLocation.DiscardUnknown(m) +} + +var xxx_messageInfo_DiskLocation proto.InternalMessageInfo + +func (m *DiskLocation) GetAdapter() string { + if m != nil { + return m.Adapter + } + return "" +} + +func (m *DiskLocation) GetBus() string { + if m != nil { + return m.Bus + } + return "" +} + +func (m *DiskLocation) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + +func (m *DiskLocation) GetLUNID() string { + if m != nil { + return m.LUNID + } + return "" +} + +type ListDiskLocationsResponse struct { + // Map of disk device IDs and associated with each disk device + DiskLocations map[string]*DiskLocation `protobuf:"bytes,1,rep,name=disk_locations,json=diskLocations,proto3" json:"disk_locations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListDiskLocationsResponse) Reset() { *m = ListDiskLocationsResponse{} } +func (m *ListDiskLocationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListDiskLocationsResponse) ProtoMessage() {} +func (*ListDiskLocationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{2} +} + +func (m *ListDiskLocationsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListDiskLocationsResponse.Unmarshal(m, b) +} +func (m *ListDiskLocationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListDiskLocationsResponse.Marshal(b, m, deterministic) +} +func (m *ListDiskLocationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDiskLocationsResponse.Merge(m, src) +} +func (m *ListDiskLocationsResponse) XXX_Size() int { + return xxx_messageInfo_ListDiskLocationsResponse.Size(m) +} +func (m *ListDiskLocationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListDiskLocationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDiskLocationsResponse proto.InternalMessageInfo + +func (m *ListDiskLocationsResponse) GetDiskLocations() map[string]*DiskLocation { + if m != nil { + return m.DiskLocations + } + return nil +} + +type PartitionDiskRequest struct { + // Disk device ID of the disk to partition + DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PartitionDiskRequest) Reset() { *m = PartitionDiskRequest{} } +func (m *PartitionDiskRequest) String() string { return proto.CompactTextString(m) } +func (*PartitionDiskRequest) ProtoMessage() {} +func (*PartitionDiskRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{3} +} + +func (m *PartitionDiskRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PartitionDiskRequest.Unmarshal(m, b) +} +func (m *PartitionDiskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PartitionDiskRequest.Marshal(b, m, deterministic) +} +func (m *PartitionDiskRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartitionDiskRequest.Merge(m, src) +} +func (m *PartitionDiskRequest) XXX_Size() int { + return xxx_messageInfo_PartitionDiskRequest.Size(m) +} +func (m *PartitionDiskRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PartitionDiskRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PartitionDiskRequest proto.InternalMessageInfo + +func (m *PartitionDiskRequest) GetDiskID() string { + if m != nil { + return m.DiskID + } + return "" +} + +type PartitionDiskResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PartitionDiskResponse) Reset() { *m = PartitionDiskResponse{} } +func (m *PartitionDiskResponse) String() string { return proto.CompactTextString(m) } +func (*PartitionDiskResponse) ProtoMessage() {} +func (*PartitionDiskResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{4} +} + +func (m *PartitionDiskResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PartitionDiskResponse.Unmarshal(m, b) +} +func (m *PartitionDiskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PartitionDiskResponse.Marshal(b, m, deterministic) +} +func (m *PartitionDiskResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartitionDiskResponse.Merge(m, src) +} +func (m *PartitionDiskResponse) XXX_Size() int { + return xxx_messageInfo_PartitionDiskResponse.Size(m) +} +func (m *PartitionDiskResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PartitionDiskResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PartitionDiskResponse proto.InternalMessageInfo + +type RescanRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RescanRequest) Reset() { *m = RescanRequest{} } +func (m *RescanRequest) String() string { return proto.CompactTextString(m) } +func (*RescanRequest) ProtoMessage() {} +func (*RescanRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{5} +} + +func (m *RescanRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RescanRequest.Unmarshal(m, b) +} +func (m *RescanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RescanRequest.Marshal(b, m, deterministic) +} +func (m *RescanRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RescanRequest.Merge(m, src) +} +func (m *RescanRequest) XXX_Size() int { + return xxx_messageInfo_RescanRequest.Size(m) +} +func (m *RescanRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RescanRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RescanRequest proto.InternalMessageInfo + +type RescanResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RescanResponse) Reset() { *m = RescanResponse{} } +func (m *RescanResponse) String() string { return proto.CompactTextString(m) } +func (*RescanResponse) ProtoMessage() {} +func (*RescanResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{6} +} + +func (m *RescanResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RescanResponse.Unmarshal(m, b) +} +func (m *RescanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RescanResponse.Marshal(b, m, deterministic) +} +func (m *RescanResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RescanResponse.Merge(m, src) +} +func (m *RescanResponse) XXX_Size() int { + return xxx_messageInfo_RescanResponse.Size(m) +} +func (m *RescanResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RescanResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RescanResponse proto.InternalMessageInfo + +type ListDiskIDsRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListDiskIDsRequest) Reset() { *m = ListDiskIDsRequest{} } +func (m *ListDiskIDsRequest) String() string { return proto.CompactTextString(m) } +func (*ListDiskIDsRequest) ProtoMessage() {} +func (*ListDiskIDsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{7} +} + +func (m *ListDiskIDsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListDiskIDsRequest.Unmarshal(m, b) +} +func (m *ListDiskIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListDiskIDsRequest.Marshal(b, m, deterministic) +} +func (m *ListDiskIDsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDiskIDsRequest.Merge(m, src) +} +func (m *ListDiskIDsRequest) XXX_Size() int { + return xxx_messageInfo_ListDiskIDsRequest.Size(m) +} +func (m *ListDiskIDsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListDiskIDsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDiskIDsRequest proto.InternalMessageInfo + +type DiskIDs struct { + // Map of Disk ID types and Disk ID values + Identifiers map[string]string `protobuf:"bytes,1,rep,name=identifiers,proto3" json:"identifiers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DiskIDs) Reset() { *m = DiskIDs{} } +func (m *DiskIDs) String() string { return proto.CompactTextString(m) } +func (*DiskIDs) ProtoMessage() {} +func (*DiskIDs) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{8} +} + +func (m *DiskIDs) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DiskIDs.Unmarshal(m, b) +} +func (m *DiskIDs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DiskIDs.Marshal(b, m, deterministic) +} +func (m *DiskIDs) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiskIDs.Merge(m, src) +} +func (m *DiskIDs) XXX_Size() int { + return xxx_messageInfo_DiskIDs.Size(m) +} +func (m *DiskIDs) XXX_DiscardUnknown() { + xxx_messageInfo_DiskIDs.DiscardUnknown(m) +} + +var xxx_messageInfo_DiskIDs proto.InternalMessageInfo + +func (m *DiskIDs) GetIdentifiers() map[string]string { + if m != nil { + return m.Identifiers + } + return nil +} + +type ListDiskIDsResponse struct { + // Map of disk device numbers and IDs associated with each disk device + DiskIDs map[string]*DiskIDs `protobuf:"bytes,1,rep,name=diskIDs,proto3" json:"diskIDs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListDiskIDsResponse) Reset() { *m = ListDiskIDsResponse{} } +func (m *ListDiskIDsResponse) String() string { return proto.CompactTextString(m) } +func (*ListDiskIDsResponse) ProtoMessage() {} +func (*ListDiskIDsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{9} +} + +func (m *ListDiskIDsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListDiskIDsResponse.Unmarshal(m, b) +} +func (m *ListDiskIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListDiskIDsResponse.Marshal(b, m, deterministic) +} +func (m *ListDiskIDsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListDiskIDsResponse.Merge(m, src) +} +func (m *ListDiskIDsResponse) XXX_Size() int { + return xxx_messageInfo_ListDiskIDsResponse.Size(m) +} +func (m *ListDiskIDsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListDiskIDsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListDiskIDsResponse proto.InternalMessageInfo + +func (m *ListDiskIDsResponse) GetDiskIDs() map[string]*DiskIDs { + if m != nil { + return m.DiskIDs + } + return nil +} + +type DiskStatsRequest struct { + // Disk device ID of the disk to get the size from + DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DiskStatsRequest) Reset() { *m = DiskStatsRequest{} } +func (m *DiskStatsRequest) String() string { return proto.CompactTextString(m) } +func (*DiskStatsRequest) ProtoMessage() {} +func (*DiskStatsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{10} +} + +func (m *DiskStatsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DiskStatsRequest.Unmarshal(m, b) +} +func (m *DiskStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DiskStatsRequest.Marshal(b, m, deterministic) +} +func (m *DiskStatsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiskStatsRequest.Merge(m, src) +} +func (m *DiskStatsRequest) XXX_Size() int { + return xxx_messageInfo_DiskStatsRequest.Size(m) +} +func (m *DiskStatsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DiskStatsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DiskStatsRequest proto.InternalMessageInfo + +func (m *DiskStatsRequest) GetDiskID() string { + if m != nil { + return m.DiskID + } + return "" +} + +type DiskStatsResponse struct { + //Total size of the volume + DiskSize int64 `protobuf:"varint,1,opt,name=diskSize,proto3" json:"diskSize,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DiskStatsResponse) Reset() { *m = DiskStatsResponse{} } +func (m *DiskStatsResponse) String() string { return proto.CompactTextString(m) } +func (*DiskStatsResponse) ProtoMessage() {} +func (*DiskStatsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{11} +} + +func (m *DiskStatsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DiskStatsResponse.Unmarshal(m, b) +} +func (m *DiskStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DiskStatsResponse.Marshal(b, m, deterministic) +} +func (m *DiskStatsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiskStatsResponse.Merge(m, src) +} +func (m *DiskStatsResponse) XXX_Size() int { + return xxx_messageInfo_DiskStatsResponse.Size(m) +} +func (m *DiskStatsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DiskStatsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DiskStatsResponse proto.InternalMessageInfo + +func (m *DiskStatsResponse) GetDiskSize() int64 { + if m != nil { + return m.DiskSize + } + return 0 +} + +type SetAttachStateRequest struct { + // Disk device ID (number) of the disk which state will change + DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` + // Online state to set for the disk. true for online, false for offline + IsOnline bool `protobuf:"varint,2,opt,name=isOnline,proto3" json:"isOnline,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetAttachStateRequest) Reset() { *m = SetAttachStateRequest{} } +func (m *SetAttachStateRequest) String() string { return proto.CompactTextString(m) } +func (*SetAttachStateRequest) ProtoMessage() {} +func (*SetAttachStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{12} +} + +func (m *SetAttachStateRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetAttachStateRequest.Unmarshal(m, b) +} +func (m *SetAttachStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetAttachStateRequest.Marshal(b, m, deterministic) +} +func (m *SetAttachStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetAttachStateRequest.Merge(m, src) +} +func (m *SetAttachStateRequest) XXX_Size() int { + return xxx_messageInfo_SetAttachStateRequest.Size(m) +} +func (m *SetAttachStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetAttachStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SetAttachStateRequest proto.InternalMessageInfo + +func (m *SetAttachStateRequest) GetDiskID() string { + if m != nil { + return m.DiskID + } + return "" +} + +func (m *SetAttachStateRequest) GetIsOnline() bool { + if m != nil { + return m.IsOnline + } + return false +} + +type SetAttachStateResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetAttachStateResponse) Reset() { *m = SetAttachStateResponse{} } +func (m *SetAttachStateResponse) String() string { return proto.CompactTextString(m) } +func (*SetAttachStateResponse) ProtoMessage() {} +func (*SetAttachStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{13} +} + +func (m *SetAttachStateResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetAttachStateResponse.Unmarshal(m, b) +} +func (m *SetAttachStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetAttachStateResponse.Marshal(b, m, deterministic) +} +func (m *SetAttachStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetAttachStateResponse.Merge(m, src) +} +func (m *SetAttachStateResponse) XXX_Size() int { + return xxx_messageInfo_SetAttachStateResponse.Size(m) +} +func (m *SetAttachStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SetAttachStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SetAttachStateResponse proto.InternalMessageInfo + +type GetAttachStateRequest struct { + // Disk device ID (number) of the disk + DiskID string `protobuf:"bytes,1,opt,name=diskID,proto3" json:"diskID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAttachStateRequest) Reset() { *m = GetAttachStateRequest{} } +func (m *GetAttachStateRequest) String() string { return proto.CompactTextString(m) } +func (*GetAttachStateRequest) ProtoMessage() {} +func (*GetAttachStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{14} +} + +func (m *GetAttachStateRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAttachStateRequest.Unmarshal(m, b) +} +func (m *GetAttachStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAttachStateRequest.Marshal(b, m, deterministic) +} +func (m *GetAttachStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAttachStateRequest.Merge(m, src) +} +func (m *GetAttachStateRequest) XXX_Size() int { + return xxx_messageInfo_GetAttachStateRequest.Size(m) +} +func (m *GetAttachStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAttachStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAttachStateRequest proto.InternalMessageInfo + +func (m *GetAttachStateRequest) GetDiskID() string { + if m != nil { + return m.DiskID + } + return "" +} + +type GetAttachStateResponse struct { + // Online state of the disk. true for online, false for offline + IsOnline bool `protobuf:"varint,1,opt,name=isOnline,proto3" json:"isOnline,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAttachStateResponse) Reset() { *m = GetAttachStateResponse{} } +func (m *GetAttachStateResponse) String() string { return proto.CompactTextString(m) } +func (*GetAttachStateResponse) ProtoMessage() {} +func (*GetAttachStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8298108b4474af1, []int{15} +} + +func (m *GetAttachStateResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAttachStateResponse.Unmarshal(m, b) +} +func (m *GetAttachStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAttachStateResponse.Marshal(b, m, deterministic) +} +func (m *GetAttachStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAttachStateResponse.Merge(m, src) +} +func (m *GetAttachStateResponse) XXX_Size() int { + return xxx_messageInfo_GetAttachStateResponse.Size(m) +} +func (m *GetAttachStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetAttachStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAttachStateResponse proto.InternalMessageInfo + +func (m *GetAttachStateResponse) GetIsOnline() bool { + if m != nil { + return m.IsOnline + } + return false +} + +func init() { + proto.RegisterType((*ListDiskLocationsRequest)(nil), "v1beta2.ListDiskLocationsRequest") + proto.RegisterType((*DiskLocation)(nil), "v1beta2.DiskLocation") + proto.RegisterType((*ListDiskLocationsResponse)(nil), "v1beta2.ListDiskLocationsResponse") + proto.RegisterMapType((map[string]*DiskLocation)(nil), "v1beta2.ListDiskLocationsResponse.DiskLocationsEntry") + proto.RegisterType((*PartitionDiskRequest)(nil), "v1beta2.PartitionDiskRequest") + proto.RegisterType((*PartitionDiskResponse)(nil), "v1beta2.PartitionDiskResponse") + proto.RegisterType((*RescanRequest)(nil), "v1beta2.RescanRequest") + proto.RegisterType((*RescanResponse)(nil), "v1beta2.RescanResponse") + proto.RegisterType((*ListDiskIDsRequest)(nil), "v1beta2.ListDiskIDsRequest") + proto.RegisterType((*DiskIDs)(nil), "v1beta2.DiskIDs") + proto.RegisterMapType((map[string]string)(nil), "v1beta2.DiskIDs.IdentifiersEntry") + proto.RegisterType((*ListDiskIDsResponse)(nil), "v1beta2.ListDiskIDsResponse") + proto.RegisterMapType((map[string]*DiskIDs)(nil), "v1beta2.ListDiskIDsResponse.DiskIDsEntry") + proto.RegisterType((*DiskStatsRequest)(nil), "v1beta2.DiskStatsRequest") + proto.RegisterType((*DiskStatsResponse)(nil), "v1beta2.DiskStatsResponse") + proto.RegisterType((*SetAttachStateRequest)(nil), "v1beta2.SetAttachStateRequest") + proto.RegisterType((*SetAttachStateResponse)(nil), "v1beta2.SetAttachStateResponse") + proto.RegisterType((*GetAttachStateRequest)(nil), "v1beta2.GetAttachStateRequest") + proto.RegisterType((*GetAttachStateResponse)(nil), "v1beta2.GetAttachStateResponse") +} + +func init() { + proto.RegisterFile("github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto", fileDescriptor_b8298108b4474af1) +} + +var fileDescriptor_b8298108b4474af1 = []byte{ + // 647 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 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d, 0x83, + 0xa7, 0xc9, 0xaf, 0xa0, 0xa4, 0xec, 0x26, 0xba, 0x99, 0xbf, 0xb1, 0x31, 0xcd, 0xad, 0xeb, 0xd6, + 0x19, 0x2f, 0x21, 0x1b, 0x36, 0xd2, 0x05, 0x42, 0x3b, 0x99, 0xb5, 0x54, 0x17, 0xd0, 0x30, 0xf2, + 0x5c, 0x29, 0x4b, 0x07, 0xca, 0xd9, 0x45, 0x40, 0x57, 0x2d, 0xc8, 0x5d, 0x37, 0xe3, 0xee, 0x5c, + 0xbf, 0x4a, 0xda, 0x9c, 0x47, 0xda, 0x5c, 0x40, 0xda, 0x9c, 0x43, 0x7a, 0xfc, 0xe2, 0xe3, 0xe1, + 0x3f, 0xfc, 0xc7, 0xba, 0x6b, 0xd1, 0x4f, 0xec, 0xf1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, + 0x06, 0xb4, 0xd5, 0x0d, 0x07, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// DiskClient is the client API for Disk service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type DiskClient interface { + // ListDiskLocations returns locations of all + // disk devices enumerated by the host + ListDiskLocations(ctx context.Context, in *ListDiskLocationsRequest, opts ...grpc.CallOption) (*ListDiskLocationsResponse, error) + // PartitionDisk initializes and partitions a disk device (if the disk has not + // been partitioned already) and returns the resulting volume device ID + PartitionDisk(ctx context.Context, in *PartitionDiskRequest, opts ...grpc.CallOption) (*PartitionDiskResponse, error) + // Rescan refreshes the host's storage cache + Rescan(ctx context.Context, in *RescanRequest, opts ...grpc.CallOption) (*RescanResponse, error) + // ListDiskIDs returns a map of DiskID objects where the key is the disk number + ListDiskIDs(ctx context.Context, in *ListDiskIDsRequest, opts ...grpc.CallOption) (*ListDiskIDsResponse, error) + // DiskStats returns the stats for the disk + DiskStats(ctx context.Context, in *DiskStatsRequest, opts ...grpc.CallOption) (*DiskStatsResponse, error) + // SetAttachState sets the offline/online state of a disk + SetAttachState(ctx context.Context, in *SetAttachStateRequest, opts ...grpc.CallOption) (*SetAttachStateResponse, error) + // GetAttachState gets the offline/online state of a disk + GetAttachState(ctx context.Context, in *GetAttachStateRequest, opts ...grpc.CallOption) (*GetAttachStateResponse, error) +} + +type diskClient struct { + cc grpc.ClientConnInterface +} + +func NewDiskClient(cc grpc.ClientConnInterface) DiskClient { + return &diskClient{cc} +} + +func (c *diskClient) ListDiskLocations(ctx context.Context, in *ListDiskLocationsRequest, opts ...grpc.CallOption) (*ListDiskLocationsResponse, error) { + out := new(ListDiskLocationsResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Disk/ListDiskLocations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diskClient) PartitionDisk(ctx context.Context, in *PartitionDiskRequest, opts ...grpc.CallOption) (*PartitionDiskResponse, error) { + out := new(PartitionDiskResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Disk/PartitionDisk", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diskClient) Rescan(ctx context.Context, in *RescanRequest, opts ...grpc.CallOption) (*RescanResponse, error) { + out := new(RescanResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Disk/Rescan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diskClient) ListDiskIDs(ctx context.Context, in *ListDiskIDsRequest, opts ...grpc.CallOption) (*ListDiskIDsResponse, error) { + out := new(ListDiskIDsResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Disk/ListDiskIDs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diskClient) DiskStats(ctx context.Context, in *DiskStatsRequest, opts ...grpc.CallOption) (*DiskStatsResponse, error) { + out := new(DiskStatsResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Disk/DiskStats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diskClient) SetAttachState(ctx context.Context, in *SetAttachStateRequest, opts ...grpc.CallOption) (*SetAttachStateResponse, error) { + out := new(SetAttachStateResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Disk/SetAttachState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diskClient) GetAttachState(ctx context.Context, in *GetAttachStateRequest, opts ...grpc.CallOption) (*GetAttachStateResponse, error) { + out := new(GetAttachStateResponse) + err := c.cc.Invoke(ctx, "/v1beta2.Disk/GetAttachState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DiskServer is the server API for Disk service. +type DiskServer interface { + // ListDiskLocations returns locations of all + // disk devices enumerated by the host + ListDiskLocations(context.Context, *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) + // PartitionDisk initializes and partitions a disk device (if the disk has not + // been partitioned already) and returns the resulting volume device ID + PartitionDisk(context.Context, *PartitionDiskRequest) (*PartitionDiskResponse, error) + // Rescan refreshes the host's storage cache + Rescan(context.Context, *RescanRequest) (*RescanResponse, error) + // ListDiskIDs returns a map of DiskID objects where the key is the disk number + ListDiskIDs(context.Context, *ListDiskIDsRequest) (*ListDiskIDsResponse, error) + // DiskStats returns the stats for the disk + DiskStats(context.Context, *DiskStatsRequest) (*DiskStatsResponse, error) + // SetAttachState sets the offline/online state of a disk + SetAttachState(context.Context, *SetAttachStateRequest) (*SetAttachStateResponse, error) + // GetAttachState gets the offline/online state of a disk + GetAttachState(context.Context, *GetAttachStateRequest) (*GetAttachStateResponse, error) +} + +// UnimplementedDiskServer can be embedded to have forward compatible implementations. +type UnimplementedDiskServer struct { +} + +func (*UnimplementedDiskServer) ListDiskLocations(ctx context.Context, req *ListDiskLocationsRequest) (*ListDiskLocationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDiskLocations not implemented") +} +func (*UnimplementedDiskServer) PartitionDisk(ctx context.Context, req *PartitionDiskRequest) (*PartitionDiskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PartitionDisk not implemented") +} +func (*UnimplementedDiskServer) Rescan(ctx context.Context, req *RescanRequest) (*RescanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Rescan not implemented") +} +func (*UnimplementedDiskServer) ListDiskIDs(ctx context.Context, req *ListDiskIDsRequest) (*ListDiskIDsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDiskIDs not implemented") +} +func (*UnimplementedDiskServer) DiskStats(ctx context.Context, req *DiskStatsRequest) (*DiskStatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DiskStats not implemented") +} +func (*UnimplementedDiskServer) SetAttachState(ctx context.Context, req *SetAttachStateRequest) (*SetAttachStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetAttachState not implemented") +} +func (*UnimplementedDiskServer) GetAttachState(ctx context.Context, req *GetAttachStateRequest) (*GetAttachStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAttachState not implemented") +} + +func RegisterDiskServer(s *grpc.Server, srv DiskServer) { + s.RegisterService(&_Disk_serviceDesc, srv) +} + +func _Disk_ListDiskLocations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDiskLocationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiskServer).ListDiskLocations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta2.Disk/ListDiskLocations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiskServer).ListDiskLocations(ctx, req.(*ListDiskLocationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Disk_PartitionDisk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PartitionDiskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiskServer).PartitionDisk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta2.Disk/PartitionDisk", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiskServer).PartitionDisk(ctx, req.(*PartitionDiskRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Disk_Rescan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RescanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiskServer).Rescan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta2.Disk/Rescan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiskServer).Rescan(ctx, req.(*RescanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Disk_ListDiskIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDiskIDsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiskServer).ListDiskIDs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta2.Disk/ListDiskIDs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiskServer).ListDiskIDs(ctx, req.(*ListDiskIDsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Disk_DiskStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DiskStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiskServer).DiskStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta2.Disk/DiskStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiskServer).DiskStats(ctx, req.(*DiskStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Disk_SetAttachState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetAttachStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiskServer).SetAttachState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta2.Disk/SetAttachState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiskServer).SetAttachState(ctx, req.(*SetAttachStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Disk_GetAttachState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAttachStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiskServer).GetAttachState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta2.Disk/GetAttachState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiskServer).GetAttachState(ctx, req.(*GetAttachStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Disk_serviceDesc = grpc.ServiceDesc{ + ServiceName: "v1beta2.Disk", + HandlerType: (*DiskServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListDiskLocations", + Handler: _Disk_ListDiskLocations_Handler, + }, + { + MethodName: "PartitionDisk", + Handler: _Disk_PartitionDisk_Handler, + }, + { + MethodName: "Rescan", + Handler: _Disk_Rescan_Handler, + }, + { + MethodName: "ListDiskIDs", + Handler: _Disk_ListDiskIDs_Handler, + }, + { + MethodName: "DiskStats", + Handler: _Disk_DiskStats_Handler, + }, + { + MethodName: "SetAttachState", + Handler: _Disk_SetAttachState_Handler, + }, + { + MethodName: "GetAttachState", + Handler: _Disk_GetAttachState_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto", +} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto new file mode 100644 index 000000000..c9f6c8f8e --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2/api.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; + +package v1beta2; + +option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2"; + +service Disk { + // ListDiskLocations returns locations of all + // disk devices enumerated by the host + rpc ListDiskLocations(ListDiskLocationsRequest) returns (ListDiskLocationsResponse) {} + + // PartitionDisk initializes and partitions a disk device (if the disk has not + // been partitioned already) and returns the resulting volume device ID + rpc PartitionDisk(PartitionDiskRequest) returns (PartitionDiskResponse) {} + + // Rescan refreshes the host's storage cache + rpc Rescan(RescanRequest) returns (RescanResponse) {} + + // ListDiskIDs returns a map of DiskID objects where the key is the disk number + rpc ListDiskIDs(ListDiskIDsRequest) returns (ListDiskIDsResponse) {} + + // DiskStats returns the stats for the disk + rpc DiskStats(DiskStatsRequest) returns (DiskStatsResponse) {} + + // SetAttachState sets the offline/online state of a disk + rpc SetAttachState(SetAttachStateRequest) returns (SetAttachStateResponse) {} + + // GetAttachState gets the offline/online state of a disk + rpc GetAttachState(GetAttachStateRequest) returns (GetAttachStateResponse) {} +} + +message ListDiskLocationsRequest { + // Intentionally empty +} + +message DiskLocation { + string Adapter = 1; + string Bus = 2; + string Target = 3; + string LUNID = 4; +} + +message ListDiskLocationsResponse { + // Map of disk device IDs and associated with each disk device + map disk_locations = 1; +} + +message PartitionDiskRequest { + // Disk device ID of the disk to partition + string diskID = 1; +} + +message PartitionDiskResponse { + // Intentionally empty +} + +message RescanRequest { + // Intentionally empty +} + +message RescanResponse { + // Intentionally empty +} + +message ListDiskIDsRequest { + // Intentionally empty +} + +message DiskIDs { + // Map of Disk ID types and Disk ID values + map identifiers = 1; +} + +message ListDiskIDsResponse { + // Map of disk device numbers and IDs associated with each disk device + map diskIDs = 1; +} + +message DiskStatsRequest { + // Disk device ID of the disk to get the size from + string diskID = 1; +} + +message DiskStatsResponse { + //Total size of the volume + int64 diskSize = 1; +} + +message SetAttachStateRequest { + // Disk device ID (number) of the disk which state will change + string diskID = 1; + + // Online state to set for the disk. true for online, false for offline + bool isOnline = 2; +} + +message SetAttachStateResponse { +} + +message GetAttachStateRequest { + // Disk device ID (number) of the disk + string diskID = 1; +} + +message GetAttachStateResponse { + // Online state of the disk. true for online, false for offline + bool isOnline = 1; +} + diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go new file mode 100644 index 000000000..a5e85d813 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go @@ -0,0 +1,80 @@ +// Code generated by csi-proxy-api-gen. DO NOT EDIT. + +package v1beta2 + +import ( + "context" + "net" + + "github.com/Microsoft/go-winio" + "github.com/kubernetes-csi/csi-proxy/client" + "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" + "github.com/kubernetes-csi/csi-proxy/client/apiversion" + "google.golang.org/grpc" +) + +const groupName = "disk" + +var version = apiversion.NewVersionOrPanic("v1beta2") + +type Client struct { + client v1beta2.DiskClient + connection *grpc.ClientConn +} + +// NewClient returns a client to make calls to the disk API group version v1beta2. +// It's the caller's responsibility to Close the client when done. +func NewClient() (*Client, error) { + pipePath := client.PipePath(groupName, version) + + 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 := v1beta2.NewDiskClient(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 _ v1beta2.DiskClient = &Client{} + +func (w *Client) DiskStats(context context.Context, request *v1beta2.DiskStatsRequest, opts ...grpc.CallOption) (*v1beta2.DiskStatsResponse, error) { + return w.client.DiskStats(context, request, opts...) +} + +func (w *Client) GetAttachState(context context.Context, request *v1beta2.GetAttachStateRequest, opts ...grpc.CallOption) (*v1beta2.GetAttachStateResponse, error) { + return w.client.GetAttachState(context, request, opts...) +} + +func (w *Client) ListDiskIDs(context context.Context, request *v1beta2.ListDiskIDsRequest, opts ...grpc.CallOption) (*v1beta2.ListDiskIDsResponse, error) { + return w.client.ListDiskIDs(context, request, opts...) +} + +func (w *Client) ListDiskLocations(context context.Context, request *v1beta2.ListDiskLocationsRequest, opts ...grpc.CallOption) (*v1beta2.ListDiskLocationsResponse, error) { + return w.client.ListDiskLocations(context, request, opts...) +} + +func (w *Client) PartitionDisk(context context.Context, request *v1beta2.PartitionDiskRequest, opts ...grpc.CallOption) (*v1beta2.PartitionDiskResponse, error) { + return w.client.PartitionDisk(context, request, opts...) +} + +func (w *Client) Rescan(context context.Context, request *v1beta2.RescanRequest, opts ...grpc.CallOption) (*v1beta2.RescanResponse, error) { + return w.client.Rescan(context, request, opts...) +} + +func (w *Client) SetAttachState(context context.Context, request *v1beta2.SetAttachStateRequest, opts ...grpc.CallOption) (*v1beta2.SetAttachStateResponse, error) { + return w.client.SetAttachState(context, request, opts...) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 587dc05b8..844cb2361 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -56,15 +56,19 @@ github.com/imdario/mergo github.com/json-iterator/go # github.com/konsorten/go-windows-terminal-sequences v1.0.2 github.com/konsorten/go-windows-terminal-sequences -# github.com/kubernetes-csi/csi-proxy/client v0.2.1 +# github.com/kubernetes-csi/csi-proxy/client v0.2.2 github.com/kubernetes-csi/csi-proxy/client github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta1 +github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2 github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1 github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1 +github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2 github.com/kubernetes-csi/csi-proxy/client/apiversion 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/filesystem/v1beta1 github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1 +github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta2 # github.com/kubernetes-csi/csi-test/v3 v3.0.0 github.com/kubernetes-csi/csi-test/v3/pkg/sanity github.com/kubernetes-csi/csi-test/v3/utils