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

NFS tree quota support #222

Closed
wants to merge 13 commits into from
Closed

NFS tree quota support #222

wants to merge 13 commits into from

Conversation

khareRajshree
Copy link
Contributor

@khareRajshree khareRajshree commented Jul 25, 2023

Description

Add support for tree quota for NFS volume creation and expansion.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#763

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?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • unit tests
  • functional tests:
  • created volume with quota enabled
  • expand volume with quota enabled

helm test:
executed 1vol-nfs
then expand volume by re-applying the yaml.

time="2023-07-31T13:39:43Z" level=info msg="/csi.v1.Controller/CreateVolume: REQ 0025: Name=twee-a75f5c4dcd, CapacityRange=required_bytes:8589934592 , VolumeCapabilities=[mount:<fs_type:\"nfs\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > ], Parameters=map[allowRoot:false csi.storage.k8s.io/pv/name:twee-a75f5c4dcd csi.storage.k8s.io/pvc/name:pvol0 csi.storage.k8s.io/pvc/namespace:helmtest-vxflexos gracePeriod:86400 nasName:env8nasserver nfsAcls:0777 path:/fs softLimit:80 storagepool:Env8-SP-SW_SSD-1 systemID:05d539c3cdc5280f], AccessibilityRequirements=requisite:<segments:<key:\"csi-vxflexos.dellemc.com/05d539c3cdc5280f-nfs\" value:\"true\" > > preferred:<segments:<key:\"csi-vxflexos.dellemc.com/05d539c3cdc5280f-nfs\" value:\"true\" > > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T13:39:43Z" level=info msg="getSystemIDFromParameters system 05d539c3cdc5280f"
time="2023-07-31T13:39:43Z" level=info msg="Use systemID as 05d539c3cdc5280f"
time="2023-07-31T13:39:43Z" level=info msg="Found topology constraint: VxFlex OS system: 05d539c3cdc5280f-nfs"
time="2023-07-31T13:39:43Z" level=info msg="Added accessible topology segment for volume: twee-a75f5c4dcd, segment: csi-vxflexos.dellemc.com/05d539c3cdc5280f = true"
time="2023-07-31T13:39:43Z" level=info msg="Accessible topology for volume: twee-a75f5c4dcd, segments: map[string]string{\"csi-vxflexos.dellemc.com/05d539c3cdc5280f\":\"true\"}"
time="2023-07-31T13:39:43Z" level=info msg="Protection Domain name not provided; there could be conflicts if two storage pools share a name"
time="2023-07-31T13:39:44Z" level=info msg="Executing CreateVolume with following fields" Name=twee-a75f5c4dcd NasServerID=64132f37-d33e-9d4a-89ba-d625520a4779 SizeInB=8589934592 StoragePoolID=28515fee00000000 x-csi-pv-claimname=pvol0 x-csi-pv-name=twee-a75f5c4dcd x-csi-pv-namespace=helmtest-vxflexos
time="2023-07-31T13:39:44Z" level=debug msg="Volume does not exist, proceeding to create new volume"
time="2023-07-31T13:40:01Z" level=debug msg="Begin to set quota for FS '64c7b9a0-00b3-0a1a-3421-3a7645b0a943', size '8589934592', quota enabled: 'true'"
time="2023-07-31T13:40:01Z" level=info msg="Executing CreateTreeQuota with following fields" FileSystemID=64c7b9a0-00b3-0a1a-3421-3a7645b0a943 GracePeriod=86400 HardLimit=8589934592 Path=/fs SoftLimit=6871947673
time="2023-07-31T13:40:02Z" level=info msg="Tree quota set for: 8589934592 bytes on directory: '/fs', quota ID: 00000003-0261-0000-0100-000000000000"
time="2023-07-31T13:40:02Z" level=info msg="/csi.v1.Controller/CreateVolume: REP 0025: Volume=capacity_bytes:8589934592 volume_id:\"05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943\" volume_context:<key:\"CreationTime\" value:\"1970-01-01 00:00:00 +0000 UTC\" > volume_context:<key:\"InstallationID\" value:\"04cfcf6a7ded067f\" > volume_context:<key:\"Name\" value:\"twee-a75f5c4dcd\" > volume_context:<key:\"NasServerID\" value:\"64132f37-d33e-9d4a-89ba-d625520a4779\" > volume_context:<key:\"StoragePoolID\" value:\"28515fee00000000\" > volume_context:<key:\"StoragePoolName\" value:\"Env8-SP-SW_SSD-1\" > volume_context:<key:\"StorageSystem\" value:\"05d539c3cdc5280f\" > volume_context:<key:\"fsType\" value:\"nfs\" > volume_context:<key:\"nasName\" value:\"env8nasserver\" > volume_context:<key:\"nfsAcls\" value:\"0777\" > accessible_topology:<segments:<key:\"csi-vxflexos.dellemc.com/05d539c3cdc5280f-nfs\" value:\"true\" > > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T13:40:02Z" level=info msg="/csi.v1.Controller/ControllerPublishVolume: REQ 0026: VolumeId=05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943, NodeId=F57AFEF1-2273-5DFB-8D5A-3763F475335F, VolumeCapability=mount:<fs_type:\"nfs\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > , Readonly=false, VolumeContext=map[CreationTime:1970-01-01 00:00:00 +0000 UTC InstallationID:04cfcf6a7ded067f Name:twee-a75f5c4dcd NasServerID:64132f37-d33e-9d4a-89ba-d625520a4779 StoragePoolID:28515fee00000000 StoragePoolName:Env8-SP-SW_SSD-1 StorageSystem:05d539c3cdc5280f fsType:nfs nasName:env8nasserver nfsAcls:0777 storage.kubernetes.io/csiProvisionerIdentity:1690810521582-3548-csi-vxflexos.dellemc.com], XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T13:40:02Z" level=info msg="VolumeContext:"
time="2023-07-31T13:40:02Z" level=info msg="    [NasServerID]=64132f37-d33e-9d4a-89ba-d625520a4779"
time="2023-07-31T13:40:02Z" level=info msg="    [StoragePoolID]=28515fee00000000"
time="2023-07-31T13:40:02Z" level=info msg="    [nasName]=env8nasserver"
time="2023-07-31T13:40:02Z" level=info msg="    [CreationTime]=1970-01-01 00:00:00 +0000 UTC"
time="2023-07-31T13:40:02Z" level=info msg="    [StorageSystem]=05d539c3cdc5280f"
time="2023-07-31T13:40:02Z" level=info msg="    [nfsAcls]=0777"
time="2023-07-31T13:40:02Z" level=info msg="    [storage.kubernetes.io/csiProvisionerIdentity]=1690810521582-3548-csi-vxflexos.dellemc.com"
time="2023-07-31T13:40:02Z" level=info msg="    [InstallationID]=04cfcf6a7ded067f"
time="2023-07-31T13:40:02Z" level=info msg="    [StoragePoolName]=Env8-SP-SW_SSD-1"
time="2023-07-31T13:40:02Z" level=info msg="    [Name]=twee-a75f5c4dcd"
time="2023-07-31T13:40:02Z" level=info msg="    [fsType]=nfs"
time="2023-07-31T13:40:02Z" level=info msg="Volume ID: 05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943 contains system ID: 05d539c3cdc5280f. checkVolumesMap passed"
time="2023-07-31T13:40:03Z" level=debug msg="NFS Export does not exist for fs: twee-a75f5c4dcd ,proceeding to create NFS Export"
time="2023-07-31T13:40:04Z" level=debug msg="NFS Export: 64c7b9b3-81a7-7021-5b92-3a7645b0a943 is accessible to host: F57AFEF1-2273-5DFB-8D5A-3763F475335F with access mode: SINGLE_NODE_MULTI_WRITER"
time="2023-07-31T13:40:04Z" level=debug msg="ControllerPublishVolume successful for volid: [05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943]"
time="2023-07-31T13:40:04Z" level=info msg="/csi.v1.Controller/ControllerPublishVolume: REP 0026: PublishContext=map[host:10.247.96.94 nasName:env8nasserver nfsAcls:0777 volumeContextId:05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943], XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"

k apply -f /csi-powerflex/test/helm/1vol-nfs/templates/pvc0.yaml

time="2023-07-31T13:43:02Z" level=info msg="/csi.v1.Controller/ControllerExpandVolume: REQ 0029: VolumeId=05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943, CapacityRange=required_bytes:17179869184 , VolumeCapability=mount:<fs_type:\"nfs\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T13:43:02Z" level=info msg="[ControllerExpandVolume] req: volume_id:\"05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943\" capacity_range:<required_bytes:17179869184 > volume_capability:<mount:<fs_type:\"nfs\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > > "
time="2023-07-31T13:43:02Z" level=info msg="Volume ID: 05d539c3cdc5280f/64c7b9a0-00b3-0a1a-3421-3a7645b0a943 contains system ID: 05d539c3cdc5280f. checkVolumesMap passed"
time="2023-07-31T13:43:02Z" level=info msg="cr:&{17179869184 0 {} [] 0}"
time="2023-07-31T13:43:02Z" level=info msg="req.size:17179869184"
time="2023-07-31T13:43:02Z" level=info msg="Executing ExpandVolume with following fields" RequestID=29 RequestedSize=17179869184 fileSystemName=twee-a75f5c4dcd
time="2023-07-31T13:43:02Z" level=info msg="allocatedsize:8589934592"
time="2023-07-31T13:43:05Z" level=info msg="Tree quota ID 00000003-0261-0000-0100-000000000000 for filesystem ID: 64c7b9a0-00b3-0a1a-3421-3a7645b0a943"
time="2023-07-31T13:43:05Z" level=info msg="Tree quota modified successfully."
time="2023-07-31T13:43:05Z" level=info msg="/csi.v1.Controller/ControllerExpandVolume: REP 0029: CapacityBytes=17179869184, NodeExpansionRequired=false, XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"

cert-csi:

./cert-csi test expansion -v 1 -p 1 -iSize 8Gi -expSize 12Gi --sc vxflexos-nfs

[2023-07-31 10:02:59]  INFO Starting cert-csi; ver. 0.8.1
[2023-07-31 10:02:59]  INFO Using EVENT observer type
[2023-07-31 10:02:59]  INFO Using default config
[2023-07-31 10:02:59]  INFO Successfully loaded config. Host: https://10.247.96.93:6443
[2023-07-31 10:02:59]  INFO Created new KubeClient
[2023-07-31 10:02:59]  INFO Running 1 iteration(s)
[2023-07-31 10:02:59]  INFO     *** ITERATION NUMBER 1 ***
[2023-07-31 10:02:59]  INFO Starting VolumeExpansionSuite with vxflexos-nfs storage class
[2023-07-31 10:02:59]  INFO Successfully created namespace volume-expansion-suite-7d4936c5
[2023-07-31 10:02:59]  INFO Creating 1 pods, each with 1 volumes of size (8Gi)
[2023-07-31 10:02:59]  INFO Waiting for all pods in volume-expansion-suite-7d4936c5 to be READY
[2023-07-31 10:03:31]  INFO All pods are ready in 32.007950849s
[2023-07-31 10:03:31]  INFO Requested 8388608 KiB, got 8388608 KiB -- delta is 0 KiB
[2023-07-31 10:03:31]  INFO Expanding the size of volumes from 8Gi to 12Gi
[2023-07-31 10:03:41]  INFO Checking if pod-prov-test-jr96v/data0 was properly resized

controller logs:

time="2023-07-31T14:02:59Z" level=info msg="Executing CreateVolume with following fields" Name=twee-ada8df9e95 NasServerID=64132f37-d33e-9d4a-89ba-d625520a4779 SizeInB=8589934592 StoragePoolID=28515fee00000000 x-csi-pv-claimname=vol-create-test-bcvbg x-csi-pv-name=twee-ada8df9e95 x-csi-pv-namespace=volume-expansion-suite-7d4936c5
time="2023-07-31T14:03:00Z" level=debug msg="Volume does not exist, proceeding to create new volume"
time="2023-07-31T14:03:04Z" level=info msg="/csi.v1.Controller/ControllerUnpublishVolume: REQ 0028: VolumeId=05d539c3cdc5280f/64be7647-931d-fa19-0989-3a7645b0a943, NodeId=F57AFEF1-2273-5DFB-8D5A-3763F475335F, XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T14:03:04Z" level=info msg="Volume ID: 05d539c3cdc5280f/64be7647-931d-fa19-0989-3a7645b0a943 contains system ID: 05d539c3cdc5280f. checkVolumesMap passed"
time="2023-07-31T14:03:04Z" level=info msg="/csi.v1.Controller/ControllerUnpublishVolume: REP 0028: rpc error: code = NotFound desc = volume not found"
time="2023-07-31T14:03:18Z" level=debug msg="Begin to set quota for FS '64c7bf14-813a-45d1-35fc-3a7645b0a943', size '8589934592', quota enabled: 'true'"
time="2023-07-31T14:03:18Z" level=info msg="Executing CreateTreeQuota with following fields" FileSystemID=64c7bf14-813a-45d1-35fc-3a7645b0a943 GracePeriod=86400 HardLimit=8589934592 Path=/fs SoftLimit=6871947673
time="2023-07-31T14:03:18Z" level=info msg="Tree quota set for: 8589934592 bytes on directory: '/fs', quota ID: 00000003-0263-0000-0100-000000000000"
time="2023-07-31T14:03:18Z" level=info msg="/csi.v1.Controller/CreateVolume: REP 0027: Volume=capacity_bytes:8589934592 volume_id:\"05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943\" volume_context:<key:\"CreationTime\" value:\"1970-01-01 00:00:00 +0000 UTC\" > volume_context:<key:\"InstallationID\" value:\"04cfcf6a7ded067f\" > volume_context:<key:\"Name\" value:\"twee-ada8df9e95\" > volume_context:<key:\"NasServerID\" value:\"64132f37-d33e-9d4a-89ba-d625520a4779\" > volume_context:<key:\"StoragePoolID\" value:\"28515fee00000000\" > volume_context:<key:\"StoragePoolName\" value:\"Env8-SP-SW_SSD-1\" > volume_context:<key:\"StorageSystem\" value:\"05d539c3cdc5280f\" > volume_context:<key:\"fsType\" value:\"nfs\" > volume_context:<key:\"nasName\" value:\"env8nasserver\" > volume_context:<key:\"nfsAcls\" value:\"0777\" > accessible_topology:<segments:<key:\"csi-vxflexos.dellemc.com/05d539c3cdc5280f-nfs\" value:\"true\" > > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T14:03:19Z" level=info msg="/csi.v1.Controller/ControllerPublishVolume: REQ 0029: VolumeId=05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943, NodeId=F57AFEF1-2273-5DFB-8D5A-3763F475335F, VolumeCapability=mount:<fs_type:\"nfs\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > , Readonly=false, VolumeContext=map[CreationTime:1970-01-01 00:00:00 +0000 UTC InstallationID:04cfcf6a7ded067f Name:twee-ada8df9e95 NasServerID:64132f37-d33e-9d4a-89ba-d625520a4779 StoragePoolID:28515fee00000000 StoragePoolName:Env8-SP-SW_SSD-1 StorageSystem:05d539c3cdc5280f fsType:nfs nasName:env8nasserver nfsAcls:0777 storage.kubernetes.io/csiProvisionerIdentity:1690811549190-9056-csi-vxflexos.dellemc.com], XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T14:03:19Z" level=info msg="VolumeContext:"
time="2023-07-31T14:03:19Z" level=info msg="    [StoragePoolName]=Env8-SP-SW_SSD-1"
time="2023-07-31T14:03:19Z" level=info msg="    [InstallationID]=04cfcf6a7ded067f"
time="2023-07-31T14:03:19Z" level=info msg="    [StoragePoolID]=28515fee00000000"
time="2023-07-31T14:03:19Z" level=info msg="    [StorageSystem]=05d539c3cdc5280f"
time="2023-07-31T14:03:19Z" level=info msg="    [nfsAcls]=0777"
time="2023-07-31T14:03:19Z" level=info msg="    [CreationTime]=1970-01-01 00:00:00 +0000 UTC"
time="2023-07-31T14:03:19Z" level=info msg="    [NasServerID]=64132f37-d33e-9d4a-89ba-d625520a4779"
time="2023-07-31T14:03:19Z" level=info msg="    [storage.kubernetes.io/csiProvisionerIdentity]=1690811549190-9056-csi-vxflexos.dellemc.com"
time="2023-07-31T14:03:19Z" level=info msg="    [fsType]=nfs"
time="2023-07-31T14:03:19Z" level=info msg="    [Name]=twee-ada8df9e95"
time="2023-07-31T14:03:19Z" level=info msg="    [nasName]=env8nasserver"
time="2023-07-31T14:03:19Z" level=info msg="Volume ID: 05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943 contains system ID: 05d539c3cdc5280f. checkVolumesMap passed"
time="2023-07-31T14:03:20Z" level=debug msg="NFS Export does not exist for fs: twee-ada8df9e95 ,proceeding to create NFS Export"
time="2023-07-31T14:03:21Z" level=debug msg="NFS Export: 64c7bf28-f9b5-ec43-a13b-3a7645b0a943 is accessible to host: F57AFEF1-2273-5DFB-8D5A-3763F475335F with access mode: SINGLE_NODE_MULTI_WRITER"
time="2023-07-31T14:03:21Z" level=debug msg="ControllerPublishVolume successful for volid: [05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943]"
time="2023-07-31T14:03:21Z" level=info msg="/csi.v1.Controller/ControllerPublishVolume: REP 0029: PublishContext=map[host:10.247.96.94 nasName:env8nasserver nfsAcls:0777 volumeContextId:05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943], XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T14:03:31Z" level=info msg="/csi.v1.Controller/ControllerGetCapabilities: REQ 0030: XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T14:03:31Z" level=info msg="/csi.v1.Controller/ControllerGetCapabilities: REP 0030: Capabilities=[rpc:<type:CREATE_DELETE_VOLUME >  rpc:<type:PUBLISH_UNPUBLISH_VOLUME >  rpc:<type:GET_CAPACITY >  rpc:<type:CREATE_DELETE_SNAPSHOT >  rpc:<type:LIST_SNAPSHOTS >  rpc:<type:EXPAND_VOLUME >  rpc:<type:CLONE_VOLUME >  rpc:<type:SINGLE_NODE_MULTI_WRITER > ], XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T14:03:31Z" level=info msg="/csi.v1.Controller/ControllerExpandVolume: REQ 0031: VolumeId=05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943, CapacityRange=required_bytes:12884901888 , VolumeCapability=mount:<fs_type:\"nfs\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2023-07-31T14:03:31Z" level=info msg="[ControllerExpandVolume] req: volume_id:\"05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943\" capacity_range:<required_bytes:12884901888 > volume_capability:<mount:<fs_type:\"nfs\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > > "
time="2023-07-31T14:03:31Z" level=info msg="Volume ID: 05d539c3cdc5280f/64c7bf14-813a-45d1-35fc-3a7645b0a943 contains system ID: 05d539c3cdc5280f. checkVolumesMap passed"
time="2023-07-31T14:03:32Z" level=info msg="cr:&{12884901888 0 {} [] 0}"
time="2023-07-31T14:03:32Z" level=info msg="req.size:12884901888"
time="2023-07-31T14:03:32Z" level=info msg="Executing ExpandVolume with following fields" RequestID=31 RequestedSize=12884901888 fileSystemName=twee-ada8df9e95
time="2023-07-31T14:03:32Z" level=info msg="allocatedsize:8589934592"
time="2023-07-31T14:03:34Z" level=info msg="Modifying tree quota ID 00000003-0263-0000-0100-000000000000 for filesystem ID: 64c7bf14-813a-45d1-35fc-3a7645b0a943"
time="2023-07-31T14:03:34Z" level=info msg="Tree quota modified successfully."
time="2023-07-31T14:03:34Z" level=info msg="/csi.v1.Controller/ControllerExpandVolume: REP 0031: CapacityBytes=12884901888, NodeExpansionRequired=false, XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"

}

// create quota for the filesystem
if isQuotaEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why to check the isQuotaEnabled again here. I think we are checking this above at line no: 379

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

// enabling quota on FS
fs, err := system.GetFileSystemByIDName(fsID, "")
if err != nil {
Log.Debugf("Find Volume response: %v Error: %v", fs, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

don't we return error when the filesystem is not found?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

service/controller.go Show resolved Hide resolved
@@ -1265,12 +1265,24 @@ Feature: VxFlex OS CSI interface
When I call Node Probe
Then the error contains "The given GUID is invalid"

Scenario: Controller expand volume for NFS
Given a VxFlexOS service
# @wip
Copy link
Contributor

Choose a reason for hiding this comment

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

can you removed these commented tests if they are not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@@ -791,7 +802,7 @@ func handleFileSystems(w http.ResponseWriter, r *http.Request) {
replacementMap["__ID__"] = id
replacementMap["__NAME__"] = name
replacementMap["__SIZE_IN_Total__"] = fileSystemIDToSizeTotal[id]
replacementMap["__PARENT_ID__"] = fileSystemIDParentID[id]
//replacementMap["__IS_QUOTA_ENABLED__"] = fileSystemIDToQuotaEnabled[id]
Copy link
Contributor

Choose a reason for hiding this comment

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

why are you replacing the parent id to quota?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

fs, err := system.GetFileSystemByIDName(fsResp.ID, "")
if err != nil {
Log.Debugf("Find Volume response error: %v", err)
return nil, status.Errorf(codes.Unknown, "Find Volume response error: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here codes.notfound or codes.internal will be a great fit rather than codes.unknow thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @VamsiSiddu-7, I referred to the existing codes used for such error scenarios, hence went ahead to maintain the same responses.
https://github.com/dell/csi-powerflex/blob/main/service/controller.go#L361
If we plan to change it here, then it should be reflected to other instances as well to maintain the consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

okay let's keep it the same codes.Unknown we will have consistency

newFs, err := system.GetFileSystemByIDName(fsResp.ID, "")
if err != nil {
Log.Debugf("Find Volume response: %v Error: %v", newFs, err)
Log.Debugf("Find Volume response error: %v", err)
return nil, status.Errorf(codes.Unknown, "Find Volume response error: %v", err)
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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keeping it same to maintain consistency.

Copy link
Contributor

@VamsiSiddu-7 VamsiSiddu-7 left a comment

Choose a reason for hiding this comment

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

still need some changes please address those thanks

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.

2 participants