Skip to content

Commit

Permalink
Rearrange protocol preference for automatic selection (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
delldubey authored Jul 22, 2024
1 parent 6e7fee8 commit 2062fbd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion csireverseproxy/pkg/standaloneproxy/standaloneproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func newReverseProxy(mgmtServer config.ManagementServer) common.Proxy {
}

func newTLSConfig(mgmtServer config.ManagementServer) *tls.Config {

tlsConfig := tls.Config{
InsecureSkipVerify: mgmtServer.SkipCertificateValidation, // #nosec G402 InsecureSkipVerify cannot be false always as expected by gosec, this needs to be configurable
}
Expand Down
29 changes: 19 additions & 10 deletions service/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1779,12 +1779,26 @@ func (s *service) nodeHostSetup(ctx context.Context, portWWNs []string, IQNs []s
}

if !s.useFC && !s.useIscsi && !s.useNVMeTCP {
log.Error("No valid initiators- could not initialize FC or iSCSI")
log.Error("No valid initiators- could not initialize NVMeTCP or FC or iSCSI")
return err
}

nodeChroot, _ := csictx.LookupEnv(context.Background(), EnvNodeChroot)
if s.useFC {
if s.useNVMeTCP {
// resetOtherProtocols
s.useFC = false
s.useIscsi = false
// check nvme module availability on the host
err = s.setupArrayForNVMeTCP(ctx, symID, validNVMeTCPs, pmaxClient)
if err != nil {
log.Errorf("Failed to do the NVMe setup for the Array(%s). Error - %s", symID, err.Error())
}
s.initNVMeTCPConnector(nodeChroot)
s.arrayTransportProtocolMap[symID] = NvmeTCPTransportProtocol
} else if s.useFC {
// resetOtherProtocols
s.useNVMeTCP = false
s.useIscsi = false
formattedFCs := make([]string, 0)
for _, initiatorID := range validFCs {
elems := strings.Split(initiatorID, ":")
Expand All @@ -1798,6 +1812,9 @@ func (s *service) nodeHostSetup(ctx context.Context, portWWNs []string, IQNs []s
s.arrayTransportProtocolMap[symID] = FcTransportProtocol
isSymConnFC[symID] = true
} else if s.useIscsi {
// resetOtherProtocols
s.useNVMeTCP = false
s.useNFS = false
err := s.ensureISCSIDaemonStarted()
if err != nil {
log.Errorf("Failed to start the ISCSI Daemon. Error - %s", err.Error())
Expand All @@ -1808,14 +1825,6 @@ func (s *service) nodeHostSetup(ctx context.Context, portWWNs []string, IQNs []s
}
s.initISCSIConnector(nodeChroot)
s.arrayTransportProtocolMap[symID] = IscsiTransportProtocol
} else if s.useNVMeTCP {
// check nvme module availability on the host
err = s.setupArrayForNVMeTCP(ctx, symID, validNVMeTCPs, pmaxClient)
if err != nil {
log.Errorf("Failed to do the NVMe setup for the Array(%s). Error - %s", symID, err.Error())
}
s.initNVMeTCPConnector(nodeChroot)
s.arrayTransportProtocolMap[symID] = NvmeTCPTransportProtocol
}
}

Expand Down

0 comments on commit 2062fbd

Please sign in to comment.