Skip to content

Adding Host Based NFS for Powerstore #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Apr 1, 2025
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
19 changes: 4 additions & 15 deletions cmd/csi-powerstore/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright © 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
* Copyright © 2021-2025 Dell Inc. or its subsidiaries. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,6 +30,7 @@ import (
"github.com/dell/csi-powerstore/v2/pkg/identity"
"github.com/dell/csi-powerstore/v2/pkg/interceptors"
"github.com/dell/csi-powerstore/v2/pkg/node"
"github.com/dell/csi-powerstore/v2/pkg/provider"
"github.com/dell/csi-powerstore/v2/pkg/tracer"
"github.com/dell/gocsi"
csictx "github.com/dell/gocsi/context"
Expand Down Expand Up @@ -178,20 +179,8 @@ func main() {
opentracing.SetGlobalTracer(t)
InterceptorsList = append(InterceptorsList, grpc_opentracing.UnaryServerInterceptor(grpc_opentracing.WithTracer(t)))
}
storageProvider := &gocsi.StoragePlugin{
Controller: controllerService,
Identity: identityService,
Node: nodeService,
Interceptors: InterceptorsList,
RegisterAdditionalServers: controllerService.RegisterAdditionalServers,

EnvVars: []string{
// Enable request validation.
gocsi.EnvVarSpecReqValidation + "=true",
// Enable serial volume access.
gocsi.EnvVarSerialVolAccess + "=true",
},
}

storageProvider := provider.New(controllerService, identityService, nodeService, InterceptorsList)
runCSIPlugin(storageProvider)
}

Expand Down
12 changes: 4 additions & 8 deletions cmd/csi-powerstore/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (
"time"

"github.com/dell/csi-powerstore/v2/pkg/common"
"github.com/dell/csi-powerstore/v2/pkg/controller"
"github.com/dell/csi-powerstore/v2/pkg/node"
"github.com/dell/gocsi"
"github.com/fsnotify/fsnotify"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -104,15 +102,14 @@ func TestMainControllerMode(t *testing.T) {
// Assertions
require.NotNil(t, test.Controller)
require.NotNil(t, test.Identity)
require.Nil(t, test.Node)
require.EqualValues(t, 1, len(test.Controller.(*controller.Service).Arrays()))
require.NotNil(t, test.Node)

// Update the config file
writeToFile(t, config, array2)
time.Sleep(time.Second)

// Assertions
require.EqualValues(t, 2, len(test.Controller.(*controller.Service).Arrays()))
require.NotNil(t, test.Controller)
}

defer func() {
Expand Down Expand Up @@ -147,17 +144,16 @@ func TestMainNodeMode(t *testing.T) {

runCSIPlugin = func(test *gocsi.StoragePlugin) {
// Assertions
require.Nil(t, test.Controller)
require.NotNil(t, test.Controller)
require.NotNil(t, test.Identity)
require.NotNil(t, test.Node)
require.EqualValues(t, 1, len(test.Node.(*node.Service).Arrays()))

// Update the config file
writeToFile(t, config, array2)
time.Sleep(time.Second)

// Assertions
require.EqualValues(t, 2, len(test.Node.(*node.Service).Arrays()))
require.NotNil(t, test.Node)
}

defer func() {
Expand Down
9 changes: 6 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/apparentlymart/go-cidr v1.1.0
github.com/container-storage-interface/spec v1.6.0
github.com/dell/csi-metadata-retriever v1.10.0
github.com/dell/csm-hbnfs v0.0.0-20250401143151-95f13808d5cc
github.com/dell/dell-csi-extensions/common v1.7.1-0.20250321180109-ff9405f3dbef
github.com/dell/dell-csi-extensions/podmon v1.7.1-0.20250321180109-ff9405f3dbef
github.com/dell/dell-csi-extensions/replication v1.10.2-0.20250321180109-ff9405f3dbef
Expand All @@ -32,12 +33,14 @@ require (
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/uber/jaeger-lib v2.4.1+incompatible
golang.org/x/net v0.38.0
go.uber.org/mock v0.5.0
golang.org/x/net v0.38.0
google.golang.org/grpc v1.71.0
google.golang.org/protobuf v1.36.5
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.32.1
k8s.io/apimachinery v0.32.1
k8s.io/client-go v0.32.1
k8s.io/api v0.32.3
k8s.io/apimachinery v0.32.3
k8s.io/client-go v0.32.3
)

require (
Expand Down
18 changes: 12 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dell/csi-metadata-retriever v1.10.0 h1:OMzbwSJ+CMOTpf4WgcrSbT3j9Ve1txuLmYkfSTkRSBc=
github.com/dell/csi-metadata-retriever v1.10.0/go.mod h1:ppgtPHlxaRNmNizU+TnxZLz8tNotTAwByZ/Lg32n660=
github.com/dell/csm-hbnfs v0.0.0-20250331150804-9b8e036ea8ea h1:p9l2OxZ+LhtGDDOkE4+0RxJk5100ncqDt097uE24CL0=
github.com/dell/csm-hbnfs v0.0.0-20250331150804-9b8e036ea8ea/go.mod h1:s0wmTFb45ajEnWcdWA/n/rWbPSKiBE6P7gRIJG5bTv4=
github.com/dell/csm-hbnfs v0.0.0-20250401143151-95f13808d5cc h1:e3kmwRtopvfEHe2e4NqbXftkgYzLHWHL7amjSDVfWRU=
github.com/dell/csm-hbnfs v0.0.0-20250401143151-95f13808d5cc/go.mod h1:s0wmTFb45ajEnWcdWA/n/rWbPSKiBE6P7gRIJG5bTv4=
github.com/dell/dell-csi-extensions/common v1.7.1-0.20250321180109-ff9405f3dbef h1:jY7MGG/q+GRKp+NdhQbGH+5EAEdB/ecmtqP2DcHiRrs=
github.com/dell/dell-csi-extensions/common v1.7.1-0.20250321180109-ff9405f3dbef/go.mod h1:0cJvgNiPOosCJujd60aV9ZTujsHbRJNXX0ARRMDyjfw=
github.com/dell/dell-csi-extensions/podmon v1.7.1-0.20250321180109-ff9405f3dbef h1:N+ZHf7+OYxizmgRyNFocBjF5EiAzz+rkAZTMhi1Pgq0=
Expand Down Expand Up @@ -576,6 +580,8 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand Down Expand Up @@ -919,14 +925,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU=
k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc=
k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k=
k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls=
k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k=
k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs=
k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U=
k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg=
k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU=
k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg=
k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU=
k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY=
k8s.io/component-base v0.22.0/go.mod h1:SXj6Z+V6P6GsBhHZVbWCw9hFjUdUYnJerlhhPnYCBCg=
k8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk=
k8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w=
Expand Down
Loading