dell/csm

[BUG]: CSI Unity node pods are failing when empty allowedNetworks is passed in the values.yaml

suryagupta4 opened this issue · 2 comments

Bug Description

CSI Unity node pods are failing to go into running state when empty allowedNetworks is passed in the values.yaml

dell/helm-charts/charts/csi-unity/values.yaml

# Examples: [192.168.1.0/24, 192.168.100.0/22]
allowedNetworks: []

networksList is getting updated with [[]] hence resulting in having length 1

dell/csi-unity/service/service.go

var networksList []string
if allNetworks, ok := csictx.LookupEnv(ctx, EnvAllowedNetworks); ok {
	networksList = strings.Split(allNetworks, " ")
}
opts.allowedNetworks = networksList

Here, GetNFSClientIP is being called with [[]] which is resulting in error:
Failed to find IP address corresponding to the allowed network with error

if len(s.opts.allowedNetworks) > 0 {
	log.Debugf("Fetching IP address of custom network for NFS I/O traffic")
	nodeIps, err = utils.GetNFSClientIP(s.opts.allowedNetworks)
	if err != nil {
		log.Fatalf("Failed to find IP address corresponding to the allowed network with error %s", err.Error())
	return err
	}
}

When allowedNetworks is not set, nodeIps is supposed to be set by running hostname -i to fetch the correct ip address of the worker node
nodeIps, err = utils.GetHostIP()

Logs

time="2024-06-18T08:29:04Z" level=info msg="/csi.v1.Identity/GetPluginInfo: REP 0001: Name=csi-unity.dellemc.com, VendorVersion=2.10.0+36+dirty, Manifest=map[commit:ba85f7e134cfe362ab6aad573b769a9f03620145 formed:Tue, 04 Jun 2024 12:08:48 UTC semver:2.10.0+36+dirty url:http://github.com/dell/csi-unity], XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2024-06-18T08:29:04Z" level=warning arrayid=apm00213404195 runid=node-2 msg="Cannot read directory: /sys/class/fc_host : open /sys/class/fc_host: no such file or directory" func="github.com/dell/csi-unity/service/utils.GetFCInitiators()" file="/go/src/csi-unity/service/utils/emcutils.go:102"
time="2024-06-18T08:29:04Z" level=warning arrayid=apm00213404195 runid=node-2 msg="'FC Initiators' cannot be retrieved." func="github.com/dell/csi-unity/service.(*service).addNodeInformationIntoArray()" file="/go/src/csi-unity/service/node.go:1518"
time="2024-06-18T08:29:04Z" level=fatal arrayid=apm00213404195 runid=node-2 msg="Failed to find IP address corresponding to the allowed network with error invalid CIDR address: []" func="github.com/dell/csi-unity/service.(*service).addNodeInformationIntoArray()" file="/go/src/csi-unity/service/node.go:1546"

Screenshots

No response

Additional Environment Information

No response

Steps to Reproduce

Install CSI Unity with the latest values.yaml

Expected Behavior

Driver pods

CSM Driver(s)

CSI Unity

Installation Type

No response

Container Storage Modules Enabled

No response

Container Orchestrator

Kubernetes

Operating System

RHEL

@suryagupta4 If this was introduced during the development phase of CSM 1.11.0 then milestone should not be 1.11.0.
I hope this particular issue is not seen till CSM 1.10.2.
Thanks

@suryagupta4 If this was introduced during the development phase of CSM 1.11.0 then milestone should not be 1.11.0. I hope this particular issue is not seen till CSM 1.10.2. Thanks

Yes, this bug was not part of CSM 1.10.2, it was targeted for CSM 1.11