Skip to content

Commit

Permalink
update library version (#194)
Browse files Browse the repository at this point in the history
fix format

fix format

fix linting

update gobrick

update gobrick

Signed-off-by: Luna Xu <luna.xu@dell.com>
Signed-off-by: Luna Xu <ms.luna.xu@gmail.com>
  • Loading branch information
xuluna authored Mar 5, 2024
1 parent c73c5ba commit ab61d0d
Show file tree
Hide file tree
Showing 15 changed files with 189 additions and 190 deletions.
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ go 1.22
require (
github.com/container-storage-interface/spec v1.6.0
github.com/cucumber/godog v0.10.0
github.com/dell/dell-csi-extensions/podmon v1.3.0
github.com/dell/gobrick v1.9.0
github.com/dell/gocsi v1.9.0
github.com/dell/gofsutil v1.14.0
github.com/dell/goiscsi v1.8.0
github.com/dell/gounity v1.16.0
github.com/dell/dell-csi-extensions/podmon v1.4.0
github.com/dell/gobrick v1.10.1
github.com/dell/gocsi v1.10.0
github.com/dell/gofsutil v1.15.0
github.com/dell/goiscsi v1.9.0
github.com/dell/gounity v1.17.0
github.com/fsnotify/fsnotify v1.4.9
github.com/golang/protobuf v1.5.3
github.com/kubernetes-csi/csi-lib-utils v0.7.0
Expand All @@ -20,7 +20,7 @@ require (
go.uber.org/atomic v1.7.0
golang.org/x/net v0.17.0
google.golang.org/grpc v1.57.1
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/apimachinery v0.22.2
Expand All @@ -34,7 +34,7 @@ require (
github.com/cucumber/gherkin-go/v11 v11.0.0 // indirect
github.com/cucumber/messages-go/v10 v10.0.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dell/gonvme v1.4.0 // indirect
github.com/dell/gonvme v1.7.0 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/gofrs/uuid v3.2.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,20 @@ github.com/cucumber/messages-go/v10 v10.0.3/go.mod h1:9jMZ2Y8ZxjLY6TG2+x344nt5rX
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/dell/dell-csi-extensions/podmon v1.3.0 h1:5UEq5ME1bURFYtk2vTCIXo+PWmZEJrbtdP2Ui+6MaAI=
github.com/dell/dell-csi-extensions/podmon v1.3.0/go.mod h1:8Qyxk8pzaIBe5qcgmTQgP4cEgvKIDuiG65g1D+p4pZI=
github.com/dell/gobrick v1.9.0 h1:kx69ygz1QV/uCAyIx9pX9gqiwDK7I4WOv5ZUs2zcfPg=
github.com/dell/gobrick v1.9.0/go.mod h1:NK9V+t6LYMWAgHaT4hJiv8FYQdsWzZDz78hir6GAiTI=
github.com/dell/gocsi v1.9.0 h1:bdNuihZvn8oE2iNRM2pNAK7Ys63X6MVftg91479eX64=
github.com/dell/gocsi v1.9.0/go.mod h1:EfkorqCy3PXijLAAmTQlrmkZH4D16c8yCktB/iE/qYg=
github.com/dell/gofsutil v1.14.0 h1:PTPTUJHdwzISM66IDT6QzAnVMtZlswLYKrnd+PkuyFs=
github.com/dell/gofsutil v1.14.0/go.mod h1:5MRt6WASehMm0TYFbu0ZW6z8X79KCL75E2OKyAVHnGo=
github.com/dell/goiscsi v1.8.0 h1:kocGVOdgnufc6eGpfmwP66hyhY7OVgIafaS/+uM6ogU=
github.com/dell/goiscsi v1.8.0/go.mod h1:PTlQGJaGKYgia95mGwwHSBgvfOr3BfLIjGNh1HT6p+s=
github.com/dell/gonvme v1.4.0 h1:SK94ETt0pYZbaKkRJOcq81TbrzC38ufBX+w4uKwJnks=
github.com/dell/gonvme v1.4.0/go.mod h1:fIu54BDTyIu8JOTXo6Q0BqMF1tOjpO+wKXVXjLReR2o=
github.com/dell/gounity v1.16.0 h1:0GVmiptOanhwKTgIDPHOUJNZzlMjVE6BZpzAiynOlCc=
github.com/dell/gounity v1.16.0/go.mod h1:PQRWpvI17FYJoXRIAFClMSS6T+ZE5PYeV4pXWnfLM9o=
github.com/dell/dell-csi-extensions/podmon v1.4.0 h1:BejEC8JbPRZK1Rov1xyce9WbIq+vh+cLCdlCzuMkM10=
github.com/dell/dell-csi-extensions/podmon v1.4.0/go.mod h1:mn5T3eHo+1uGCfykZE5yrlgFQkD3UMndT24RIQ2xb/o=
github.com/dell/gobrick v1.10.1 h1:YabNLVQstz1iKYUyhXEIr/y/xTF1T5W5Wmtjn0dxQdU=
github.com/dell/gobrick v1.10.1/go.mod h1:EvUl6GW7dZgBs+5KZW5oNJ7JrlGXMnkQpZ4BNz6fjQU=
github.com/dell/gocsi v1.10.0 h1:X3HQ4/Fx1bm857L497AF/uGCPiw1BB4OE4TpQYvsBEI=
github.com/dell/gocsi v1.10.0/go.mod h1:RkBQHWKqPuRBDipBglo40bd5h6wBzQkU4QeRUFOeKcs=
github.com/dell/gofsutil v1.15.0 h1:u+t+Xf6MJNw+8YzR9TzbWSfgy8dowOKUMBRMsiI4xDA=
github.com/dell/gofsutil v1.15.0/go.mod h1:bZ43qAOqKzGJxCRvkTVD7GCFMNkK37ur84mmMuxQshE=
github.com/dell/goiscsi v1.9.0 h1:VvMHbAO4vk80oc/TAbQPYlxysscCqVBW78GyPoUxgik=
github.com/dell/goiscsi v1.9.0/go.mod h1:NI/W/0O1UrMW2zVdMxy4z395Jn0r7utH6RQDFSZiFyQ=
github.com/dell/gonvme v1.7.0 h1:ztJFhKQehZjfaoNv+hTbGbdhLWCAhPE44k1v7x5o2c0=
github.com/dell/gonvme v1.7.0/go.mod h1:ajbuF+fswq+ty2tRTG5FN4ecIMJsG7aDu/bkMynTKAs=
github.com/dell/gounity v1.17.0 h1:BlZ94v4RVDf52QADiwKDceYPLrB3QyWLmDX7MbnmzDo=
github.com/dell/gounity v1.17.0/go.mod h1:R3JRSFGdhcdlv/koJ0pVj3qa6UkMT5ni1EKcJGeiqHE=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
Expand Down Expand Up @@ -687,8 +687,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
4 changes: 2 additions & 2 deletions service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func (s *service) ValidateVolumeCapabilities(ctx context.Context, req *csi.Valid
return resp, status.Error(codes.Unknown, utils.GetMessageWithRunID(rid, "Unsupported capability"))
}

func (s *service) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
func (s *service) ListVolumes(_ context.Context, _ *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {
return nil, status.Error(codes.Unimplemented, "Not implemented")
}

Expand Down Expand Up @@ -1596,7 +1596,7 @@ func (s *service) exportFilesystem(ctx context.Context, volID, hostID, nodeID, a
}

// exportVolume - Method to export volume with idempotency
func (s *service) exportVolume(ctx context.Context, protocol, volID, hostID, nodeID, arrayID string, unity *gounity.Client, pinfo map[string]string, host *types.Host, vc *csi.VolumeCapability) (*csi.ControllerPublishVolumeResponse, error) {
func (s *service) exportVolume(ctx context.Context, protocol, volID, hostID, _, _ string, unity *gounity.Client, pinfo map[string]string, host *types.Host, vc *csi.VolumeCapability) (*csi.ControllerPublishVolumeResponse, error) {
ctx, log, rid := GetRunidLog(ctx)
pinfo["lun"] = volID
am := vc.GetAccessMode()
Expand Down
23 changes: 12 additions & 11 deletions service/csi_extension_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var (
"sp.*.storage.lun.*.currentIOCount",
}
)

var fileSystemRWs = []string{
"sp.*.storage.filesystem.*.clientReads",
"sp.*.storage.filesystem.*.clientWrites",
Expand Down Expand Up @@ -119,7 +120,7 @@ func (s *service) ValidateVolumeHostConnectivity(ctx context.Context, req *podmo
if systemID == "" {
log.Infof("No arrayId passed in, extracting it using other methods")
// Try to extract the arrayID from the volumes
foundOne := s.getArrayIdsFromVolumes(ctx, systemIDs, req.GetVolumeIds())
foundOne := s.getArrayIDsFromVolumes(ctx, systemIDs, req.GetVolumeIds())
// If no arrayIDs found in volumes (possibly because they weren't provided), then try the default array
if !foundOne {
// Lookup the default array
Expand Down Expand Up @@ -231,12 +232,12 @@ func (s *service) ValidateVolumeHostConnectivity(ctx context.Context, req *podmo

// getArrayIdsFromVolumes iterates the requestVolumeIds list, extracting the arrayId and adding them to 'systemIDs'
// returns true if there was at least one arrayId found
func (s *service) getArrayIdsFromVolumes(ctx context.Context, systemIDs map[string]bool, requestVolumeIds []string) bool {
func (s *service) getArrayIDsFromVolumes(ctx context.Context, systemIDs map[string]bool, requestVolumeIDs []string) bool {
ctx, log, _ := GetRunidLog(ctx)
var err error
var systemID string
var foundAtLeastOne bool
for _, volumeID := range requestVolumeIds {
for _, volumeID := range requestVolumeIDs {
// Extract arrayID from the volume ID (if any volumes in the request)
if systemID, err = GetArrayIDFromVolumeContext(s, volumeID); err != nil {
log.Warnf("Error getting arrayID for %s - %s", volumeID, err.Error())
Expand Down Expand Up @@ -311,9 +312,9 @@ func (s *service) checkIfNodeIsConnected(ctx context.Context, arrayID string, no
rep.Connected = true
fcConnectivity = true
break
} else {
log.Infof("FC Health is bad for array:%s, Health:%s", arrayID, healthContent.DescriptionIDs[0])
}
log.Infof("FC Health is bad for array:%s, Health:%s", arrayID, healthContent.DescriptionIDs[0])

}
}
}
Expand All @@ -335,9 +336,9 @@ func (s *service) checkIfNodeIsConnected(ctx context.Context, arrayID string, no
rep.Messages = append(rep.Messages, message)
rep.Connected = true
break
} else {
log.Infof("iSCSI Health is bad for array:%s, Health:%s", arrayID, healthContent.DescriptionIDs[0])
}
log.Infof("iSCSI Health is bad for array:%s, Health:%s", arrayID, healthContent.DescriptionIDs[0])

}
}
}
Expand All @@ -346,7 +347,7 @@ func (s *service) checkIfNodeIsConnected(ctx context.Context, arrayID string, no
}

// doesAnyVolumeHaveIO will determine if any of the given volumes on array has IOs.
func (s *service) doesAnyVolumeHaveIO(ctx context.Context, rep *podmon.ValidateVolumeHostConnectivityResponse, arrayID string, volumeIds []string) (bool, error) {
func (s *service) doesAnyVolumeHaveIO(ctx context.Context, rep *podmon.ValidateVolumeHostConnectivityResponse, arrayID string, volumeIDs []string) (bool, error) {
ctx, log, _ := GetRunidLog(ctx)

// Retrieve the latest currentIO metrics for all the array's volumes
Expand All @@ -356,7 +357,7 @@ func (s *service) doesAnyVolumeHaveIO(ctx context.Context, rep *podmon.ValidateV
}

foundVolumeWithIO := false
for _, volumeID := range volumeIds {
for _, volumeID := range volumeIDs {
// As an example, the results should look like this if printed out as a string:
// sp.*.storage.lun.*.currentIOCount [spa = map[sv_108:0 sv_18:0 sv_19:0 sv_22:0 sv_23:0 sv_24:0 sv_25:0 sv_26:0]]
//
Expand Down Expand Up @@ -390,7 +391,7 @@ func (s *service) doesAnyVolumeHaveIO(ctx context.Context, rep *podmon.ValidateV
}

// doesAnyFileSystemHaveIO returns true if any of the file systems in 'fsIds' shows active IOs
func (s *service) doesAnyFileSystemHaveIO(ctx context.Context, rep *podmon.ValidateVolumeHostConnectivityResponse, arrayID string, fsIds []string) (bool, error) {
func (s *service) doesAnyFileSystemHaveIO(ctx context.Context, rep *podmon.ValidateVolumeHostConnectivityResponse, arrayID string, fsIDs []string) (bool, error) {
ctx, log, _ := GetRunidLog(ctx)

// Get two samples over the interval period and get a difference between the values
Expand All @@ -416,7 +417,7 @@ func (s *service) doesAnyFileSystemHaveIO(ctx context.Context, rep *podmon.Valid
}

foundVolumeWithIO := false
for _, fsID := range fsIds {
for _, fsID := range fsIDs {
firstSample, getValueErr = s.getMetricValues(ctx, first, arrayID, fsID)
if getValueErr != nil {
return false, getValueErr
Expand Down
Loading

0 comments on commit ab61d0d

Please sign in to comment.