Change:
assert.Equal(t, len(result), 0, "TestCase[%d]: %s", i, c.desc) } } <ins> func TestServiceOwnsPublicIP(t *testing.T) { tests := []struct { desc        string pip         *network.PublicIPAddress clusterName string serviceName string expected    bool }{ { desc:        "false should be returned when pip is nil", clusterName: "kubernetes", serviceName: "nginx", expected:    false, }, { desc: "false should be returned when service name tag doesn't match", pip: &network.PublicIPAddress{ Tags: map[string]*string{ serviceTagKey: to.StringPtr("nginx"), }, }, serviceName: "web", expected:    false, }, { desc: "true should be returned when service name tag matches and cluster name tag is not set", pip: &network.PublicIPAddress{ Tags: map[string]*string{ serviceTagKey: to.StringPtr("nginx"), }, }, clusterName: "kubernetes", serviceName: "nginx", expected:    true, }, { desc: "false should be returned when cluster name doesn't match", pip: &network.PublicIPAddress{ Tags: map[string]*string{ serviceTagKey:  to.StringPtr("nginx"), clusterNameKey: to.StringPtr("kubernetes"), }, }, clusterName: "k8s", serviceName: "nginx", expected:    false, }, { desc: "false should be returned when cluster name matches while service name doesn't match", pip: &network.PublicIPAddress{ Tags: map[string]*string{ serviceTagKey:  to.StringPtr("web"), clusterNameKey: to.StringPtr("kubernetes"), }, }, clusterName: "kubernetes", serviceName: "nginx", expected:    false, }, { desc: "true should be returned when both service name tag and cluster name match", pip: &network.PublicIPAddress{ Tags: map[string]*string{ serviceTagKey:  to.StringPtr("nginx"), clusterNameKey: to.StringPtr("kubernetes"), }, }, clusterName: "kubernetes", serviceName: "nginx", expected:    true, }, } for i, c := range tests { owns := serviceOwnsPublicIP(c.pip, c.clusterName, c.serviceName) assert.Equal(t, owns, c.expected, "TestCase[%d]: %s", i, c.desc) } } </ins>

Discussion:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is security related, please disclose it privately via --What happened: We deployed two Kubernetes clusters to the same Azure Resource Group. Created services of load balancer type on both clusters. One of the services never received a public IP. Upon investigation, we noticed that the first Kubernetes cluster deleted the Azure Public IP that was created for the service by the other cluster. Apparently, all public IPs in the resource group are retrieved: then public IPs which don't match this criteria: are deleted. This logic besides the name of the kubernetes service should also consider the K8s cluster where the public IP originated from to avoid stepping on each other's toes when multiple clusters share the same resource group. What you expected to happen: In case multiple clusters run in the same resource group a cluster should delete only resources created by itself. How to reproduce it (as minimally and precisely as possible): Create two Kubernetes clusters (1.14) with different cluster names to the same resource group than create kubernetes services of load balancer type in each cluster. Anything else we need to know?: Environment: Kubernetes version (use ): 1.4 Cloud provider or hardware configuration: Azure OS (e.g: ): Kernel (e.g. ): Install tools: Network plugin and version (if this is a network-related bug): Others:
Reiterating the mentions to trigger a notification: <detailsIn response to : Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
thanks for reporting the issue, this is the bug we should fix for sharing resource group. /sig azure /kind bug /assign