From af0253a17b27a1107490541e0f34ebdd61dd693b Mon Sep 17 00:00:00 2001 From: Andrey Schipilo Date: Wed, 15 Dec 2021 13:47:39 +0300 Subject: [PATCH 1/2] Added registration for VGS and replication CSI extension using updated csi-extensions --- go.mod | 10 +++++++++- go.sum | 19 ++++++++++++++++--- pkg/controller/controller.go | 11 +++++++++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 8b5812a9..1f5ed4d3 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,9 @@ require ( github.com/HdrHistogram/hdrhistogram-go v1.0.1 // indirect github.com/akutz/gosync v0.1.0 github.com/container-storage-interface/spec v1.5.0 + github.com/dell/dell-csi-extensions/common v1.0.0 github.com/dell/dell-csi-extensions/replication v1.0.0 + github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.0.0 github.com/dell/gobrick v1.2.0 github.com/dell/gocsi v1.5.0 github.com/dell/gofsutil v1.6.0 @@ -26,11 +28,17 @@ require ( github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/uber/jaeger-lib v2.4.0+incompatible golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 - google.golang.org/grpc v1.38.0 + google.golang.org/grpc v1.42.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b k8s.io/kubernetes v1.21.5 ) +replace ( + github.com/dell/dell-csi-extensions/common v1.0.0 => github.com/dell/dell-csi-extensions/common v0.0.0-20211215102840-e20060eb09e7 + github.com/dell/dell-csi-extensions/replication v1.0.0 => github.com/dell/dell-csi-extensions/replication v0.0.0-20211215102840-e20060eb09e7 + github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.0.0 => github.com/dell/dell-csi-extensions/volumeGroupSnapshot v0.0.0-20211215102840-e20060eb09e7 +) + replace ( k8s.io/api => k8s.io/api v0.20.2 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.20.2 diff --git a/go.sum b/go.sum index 6135eb0a..2b0ab04c 100644 --- a/go.sum +++ b/go.sum @@ -106,6 +106,10 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/container-storage-interface/spec v1.3.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= github.com/container-storage-interface/spec v1.5.0 h1:lvKxe3uLgqQeVQcrnL2CPQKISoKjTJxojEs9cBk+HXo= @@ -151,8 +155,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/dell/dell-csi-extensions/replication v1.0.0 h1:fLcn4xhVO7Xt5t8ZIwDu57vAtL3LWbdYF94W9bpWS/Y= -github.com/dell/dell-csi-extensions/replication v1.0.0/go.mod h1:DbHqsh4vpC+SajnrDSAwWE8n556GSSyzOAEBX7tcCUg= +github.com/dell/dell-csi-extensions/common v0.0.0-20211215102840-e20060eb09e7 h1:nCyCv6aj56a0CWDflTNaYTT2jBHZg3naAwBvNk8CHnU= +github.com/dell/dell-csi-extensions/common v0.0.0-20211215102840-e20060eb09e7/go.mod h1:HCs4rWiZJ1hcwfhCsr5sBsi+/5E8zuBZ+VG7qwiHOsU= +github.com/dell/dell-csi-extensions/replication v0.0.0-20211215102840-e20060eb09e7 h1:Fi+errYN4Yvox5XWsCuh4hXUBLYamoh/xn6s0EFe7Mg= +github.com/dell/dell-csi-extensions/replication v0.0.0-20211215102840-e20060eb09e7/go.mod h1:4HmEaGdARuxeCT+pqGIFdcmF2Q45810PgCbIxJopKHQ= +github.com/dell/dell-csi-extensions/volumeGroupSnapshot v0.0.0-20211215102840-e20060eb09e7 h1:cEslTtYxWDc7oju0Z58cZU7gEdu6YlG4NEKVVh1KZTo= +github.com/dell/dell-csi-extensions/volumeGroupSnapshot v0.0.0-20211215102840-e20060eb09e7/go.mod h1:jfpjS6YywYdApbmkRYHSeqYhKVOJZMSH9SGbb4ig2qI= github.com/dell/gobrick v1.2.0 h1:dlgWgonXG7qoa+SXlek/NkdFBnfxgqSv+8tsHIBIEDg= github.com/dell/gobrick v1.2.0/go.mod h1:pYN9r3XvIjct/QkEg5mEM+k2L3QBLVaHUZeAMzQgwRg= github.com/dell/gocsi v1.5.0 h1:qi2T6H6JHDo9sJEw24jo6Z88fJszBXfQc3lxOBaUijo= @@ -181,7 +189,9 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -667,6 +677,7 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= @@ -992,8 +1003,10 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 9d0570d7..af5fa43f 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -31,7 +31,9 @@ import ( "github.com/dell/csi-powerstore/pkg/array" "github.com/dell/csi-powerstore/pkg/common" "github.com/dell/csi-powerstore/pkg/common/fs" + commonext "github.com/dell/dell-csi-extensions/common" csiext "github.com/dell/dell-csi-extensions/replication" + vgsext "github.com/dell/dell-csi-extensions/volumeGroupSnapshot" csictx "github.com/dell/gocsi/context" "github.com/dell/gopowerstore" "github.com/golang/protobuf/ptypes/wrappers" @@ -1104,13 +1106,14 @@ func (s *Service) ControllerGetVolume(ctx context.Context, req *csi.ControllerGe // RegisterAdditionalServers registers replication extension func (s *Service) RegisterAdditionalServers(server *grpc.Server) { csiext.RegisterReplicationServer(server, s) + vgsext.RegisterVolumeGroupSnapshotServer(server, s) } // ProbeController probes the controller service -func (s *Service) ProbeController(ctx context.Context, req *csiext.ProbeControllerRequest) (*csiext.ProbeControllerResponse, error) { +func (s *Service) ProbeController(ctx context.Context, req *commonext.ProbeControllerRequest) (*commonext.ProbeControllerResponse, error) { ready := new(wrappers.BoolValue) ready.Value = true - rep := new(csiext.ProbeControllerResponse) + rep := new(commonext.ProbeControllerResponse) rep.Ready = ready rep.Name = common.Name rep.VendorVersion = core.SemVer @@ -1120,6 +1123,10 @@ func (s *Service) ProbeController(ctx context.Context, req *csiext.ProbeControll return rep, nil } +func (s *Service) CreateVolumeGroupSnapshot(ctx context.Context, request *vgsext.CreateVolumeGroupSnapshotRequest) (*vgsext.CreateVolumeGroupSnapshotResponse, error) { + panic("implement me") +} + func (s *Service) listPowerStoreVolumes(ctx context.Context, startToken, maxEntries int) ([]gopowerstore.Volume, string, error) { var volumes []gopowerstore.Volume From 4d0156238cea37a98729afb7e35221e6e2f7932d Mon Sep 17 00:00:00 2001 From: Andrey Schipilo Date: Wed, 15 Dec 2021 13:59:25 +0300 Subject: [PATCH 2/2] Fixed linting issues --- pkg/controller/controller.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index af5fa43f..97801ac6 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -1123,6 +1123,7 @@ func (s *Service) ProbeController(ctx context.Context, req *commonext.ProbeContr return rep, nil } +// CreateVolumeGroupSnapshot creates snapshots of the volume group func (s *Service) CreateVolumeGroupSnapshot(ctx context.Context, request *vgsext.CreateVolumeGroupSnapshotRequest) (*vgsext.CreateVolumeGroupSnapshotResponse, error) { panic("implement me") }