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

Conversation

karthikk92
Copy link
Contributor

@karthikk92 karthikk92 commented Feb 7, 2025

Description

Bug Fixes:

  • Improved iSCSI discovery to support multiple interfaces, enhancing the node package.
  • Added ReachableEndPoint checks for better portal reachability during target discovery.
  • Updated go.mod and go.sum to use the latest version of goiscsi.

Refactoring and Unit Tests:

  • Refactored main.go for better readability and modularity.
  • Added main_test.go for core functionality tests.
  • Added tests for node.go
  • Introduced core_test.go and semver_test.go to validate core package variables and semantic versioning.

Concurrency and Safety:

  • Implemented mutex locks for IPToArray in the array package to ensure thread-safe updates and avoid race conditions.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1714

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

  • Installed the powerstore driver both environment(i.e multiple interface and default interface) and installation working fine and iscsi discovery working as expected.
  • cert-csi scale testing executed and results are passing

if err != nil {
log.Error("couldn't discover targets")
continue
}
break
}
log.Debugf("Portal %s is not rechable from the node", address.Portal)
log.Debugf("Portal is not rechable from the node")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to not print the portal in the log?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipAddress will not have any value populated at this line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthikk92 Could you print 'address.Portal' here.? It will be helpful in debugging.

rishabhatdell
rishabhatdell previously approved these changes Feb 18, 2025
suryagupta4
suryagupta4 previously approved these changes Feb 18, 2025
@rishabhatdell rishabhatdell changed the title PowerStore CSI driver Support for the multiple interface for iSCSI discovery PowerStore CSI driver Support for the multiple interface for iSCSI discovery + Increased UT Coverage Feb 18, 2025
donatwork
donatwork previously approved these changes Feb 18, 2025
Copy link
Contributor

@donatwork donatwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some more to the description regarding what was changed. A summary of changes perhaps?

Controller: controllerService,
Identity: identityService,
Node: nodeService,
Interceptors: interList,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interList is not a good name, inter could be expanded into many things; interceptor, interface for example.

@@ -109,7 +119,7 @@ func (s *Locker) UpdateArrays(configPath string, fs fs.Interface) error {
return fmt.Errorf("can't get config for arrays: %s", err.Error())
}
s.SetArrays(arrays)
IPToArray = matcher
updateIPToArray(matcher)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not really updating, you are setting so should start the function with set*.

pkg/node/node.go Outdated
var iscsiTargets []goiscsi.ISCSITarget
for _, address := range infoList {
// first check if this portal is reachable from this machine or not
if ReachableEndPoint(address.Portal) {
ipAddressList := strings.Split(address.Portal, ":")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may not yet support IPv6 but what's the impact here? is using colons the right choice of separator?

var iscsiTargets []goiscsi.ISCSITarget
for _, address := range infoList {
// first check if this portal is reachable from this machine or not
if ReachableEndPoint(address.Portal) {
ipAddressList := strings.Split(address.Portal, ":")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for use of colons. You could encapsulate this in a common utility function.

@rishabhatdell rishabhatdell dismissed stale reviews from donatwork, suryagupta4, and themself via 30e2882 February 18, 2025 11:41
@rishabhatdell rishabhatdell merged commit ce5fb75 into main Feb 18, 2025
7 checks passed
@rishabhatdell rishabhatdell deleted the discover-multiple-interface branch February 18, 2025 11:53
@@ -356,7 +363,7 @@ func (s *Service) populateTargetsInCache(array *array.PowerStoreArray) {
}
break
}
log.Debugf("Portal %s is not rechable from the node", address.Portal)
log.Debugf("Portal is not rechable from the node")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthikk92 Could you print 'address.Portal' here.? It will be helpful in debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants