Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace deprecated labels with new labels in nodeCache update #4047

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/provider/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) {
az.nodeNames.Delete(prevNode.ObjectMeta.Name)

// Remove from nodeZones cache.
prevZone, ok := prevNode.ObjectMeta.Labels[consts.LabelFailureDomainBetaZone]
prevZone, ok := prevNode.ObjectMeta.Labels[v1.LabelTopologyZone]
if ok && az.isAvailabilityZone(prevZone) {
az.nodeZones[prevZone].Delete(prevNode.ObjectMeta.Name)
if az.nodeZones[prevZone].Len() == 0 {
Expand Down Expand Up @@ -1119,7 +1119,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) {
az.nodeNames.Insert(newNode.ObjectMeta.Name)

// Add to nodeZones cache.
newZone, ok := newNode.ObjectMeta.Labels[consts.LabelFailureDomainBetaZone]
newZone, ok := newNode.ObjectMeta.Labels[v1.LabelTopologyZone]
if ok && az.isAvailabilityZone(newZone) {
if az.nodeZones[newZone] == nil {
az.nodeZones[newZone] = sets.New[string]()
Expand Down
4 changes: 2 additions & 2 deletions pkg/provider/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3675,7 +3675,7 @@ func TestUpdateNodeCaches(t *testing.T) {
prevNode := v1.Node{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
consts.LabelFailureDomainBetaZone: zone,
v1.LabelTopologyZone: zone,
consts.ExternalResourceGroupLabel: consts.TrueAnnotationValue,
consts.ManagedByAzureLabel: "false",
},
Expand All @@ -3694,7 +3694,7 @@ func TestUpdateNodeCaches(t *testing.T) {
newNode := v1.Node{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
consts.LabelFailureDomainBetaZone: zone,
v1.LabelTopologyZone: zone,
consts.ExternalResourceGroupLabel: consts.TrueAnnotationValue,
consts.ManagedByAzureLabel: "false",
v1.LabelNodeExcludeBalancers: "true",
Expand Down