Skip to content
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

PowerStore CSI driver Support for the multiple interface for iSCSI discovery + Increased UT Coverage #434

Merged
merged 67 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
838764c
Discover multiple ifaces
karthikk92 Feb 3, 2025
5da23d1
Discover multiple ifaces
karthikk92 Feb 3, 2025
743267f
Discover multiple ifaces
karthikk92 Feb 3, 2025
aca91a9
Discover multiple ifaces
karthikk92 Feb 3, 2025
4f1e1dd
Discover multiple ifaces
karthikk92 Feb 3, 2025
8aa206e
Updated portal with IP
karthikk92 Feb 6, 2025
920e90e
Updated portal with IP
karthikk92 Feb 6, 2025
bf8702d
Updated portal with IP
karthikk92 Feb 6, 2025
56e158a
Updated portal with IP
karthikk92 Feb 6, 2025
1ceac75
Updated portal with IP
karthikk92 Feb 6, 2025
608fbed
Updated portal with IP
karthikk92 Feb 7, 2025
6d25e8c
Resolved go fmt and lint issue
karthikk92 Feb 7, 2025
2b8d13c
Resolved go fmt and lint issue
karthikk92 Feb 7, 2025
580b36a
Resolved go fmt and lint issue
karthikk92 Feb 7, 2025
7994da0
Resolved go fmt and lint issue
karthikk92 Feb 7, 2025
0c3a4aa
addressed review comments and UT fialure fix
karthikk92 Feb 11, 2025
6c7696d
addressed review comments and UT fialure fix
karthikk92 Feb 11, 2025
4af7e0e
Lint issue
karthikk92 Feb 11, 2025
946b0e9
Update node_test.go to increase UT coverage
sakshi-garg1 Feb 11, 2025
bd12dce
added test for cmd/main.go
rishabhatdell Feb 11, 2025
6fce2b8
added header for cmd/main_test.go
rishabhatdell Feb 11, 2025
563d45f
Merge branch 'main' into discover-multiple-interface
adarsh-dell Feb 11, 2025
866c55e
Update UT coverage for semver.go
WilsonRadadia20 Feb 11, 2025
82a8eec
Update UT coverage of semver.go
WilsonRadadia20 Feb 12, 2025
eca2df7
Fixing failing UT
sakshi-garg1 Feb 12, 2025
c6cd2d3
Fixing failing UT and add new UT
sakshi-garg1 Feb 12, 2025
35d0a16
Fixing race condition in UT
sakshi-garg1 Feb 12, 2025
ecb06a0
Fix for the semver failure
WilsonRadadia20 Feb 12, 2025
8f800f8
Merge branch 'discover-multiple-interface' of https://github.com/dell…
WilsonRadadia20 Feb 12, 2025
a30de51
Fix for the semver failure
WilsonRadadia20 Feb 12, 2025
f1b2462
Fix for the semver failure
WilsonRadadia20 Feb 12, 2025
d5d906d
fix for semver failure
WilsonRadadia20 Feb 12, 2025
4cd0718
Fix for the failure of semver
WilsonRadadia20 Feb 12, 2025
3f9776d
Fix for semver failure
WilsonRadadia20 Feb 12, 2025
d4af244
Fixed the code for semver.go
WilsonRadadia20 Feb 12, 2025
a572a5a
Update node_connectivity_checker_test.go
sakshi-garg1 Feb 12, 2025
48c9020
Update code coverage of semver.go
WilsonRadadia20 Feb 12, 2025
57b5637
Merge branch 'discover-multiple-interface' of https://github.com/dell…
WilsonRadadia20 Feb 12, 2025
c987a62
Passing address.Portal instead of ipAddress in DiscoverTargetsWithInt…
sakshi-garg1 Feb 12, 2025
7c27b9c
Passing address.Portal instead of ipAddress in DiscoverTargetsWithInt…
sakshi-garg1 Feb 12, 2025
8fa8f8b
Revoke the changes for UT of semver.go
WilsonRadadia20 Feb 12, 2025
d858537
Merge branch 'discover-multiple-interface' of https://github.com/dell…
WilsonRadadia20 Feb 12, 2025
69a9bdc
added UTs for main.go
rishabhatdell Feb 12, 2025
ee1185c
Update UT coverage for semver.go
WilsonRadadia20 Feb 13, 2025
2d126da
Merge branch 'discover-multiple-interface' of https://github.com/dell…
WilsonRadadia20 Feb 13, 2025
e1acd6e
Update UT coverage of semver.go
WilsonRadadia20 Feb 13, 2025
e472aad
fixing_UT_failure for node package (#437)
sakshi-garg1 Feb 13, 2025
e1c8e9e
Update UT coverage for semver.go
WilsonRadadia20 Feb 13, 2025
956e8dd
Merge branch 'discover-multiple-interface' of https://github.com/dell…
WilsonRadadia20 Feb 13, 2025
1e9fdaa
Update UT coverage for semver.go
WilsonRadadia20 Feb 13, 2025
6894c2b
Add UT main.go
AkshaySainiDell Feb 13, 2025
2926582
Updated UTs for core variables :
karthikk92 Feb 13, 2025
6c45165
Add UT main.go
AkshaySainiDell Feb 13, 2025
2a37d04
Add UT main.go
AkshaySainiDell Feb 13, 2025
4904a9e
Add UT main.go
AkshaySainiDell Feb 13, 2025
795fc1f
Add UT main.go
AkshaySainiDell Feb 13, 2025
5b99b27
Add UT main.go
AkshaySainiDell Feb 13, 2025
b5f4ab5
Increased UT coverage of csi-powerstore.go
WilsonRadadia20 Feb 14, 2025
90c6a2b
Remove unnecesary changes in semver.go
WilsonRadadia20 Feb 17, 2025
deed68e
Fix for semver failure
WilsonRadadia20 Feb 17, 2025
38b3a19
Reverting the changes
WilsonRadadia20 Feb 17, 2025
172f9d0
Fix for failure in semver.go
WilsonRadadia20 Feb 17, 2025
c706390
remove linter errors
rishabhatdell Feb 18, 2025
e5ec09e
fixed race condition
rishabhatdell Feb 18, 2025
8f83349
fixed race condition
rishabhatdell Feb 18, 2025
9752905
fixed linters errors
rishabhatdell Feb 18, 2025
30e2882
fixed don review comments
rishabhatdell Feb 18, 2025
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
166 changes: 88 additions & 78 deletions cmd/csi-powerstore/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,25 @@ func init() {
_ = os.Setenv(gocsi.EnvVarReqLogging, "true")
_ = os.Setenv(gocsi.EnvVarRepLogging, "true")

paramsPath, ok := csictx.LookupEnv(context.Background(), common.EnvConfigParamsFilePath)
if !ok {
log.Warnf("config path X_CSI_POWERSTORE_CONFIG_PARAMS_PATH is not specified")
}
updateDriverName()

initilizeDriverConfigParams()

// If we don't set this env gocsi will overwrite log level with default Info level
_ = os.Setenv(gocsi.EnvVarLogLevel, log.GetLevel().String())
}

func updateDriverName() {
if name, ok := csictx.LookupEnv(context.Background(), common.EnvDriverName); ok {
common.Name = name
}
}

func initilizeDriverConfigParams() {
paramsPath, ok := csictx.LookupEnv(context.Background(), common.EnvConfigParamsFilePath)
if !ok {
log.Warnf("config path X_CSI_POWERSTORE_CONFIG_PARAMS_PATH is not specified")
}

paramsViper := viper.New()
paramsViper.SetConfigFile(paramsPath)
Expand All @@ -77,12 +88,6 @@ func init() {
})

updateDriverConfigParams(paramsViper)

// If we don't set this env gocsi will overwrite log level with default Info level
err = os.Setenv(gocsi.EnvVarLogLevel, log.GetLevel().String())
if err != nil {
log.WithError(err).Errorf("unable to set env variable %s", gocsi.EnvVarDebug)
}
}

func main() {
Expand Down Expand Up @@ -157,7 +162,7 @@ func main() {
}
})

interList := []grpc.UnaryServerInterceptor{
InterceptorsList := []grpc.UnaryServerInterceptor{
interceptors.NewCustomSerialLock(mode),
interceptors.NewRewriteRequestIDInterceptor(),
}
Expand All @@ -171,26 +176,31 @@ func main() {
}
defer closer.Close() // #nosec G307
opentracing.SetGlobalTracer(t)
interList = append(interList, grpc_opentracing.UnaryServerInterceptor(grpc_opentracing.WithTracer(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",
},
}
runCSIPlugin(storageProvider)
}

var runCSIPlugin = func(storageProvider *gocsi.StoragePlugin) {
gocsi.Run(context.Background(), common.Name,
"A PowerStore Container Storage Interface (CSI) Driver",
usage,
&gocsi.StoragePlugin{
Controller: controllerService,
Identity: identityService,
Node: nodeService,
Interceptors: interList,
RegisterAdditionalServers: controllerService.RegisterAdditionalServers,

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

func updateDriverConfigParams(v *viper.Viper) {
Expand Down Expand Up @@ -228,55 +238,55 @@ func updateDriverConfigParams(v *viper.Viper) {
}

const usage = `
X_CSI_POWERSTORE_INSECURE
Specifies that the PowerStore's hostname and certificate chain
should not be verified.

The default value is false.

X_CSI_POWERSTORE_NODE_ID_PATH
Specifies the name of the text file contents of which will
be appended to the node ID

X_CSI_POWERSTORE_KUBE_NODE_NAME
Specifies the name of the kubernetes node

X_CSI_POWERSTORE_NODE_NAME_PREFIX
Specifies prefix which will be used when registering node
on PowerStore array

X_CSI_POWERSTORE_NODE_CHROOT_PATH
Specifies path to chroot where to execute iSCSI commands

X_CSI_POWERSTORE_TMP_DIR
Specifies path to the folder which will be used for csi-powerstore temporary files

X_CSI_FC_PORTS_FILTER_FILE_PATH
Specifies path to the file which provide list of WWPN which
should be used by the driver for FC connection on this node
example content of the file:
21:00:00:29:ff:48:9f:6e,21:00:00:29:ff:48:9f:6e
If file does not exist, empty or in invalid format,
then the driver will use all available FC ports

X_CSI_POWERSTORE_THROTTLING_RATE_LIMIT
Specifies a number of concurrent requests to one storage API

X_CSI_POWERSTORE_ENABLE_CHAP
Specifies whether driver should set CHAP credentials in the ISCSI
node database at the time of node plugin boot

X_CSI_POWERSTORE_EXTERNAL_ACCESS
Specifies an IP of the additional router you wish to add for nfs export
Used to provide NFS volumes behind NAT

X_CSI_POWERSTORE_CONFIG_PATH
Specifies the filepath to PowerStore arrays config file which will be used
for connection to PowerStore arrays

X_CSI_REPLICATION_CONTEXT_PREFIX
Enables sidecars to read required information from volume context

X_CSI_REPLICATION_PREFIX
Used as a prefix to find out if replication is enabled
`
X_CSI_POWERSTORE_INSECURE
Specifies that the PowerStore's hostname and certificate chain
should not be verified.
The default value is false.
X_CSI_POWERSTORE_NODE_ID_PATH
Specifies the name of the text file contents of which will
be appended to the node ID
X_CSI_POWERSTORE_KUBE_NODE_NAME
Specifies the name of the kubernetes node
X_CSI_POWERSTORE_NODE_NAME_PREFIX
Specifies prefix which will be used when registering node
on PowerStore array
X_CSI_POWERSTORE_NODE_CHROOT_PATH
Specifies path to chroot where to execute iSCSI commands
X_CSI_POWERSTORE_TMP_DIR
Specifies path to the folder which will be used for csi-powerstore temporary files
X_CSI_FC_PORTS_FILTER_FILE_PATH
Specifies path to the file which provide list of WWPN which
should be used by the driver for FC connection on this node
example content of the file:
21:00:00:29:ff:48:9f:6e,21:00:00:29:ff:48:9f:6e
If file does not exist, empty or in invalid format,
then the driver will use all available FC ports
X_CSI_POWERSTORE_THROTTLING_RATE_LIMIT
Specifies a number of concurrent requests to one storage API
X_CSI_POWERSTORE_ENABLE_CHAP
Specifies whether driver should set CHAP credentials in the ISCSI
node database at the time of node plugin boot
X_CSI_POWERSTORE_EXTERNAL_ACCESS
Specifies an IP of the additional router you wish to add for nfs export
Used to provide NFS volumes behind NAT
X_CSI_POWERSTORE_CONFIG_PATH
Specifies the filepath to PowerStore arrays config file which will be used
for connection to PowerStore arrays
X_CSI_REPLICATION_CONTEXT_PREFIX
Enables sidecars to read required information from volume context
X_CSI_REPLICATION_PREFIX
Used as a prefix to find out if replication is enabled
`
Loading