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