Skip to content

Commit 59e57b1

Browse files
author
OpenShift Bot
authored
Merge pull request #12627 from danwinship/annotations
Merged by openshift-bot
2 parents a40ec20 + 1b59b71 commit 59e57b1

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Diff for: pkg/sdn/api/plugin.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ const (
99
MultiTenantPluginName = "redhat/openshift-ovs-multitenant"
1010
NetworkPolicyPluginName = "redhat/openshift-ovs-networkpolicy"
1111

12+
// Pod annotations
1213
IngressBandwidthAnnotation = "kubernetes.io/ingress-bandwidth"
1314
EgressBandwidthAnnotation = "kubernetes.io/egress-bandwidth"
1415
AssignMacvlanAnnotation = "pod.network.openshift.io/assign-macvlan"
16+
17+
// HostSubnet annotations. (Note: should be "hostsubnet.network.openshift.io/", but the incorrect name is now part of the API.)
1518
AssignHostSubnetAnnotation = "pod.network.openshift.io/assign-subnet"
16-
FixedVnidHost = "pod.network.openshift.io/fixed-vnid-host"
19+
FixedVNIDHostAnnotation = "pod.network.openshift.io/fixed-vnid-host"
1720
)
1821

1922
func IsOpenShiftNetworkPlugin(pluginName string) bool {

Diff for: pkg/sdn/plugin/controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ func (plugin *OsdnNode) AddHostSubnetRules(subnet *osapi.HostSubnet) {
422422
otx := plugin.ovs.NewTransaction()
423423

424424
otx.AddFlow("table=10, priority=100, tun_src=%s, actions=goto_table:30", subnet.HostIP)
425-
if vnid, ok := subnet.Annotations[osapi.FixedVnidHost]; ok {
425+
if vnid, ok := subnet.Annotations[osapi.FixedVNIDHostAnnotation]; ok {
426426
otx.AddFlow("table=50, priority=100, arp, nw_dst=%s, actions=load:%s->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1", subnet.Subnet, vnid, subnet.HostIP)
427427
otx.AddFlow("table=90, priority=100, ip, nw_dst=%s, actions=load:%s->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1", subnet.Subnet, vnid, subnet.HostIP)
428428
} else {

Diff for: pkg/sdn/plugin/subnets.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ func (master *OsdnMaster) watchSubnets() {
231231
return nil
232232
}
233233
var hsAnnotations map[string]string
234-
if vnid, ok := hs.Annotations[osapi.FixedVnidHost]; ok {
234+
if vnid, ok := hs.Annotations[osapi.FixedVNIDHostAnnotation]; ok {
235235
vnidInt, err := strconv.Atoi(vnid)
236236
if err == nil && vnidInt >= 0 && uint32(vnidInt) <= osapi.MaxVNID {
237237
hsAnnotations = make(map[string]string)
238-
hsAnnotations[osapi.FixedVnidHost] = strconv.Itoa(vnidInt)
238+
hsAnnotations[osapi.FixedVNIDHostAnnotation] = strconv.Itoa(vnidInt)
239239
} else {
240-
log.Errorf("Vnid %s is an invalid value for annotation %s. Annotation will be ignored.", vnid, osapi.FixedVnidHost)
240+
log.Errorf("Vnid %s is an invalid value for annotation %s. Annotation will be ignored.", vnid, osapi.FixedVNIDHostAnnotation)
241241
}
242242
}
243243
err = master.addNode(name, hostIP, hsAnnotations)

0 commit comments

Comments
 (0)