@@ -129,12 +129,12 @@ const (
129129 OvnNodeMigratedZoneName = "k8s.ovn.org/remote-zone-migrated"
130130 /** HACK END **/
131131
132- // ovnTransitSwitchPortAddr is the annotation to store the node Transit switch port ips.
132+ // OvnTransitSwitchPortAddr is the annotation to store the node Transit switch port ips.
133133 // It is set by cluster manager.
134- ovnTransitSwitchPortAddr = "k8s.ovn.org/node-transit-switch-port-ifaddr"
134+ OvnTransitSwitchPortAddr = "k8s.ovn.org/node-transit-switch-port-ifaddr"
135135
136- // ovnNodeID is the id (of type integer) of a node. It is set by cluster-manager.
137- ovnNodeID = "k8s.ovn.org/node-id"
136+ // OvnNodeID is the id (of type integer) of a node. It is set by cluster-manager.
137+ OvnNodeID = "k8s.ovn.org/node-id"
138138
139139 // InvalidNodeID indicates an invalid node id
140140 InvalidNodeID = - 1
@@ -646,11 +646,11 @@ func parseJoinSubnetAnnotation(nodeAnnotations map[string]string, annotationName
646646// CreateNodeTransitSwitchPortAddrAnnotation creates the node annotation for the node's Transit switch port addresses.
647647func CreateNodeTransitSwitchPortAddrAnnotation (nodeAnnotation map [string ]interface {}, nodeIPNetv4 ,
648648 nodeIPNetv6 * net.IPNet ) (map [string ]interface {}, error ) {
649- return createPrimaryIfAddrAnnotation (ovnTransitSwitchPortAddr , nodeAnnotation , nodeIPNetv4 , nodeIPNetv6 )
649+ return createPrimaryIfAddrAnnotation (OvnTransitSwitchPortAddr , nodeAnnotation , nodeIPNetv4 , nodeIPNetv6 )
650650}
651651
652652func NodeTransitSwitchPortAddrAnnotationChanged (oldNode , newNode * corev1.Node ) bool {
653- return oldNode .Annotations [ovnTransitSwitchPortAddr ] != newNode .Annotations [ovnTransitSwitchPortAddr ]
653+ return oldNode .Annotations [OvnTransitSwitchPortAddr ] != newNode .Annotations [OvnTransitSwitchPortAddr ]
654654}
655655
656656// CreateNodeMasqueradeSubnetAnnotation sets the IPv4 / IPv6 values of the node's Masquerade subnet.
@@ -870,7 +870,7 @@ func ParseNodeGatewayRouterJoinAddrs(node *corev1.Node, netName string) ([]*net.
870870// ParseNodeTransitSwitchPortAddrs returns the IPv4 and/or IPv6 addresses for the node's transit switch port
871871// stored in the 'ovnTransitSwitchPortAddr' annotation
872872func ParseNodeTransitSwitchPortAddrs (node * corev1.Node ) ([]* net.IPNet , error ) {
873- return parsePrimaryIfAddrAnnotation (node , ovnTransitSwitchPortAddr )
873+ return parsePrimaryIfAddrAnnotation (node , OvnTransitSwitchPortAddr )
874874}
875875
876876// ParseNodeMasqueradeSubnet returns the IPv4 and/or IPv6 networks for the node's gateway router port
@@ -1228,22 +1228,22 @@ func GetSecondaryHostNetworkContainingIP(node *corev1.Node, ip net.IP) (string,
12281228 return match .String (), nil
12291229}
12301230
1231- // UpdateNodeIDAnnotation updates the ovnNodeID annotation with the node id in the annotations map
1231+ // UpdateNodeIDAnnotation updates the OvnNodeID annotation with the node id in the annotations map
12321232// and returns it.
12331233func UpdateNodeIDAnnotation (annotations map [string ]interface {}, nodeID int ) map [string ]interface {} {
12341234 if annotations == nil {
12351235 annotations = make (map [string ]interface {})
12361236 }
12371237
1238- annotations [ovnNodeID ] = strconv .Itoa (nodeID )
1238+ annotations [OvnNodeID ] = strconv .Itoa (nodeID )
12391239 return annotations
12401240}
12411241
1242- // GetNodeID returns the id of the node set in the 'ovnNodeID ' node annotation.
1243- // Returns InvalidNodeID (-1) if the 'ovnNodeID ' node annotation is not set or if the value is
1242+ // GetNodeID returns the id of the node set in the 'OvnNodeID ' node annotation.
1243+ // Returns InvalidNodeID (-1) if the 'OvnNodeID ' node annotation is not set or if the value is
12441244// not an integer value.
12451245func GetNodeID (node * corev1.Node ) int {
1246- nodeID , ok := node .Annotations [ovnNodeID ]
1246+ nodeID , ok := node .Annotations [OvnNodeID ]
12471247 if ! ok {
12481248 return InvalidNodeID
12491249 }
@@ -1255,9 +1255,9 @@ func GetNodeID(node *corev1.Node) int {
12551255 return id
12561256}
12571257
1258- // NodeIDAnnotationChanged returns true if the ovnNodeID in the corev1.Nodes doesn't match
1258+ // NodeIDAnnotationChanged returns true if the OvnNodeID in the corev1.Nodes doesn't match
12591259func NodeIDAnnotationChanged (oldNode , newNode * corev1.Node ) bool {
1260- return oldNode .Annotations [ovnNodeID ] != newNode .Annotations [ovnNodeID ]
1260+ return oldNode .Annotations [OvnNodeID ] != newNode .Annotations [OvnNodeID ]
12611261}
12621262
12631263// SetNodeZone sets the node's zone in the 'ovnNodeZoneName' node annotation.
0 commit comments