Skip to content

Commit

Permalink
Handle bridge vlan deletion during NAD update
Browse files Browse the repository at this point in the history
  • Loading branch information
rrajendran17 committed Mar 4, 2025
1 parent 4ac3d60 commit b93ba87
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controller/agent/nad/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ func (h Handler) removeLocalArea(clusternetwork string, localArea *vlan.LocalAre
}

func (h Handler) removeOutdatedLocalArea(nad *nadv1.NetworkAttachmentDefinition) (*nadv1.NetworkAttachmentDefinition, error) {
if nad.Labels[utils.KeyLastNetworkType] != string(utils.L2VlanNetwork) ||
nad.Labels[utils.KeyLastClusterNetworkLabel] == "" && nad.Labels[utils.KeyLastVlanLabel] == "" {
//Skip removelocalArea only
//when LastNetworkType=untagged
//when LastNetworkType="" and there is no change in cluster network or vlan id
if nad.Labels[utils.KeyLastNetworkType] == string(utils.UntaggedNetwork) ||
nad.Labels[utils.KeyLastNetworkType] == "" && nad.Labels[utils.KeyLastVlanLabel] == "" {
return nil, nil
}

Expand Down

0 comments on commit b93ba87

Please sign in to comment.