From ddec7684852c9457e9c3afe4749d1b2634c6c27c Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Mon, 16 Oct 2023 12:37:30 +0000 Subject: [PATCH] fix: nfs volume creation failure due to global storage ep enabled --- pkg/azurefile/azure.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/azurefile/azure.go b/pkg/azurefile/azure.go index 4b1a399d14..2b4d8ee4c5 100644 --- a/pkg/azurefile/azure.go +++ b/pkg/azurefile/azure.go @@ -33,6 +33,7 @@ import ( "k8s.io/client-go/tools/clientcmd" certutil "k8s.io/client-go/util/cert" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azure "sigs.k8s.io/cloud-provider-azure/pkg/provider" ) @@ -211,7 +212,7 @@ func (d *Driver) updateSubnetServiceEndpoints(ctx context.Context, vnetResourceG } serviceEndpoints := *subnet.SubnetPropertiesFormat.ServiceEndpoints for _, v := range serviceEndpoints { - if v.Service != nil && *v.Service == storageService { + if strings.HasPrefix(pointer.StringDeref(v.Service, ""), storageService) { storageServiceExists = true klog.V(4).Infof("serviceEndpoint(%s) is already in subnet(%s)", storageService, subnetName) break