Skip to content

Commit

Permalink
Fix unexpected pls deletion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jwtty authored and k8s-infra-cherrypick-robot committed Jun 14, 2022
1 parent 3fd1686 commit 16c506c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/provider/azure_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ func (az *Cloud) isFrontendIPChanged(clusterName string, config network.Frontend
if !existsSubnet {
return false, fmt.Errorf("failed to get subnet")
}
if config.Subnet != nil && !strings.EqualFold(to.String(config.Subnet.Name), to.String(subnet.Name)) {
if config.Subnet != nil && !strings.EqualFold(to.String(config.Subnet.ID), to.String(subnet.ID)) {
return true, nil
}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/provider/azure_loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1595,17 +1595,17 @@ func TestIsFrontendIPChanged(t *testing.T) {
},
{
desc: "isFrontendIPChanged shall return true if the service is internal and " +
"config.Subnet.Name == subnet.Name",
"config.Subnet.ID != subnet.ID",
config: network.FrontendIPConfiguration{
Name: to.StringPtr("btest1-name"),
FrontendIPConfigurationPropertiesFormat: &network.FrontendIPConfigurationPropertiesFormat{
Subnet: &network.Subnet{Name: to.StringPtr("testSubnet")},
Subnet: &network.Subnet{ID: to.StringPtr("testSubnet")},
},
},
lbFrontendIPConfigName: "btest1-name",
service: getInternalTestService("test1", 80),
annotations: "testSubnet",
existingSubnet: network.Subnet{Name: to.StringPtr("testSubnet1")},
existingSubnet: network.Subnet{ID: to.StringPtr("testSubnet1")},
expectedFlag: true,
expectedError: false,
},
Expand Down

0 comments on commit 16c506c

Please sign in to comment.