Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.20.0
github.com/stretchr/testify v1.11.0
golang.org/x/net v0.43.0
golang.org/x/net v0.46.0
google.golang.org/grpc v1.75.0
google.golang.org/protobuf v1.36.6
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -92,9 +92,9 @@ require (
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/term v0.34.0 // indirect
golang.org/x/text v0.28.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/term v0.36.0 // indirect
golang.org/x/text v0.30.0 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -678,8 +678,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -755,8 +755,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand All @@ -768,8 +768,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -784,8 +784,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -834,8 +834,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0=
golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw=
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
17 changes: 14 additions & 3 deletions service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1287,8 +1287,14 @@ func (s *service) ControllerPublishVolume(
}

if exportPath = volumeContext[ExportPathParam]; exportPath == "" {
exportPath = isilonfs.GetPathForVolume(isiConfig.IsiPath, volName)
// if not in request, calculate it from the export
exportPath, err = getExportPathFromExportID(ctx, isiConfig, exportID, accessZone)
if err != nil {
log.Infof("Could not get export path by export ID: %v", err)
exportPath = isilonfs.GetPathForVolume(isiConfig.IsiPath, volName)
}
}
log.Infof("Export path: %s", exportPath)
isROVolumeFromSnapshot = isiConfig.isiSvc.isROVolumeFromSnapshot(volumeContext["Path"], accessZone)

if isROVolumeFromSnapshot {
Expand Down Expand Up @@ -1472,7 +1478,7 @@ func (s *service) ValidateVolumeCapabilities(

// parse the input volume id and fetch it's components
volID := req.GetVolumeId()
volName, _, _, clusterName, err := id.ParseNormalizedVolumeID(ctx, volID)
volName, exportID, accessZone, clusterName, err := id.ParseNormalizedVolumeID(ctx, volID)
if err != nil {
return nil, status.Error(codes.NotFound, err.Error())
}
Expand All @@ -1493,7 +1499,12 @@ func (s *service) ValidateVolumeCapabilities(

volumeContext := req.GetVolumeContext()
if exportPath = volumeContext[ExportPathParam]; exportPath == "" {
exportPath = isilonfs.GetPathForVolume(isiConfig.IsiPath, volName)
// if not in request, calculate it from the export
exportPath, err = getExportPathFromExportID(ctx, isiConfig, exportID, accessZone)
if err != nil {
log.Infof("Could not get export path by export ID: %v", err)
exportPath = isilonfs.GetPathForVolume(isiConfig.IsiPath, volName)
}
}
isiPath = isilonfs.GetIsiPathFromExportPath(exportPath)

Expand Down
2 changes: 2 additions & 0 deletions service/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,7 @@ func TestControllerPublishVolume_MaxVolumesPerNode(t *testing.T) {

// Mock the necessary calls
isiConfig.isiSvc.client.API.(*isimocks.Client).ExpectedCalls = nil
isiConfig.isiSvc.client.API.(*isimocks.Client).On("Get", anyArgs[0:6]...).Return(errors.New("mocked export lookup failure")).Once()
isiConfig.isiSvc.client.API.(*isimocks.Client).On("Get", anyArgs[0:6]...).Return(nil).Run(func(args mock.Arguments) {
resp := args.Get(5).(**apiv1.GetIsiVolumeAttributesResp)
*resp = &apiv1.GetIsiVolumeAttributesResp{}
Expand All @@ -1588,6 +1589,7 @@ func TestControllerPublishVolume_MaxVolumesPerNode(t *testing.T) {

// Error Scenario
isiConfig.isiSvc.client.API.(*isimocks.Client).ExpectedCalls = nil
isiConfig.isiSvc.client.API.(*isimocks.Client).On("Get", anyArgs[0:6]...).Return(errors.New("mocked export lookup failure")).Once()
isiConfig.isiSvc.client.API.(*isimocks.Client).On("Get", anyArgs[0:6]...).Return(nil).Run(func(args mock.Arguments) {
resp := args.Get(5).(**apiv1.GetIsiVolumeAttributesResp)
*resp = &apiv1.GetIsiVolumeAttributesResp{}
Expand Down
51 changes: 43 additions & 8 deletions service/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,27 +460,62 @@ func (s *service) NodeGetVolumeStats(
return nil, status.Error(codes.InvalidArgument, logging.GetMessageWithRunID(runID, "no Volume Path found in request"))
}

volName, _, _, clusterName, _ := id.ParseNormalizedVolumeID(ctx, volID)
volName, exportID, accessZone, clusterName, _ := id.ParseNormalizedVolumeID(ctx, volID)
if volName == "" {
volName = volID
}

// Check if given volume exists
// Create copy of isiconfig so we don't modify the original
isiConfig, err := s.getIsilonConfig(ctx, &clusterName)
if err != nil {
return nil, err
}

isiPath := isiConfig.IsiPath

isiConfigCopy := &IsilonClusterConfig{
ClusterName: isiConfig.ClusterName,
Endpoint: isiConfig.Endpoint,
EndpointPort: isiConfig.EndpointPort,
MountEndpoint: isiConfig.MountEndpoint,
EndpointURL: isiConfig.EndpointURL,
accessZone: isiConfig.accessZone,
User: isiConfig.User,
Password: isiConfig.Password,
SkipCertificateValidation: isiConfig.SkipCertificateValidation,
IsiPath: isiConfig.IsiPath,
IsiVolumePathPermissions: isiConfig.IsiVolumePathPermissions,
IsDefault: isiConfig.IsDefault,
ReplicationCertificateID: isiConfig.ReplicationCertificateID,
IgnoreUnresolvableHosts: isiConfig.IgnoreUnresolvableHosts,
isiSvc: isiConfig.isiSvc,
}

// save the isiPath var, if we cannot find another isiPath tied to the vol, we will use this one
isiPath := isiConfigCopy.IsiPath

// first we check pv, sc for isiPath
// if we cannot find it there, we check the export
isiPathFromParams, err := s.validateIsiPath(ctx, volName)
if err != nil {
log.Error("Failed get isiPath", err.Error())
log.Error("Failed to get isiPath: ", err.Error())
// if not in pv or sc, calculate it from the export
exportPath, err := getExportPathFromExportID(ctx, isiConfig, exportID, accessZone)
if err != nil {
log.Debugf("Failed to get export path: %s, using default: %s", err.Error(), isiPath)
} else {
isiPathFromParams = isilonfs.GetIsiPathFromExportPath(exportPath)
}
}

if isiPathFromParams != isiPath && isiPathFromParams != "" {
log.Debug("overriding isiPath with value from StorageClass", isiPathFromParams)
if isiPathFromParams != "" {
log.Debug("Found IsiPath from PV/SC/Export: ", isiPathFromParams)
isiPath = isiPathFromParams
// set service to utilize new path
isiConfigCopy.IsiPath = isiPath
isiConfigCopy.isiSvc, err = s.GetIsiService(ctx, isiConfigCopy, logging.GetCurrentLogLevel())
if err != nil {
log.Error("NodeGetVolumeStats: Failed to get isiService: ", err.Error())
return nil, err
}
}

// Probe the node if required and make sure startup called
Expand All @@ -489,7 +524,7 @@ func (s *service) NodeGetVolumeStats(
return nil, err
}

isiVol, err := isiConfig.isiSvc.GetVolume(ctx, "", volName)
isiVol, err := isiConfigCopy.isiSvc.GetVolume(ctx, "", volName)
if err != nil || isiVol == nil {
return nil, status.Error(codes.NotFound, logging.GetMessageWithRunID(runID, "volume %v does not exist at path %v", volName, volPath))
}
Expand Down
Loading
Loading