kubernetes-sigs / vsphere-csi-driver

vSphere storage Container Storage Interface (CSI) plugin
https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/index.html
Apache License 2.0
295 stars 181 forks source link

Query configmap if capability found disabled in the cached config-map #3116

Closed divyenpatel closed 4 days ago

divyenpatel commented 5 days ago

What this PR does / why we need it: This PR addresses the issue where the Workload_Domain_Isolation_Supported WCP capability is enabled after the CSI is upgraded, but the cached WCP capability configmap may not reflect this change.

With this update, when the driver checks the Workload_Domain_Isolation_Supported FeatureState, If the driver detects that the FSS is disabled in the cached configmap, it will re-fetch the configmap, update the cached version, and recheck the state to confirm whether the FSS is still disabled or has been enabled.

This deeper check ensures that the CSI controller properly detects and enables the capability if it was enabled after the initial CSI upgrade, preventing failures that occur when the capability is not activated due to stale cached configuration data.

Testing done:

Logs

Started controller when Workload_Domain_Isolation_Supported capability was false. Capability got enabled while controller is running. Created PVC after that and Controller fetched capability again from the configmap.

root@421e1ba2adfa2714127121b8013dec4f [ ~ ]# kubectl  logs vsphere-csi-controller-6b5f697969-t5q55 -n vmware-system-csi -c vsphere-csi-controller |grep "WCP cluster capabilities map -"
{"level":"info","time":"2024-11-21T05:05:19.911987936Z","caller":"k8sorchestrator/k8sorchestrator.go:1146","msg":"WCP cluster capabilities map - map[Add_NSX_Day2_M1_Supported:false CSI_Detach_Supported:true Control_Plane_Backup_Restore_Supported:true Foundation_Load_Balancer_Supported:true Fronting_CPVM_Services_Via_LB_Supported:false Import_OVF_In_Namespace_CL_Supported:true Load_Balancer_Supported:true MultipleCL_For_TKG_Supported:true Only_Generate_Http_Proxy_Secret:true PodVM_On_DHCP_VDS_Supported:true PodVM_On_Stretched_Supervisor_Supported:true PodVM_On_VDS_Supported:true Resume_Failed_Supervisor_Upgrade_Supported:true Supervisor_New_Folder_Hierarchy_Supported:true TKG_SupervisorService_Supported:true Tanzu_Topology_CR_Supported:true VMImage_ResourceNamingStrategy_Supported:true VPC_Supported:false Vdpp_On_Stretched_Supervisor:false Workload_Domain_Isolation_Supported:false supports_Supervisor_Service_allow_list:true supports_max_concurrent_dns_forwards:true supports_secure_Supervisor_Service_platform:false supports_supervisor_VCFOps_integration:false supports_supervisor_async_upgrade:true]","TraceId":"0fcd41f2-0e7a-4e98-93ec-9748c7c4a520"}
{"level":"info","time":"2024-11-21T05:10:55.091710321Z","caller":"k8sorchestrator/k8sorchestrator.go:1173","msg":"WCP cluster capabilities map - map[Add_NSX_Day2_M1_Supported:false CSI_Detach_Supported:true Control_Plane_Backup_Restore_Supported:true Foundation_Load_Balancer_Supported:true Fronting_CPVM_Services_Via_LB_Supported:false Import_OVF_In_Namespace_CL_Supported:true Load_Balancer_Supported:true MultipleCL_For_TKG_Supported:true Only_Generate_Http_Proxy_Secret:true PodVM_On_DHCP_VDS_Supported:true PodVM_On_Stretched_Supervisor_Supported:true PodVM_On_VDS_Supported:true Resume_Failed_Supervisor_Upgrade_Supported:true Supervisor_New_Folder_Hierarchy_Supported:true TKG_SupervisorService_Supported:true Tanzu_Topology_CR_Supported:true VMImage_ResourceNamingStrategy_Supported:true VPC_Supported:false Vdpp_On_Stretched_Supervisor:false Workload_Domain_Isolation_Supported:true supports_Supervisor_Service_allow_list:true supports_max_concurrent_dns_forwards:true supports_secure_Supervisor_Service_platform:false supports_supervisor_VCFOps_integration:false supports_supervisor_async_upgrade:true]","TraceId":"1bf8ec3b-31a4-418b-9ef6-fc8e5e7ab326"}

Special notes for your reviewer:

Release note:

Query configmap if capability found disabled in the cached config-map
divyenpatel commented 5 days ago

/test pull-vsphere-csi-driver-verify-golangci-lint

shalini-b commented 5 days ago

Change looks good to me /approve

k8s-ci-robot commented 5 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel, shalini-b

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/master/OWNERS)~~ [divyenpatel,shalini-b] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
shalini-b commented 4 days ago

/ok-to-test

shalini-b commented 4 days ago

/lgtm

divyenpatel commented 4 days ago

/test pull-vsphere-csi-driver-unit-test