From 1b23f8ed68e1d4fd5e26845cf40eafc4feb10982 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 9a26247585..f23dd0f05b 100644 --- a/pkg/azurefile/azure.go +++ b/pkg/azurefile/azure.go @@ -30,6 +30,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azure "sigs.k8s.io/cloud-provider-azure/pkg/provider" ) @@ -208,7 +209,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