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