Skip to content

Commit

Permalink
attach node name label in ip cr (#2680)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingoooo committed Apr 20, 2023
1 parent 233dc61 commit 1d6a0fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ func (c *Controller) createOrUpdateCrdIPs(podName, ip, mac, subnetName, ns, node
Name: ipName,
Labels: map[string]string{
util.SubnetNameLabel: subnetName,
util.NodeNameLabel: nodeName,
subnetName: "",
},
},
Expand Down Expand Up @@ -667,9 +668,11 @@ func (c *Controller) createOrUpdateCrdIPs(podName, ip, mac, subnetName, ns, node
newIpCr := ipCr.DeepCopy()
if newIpCr.Labels != nil {
newIpCr.Labels[util.SubnetNameLabel] = subnetName
newIpCr.Labels[util.NodeNameLabel] = nodeName
} else {
newIpCr.Labels = map[string]string{
util.SubnetNameLabel: subnetName,
util.NodeNameLabel: nodeName,
}
}
newIpCr.Spec.PodName = key
Expand Down
1 change: 1 addition & 0 deletions pkg/util/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const (
VpcLbLabel = "ovn.kubernetes.io/vpc_lb"
VpcDnsNameLabel = "ovn.kubernetes.io/vpc-dns"
QoSLabel = "ovn.kubernetes.io/qos"
NodeNameLabel = "ovn.kubernetes.io/node-name"
NetworkPolicyLogAnnotation = "ovn.kubernetes.io/enable_log"

ProtocolTCP = "tcp"
Expand Down

0 comments on commit 1d6a0fe

Please sign in to comment.