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

Remove reverseDNS lookup mandate for nodeID #41

Merged
merged 3 commits into from
Jan 10, 2022
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
5 changes: 5 additions & 0 deletions service/features/service.feature
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ Feature: Isilon CSI interface
Then a valid NodeGetInfoResponse is returned with volume limit "2"
And I call remove node labels

Scenario: Call NodeGetInfo When reverse DNS is absent
Given a Isilon service
When I call iCallNodeGetInfoWithNoFQDN
Then a valid NodeGetInfoResponse is returned

Scenario: Call NodeGetCapabilities with health monitor feature enabled
Given a Isilon service
When I call NodeGetCapabilities "true"
Expand Down
3 changes: 2 additions & 1 deletion service/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,8 @@ func (s *service) getPowerScaleNodeID(ctx context.Context) (string, error) {

nodeFQDN, err := utils.GetFQDNByIP(ctx, nodeIP)
if (err) != nil {
return "", err
nodeFQDN = nodeIP
log.Warnf("Setting nodeFQDN to %s as failed to resolve IP to FQDN due to %v", nodeIP, err)
}

nodeID, err := s.GetCSINodeID(ctx)
Expand Down
13 changes: 13 additions & 0 deletions service/step_defs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ func FeatureContext(s *godog.Suite) {
s.Step(`^I call ControllerGetVolume with name "([^"]*)"$`, f.iCallControllerGetVolume)
s.Step(`^a valid ControllerGetVolumeResponse is returned$`, f.aValidControllerGetVolumeResponseIsReturned)
s.Step(`^I call NodeGetVolumeStats with name "([^"]*)" and path "([^"]*)"$`, f.iCallNodeGetVolumeStats)
s.Step(`^I call iCallNodeGetInfoWithNoFQDN`, f.iCallNodeGetInfoWithNoFQDN)
s.Step(`^a valid NodeGetInfoResponse is returned$`, f.aValidNodeGetInfoResponseIsReturned)
}

// GetPluginInfo
Expand Down Expand Up @@ -2219,3 +2221,14 @@ func (f *feature) iSetRootClientEnabledTo(val string) error {
f.rootClientEnabled = val
return nil
}

func (f *feature) iCallNodeGetInfoWithNoFQDN() error {
req := new(csi.NodeGetInfoRequest)
f.service.nodeIP = "192.0.2.0"
f.nodeGetInfoResponse, f.err = f.service.NodeGetInfo(context.Background(), req)
if f.err != nil {
log.Printf("NodeGetInfo call failed: %s\n", f.err.Error())
return f.err
}
return nil
}
14 changes: 14 additions & 0 deletions test/integration/features/main_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,20 @@ Feature: Isilon CSI interface
| 2 |
| 4 |

@v1.0
Scenario: Create, ControllerPublish, ControllerUnpublish, delete basic volume , run with nodeID which has IP isntead of FQDN
Given a Isilon service
And a basic volume request "integration0" "8"
When I call CreateVolume
When I call ControllerPublishVolume "X_CSI_NODE_NAME_NO_FQDN"
Then there are no errors
When I call ControllerUnpublishVolume "X_CSI_NODE_NAME_NO_FQDN"
Then there are no errors
When I call DeleteVolume
Then there is not a directory "integration0"
Then there is not an export "integration0"


@v1.0
Scenario: Cleanup all the files created
Given a Isilon service
Expand Down
5 changes: 4 additions & 1 deletion test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ func TestMain(m *testing.M) {
if hostFQDN == "unknown" {
fmt.Printf("cannot get FQDN")
}
nodeIP := os.Getenv("X_CSI_NODE_IP")
if os.Getenv("X_CSI_CUSTOM_TOPOLOGY_ENABLED") == "true" {
nodeName := host + nodeIDSeparator + hostFQDN + nodeIDSeparator + os.Getenv("X_CSI_NODE_IP")
nodeName := host + nodeIDSeparator + hostFQDN + nodeIDSeparator + nodeIP
os.Setenv("X_CSI_NODE_NAME", nodeName)
}
nodeNameWithoutFQDN := host + nodeIDSeparator + nodeIP + nodeIDSeparator + nodeIP
os.Setenv("X_CSI_NODE_NAME_NO_FQDN", nodeNameWithoutFQDN)

// Make the file needed for NodeStage:
// /tmp/datadir -- for file system mounts
Expand Down