Skip to content

Commit dd197f1

Browse files
committed
Port openshift-sdn-ovs script to go
1 parent d60af9a commit dd197f1

File tree

4 files changed

+153
-132
lines changed

4 files changed

+153
-132
lines changed

pkg/sdn/plugin/bin/openshift-sdn-ovs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -ex
33

4+
# NOTE: This is no longer used; it is now installed solely to avoid breakage during
5+
# upgrades, and will go away in 3.7.
6+
47
lock_file=/var/lock/openshift-sdn.lock
58

69
action=$1

pkg/sdn/plugin/controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func (plugin *OsdnNode) SetupSDN() (bool, error) {
257257
// eg, "table=10, priority=100, tun_src=${remote_node_ip}, actions=goto_table:30"
258258
otx.AddFlow("table=10, priority=0, actions=drop")
259259

260-
// Table 20: from OpenShift container; validate IP/MAC, assign tenant-id; filled in by openshift-sdn-ovs
260+
// Table 20: from OpenShift container; validate IP/MAC, assign tenant-id; filled in by setupPodFlows
261261
// eg, "table=20, priority=100, in_port=${ovs_port}, arp, nw_src=${ipaddr}, arp_sha=${macaddr}, actions=load:${tenant_id}->NXM_NX_REG0[], goto_table:21"
262262
// "table=20, priority=100, in_port=${ovs_port}, ip, nw_src=${ipaddr}, actions=load:${tenant_id}->NXM_NX_REG0[], goto_table:21"
263263
// (${tenant_id} is always 0 for single-tenant)
@@ -283,7 +283,7 @@ func (plugin *OsdnNode) SetupSDN() (bool, error) {
283283
otx.AddFlow("table=30, priority=0, ip, actions=goto_table:100")
284284
otx.AddFlow("table=30, priority=0, arp, actions=drop")
285285

286-
// Table 40: ARP to local container, filled in by openshift-sdn-ovs
286+
// Table 40: ARP to local container, filled in by setupPodFlows
287287
// eg, "table=40, priority=100, arp, nw_dst=${container_ip}, actions=output:${ovs_port}"
288288
otx.AddFlow("table=40, priority=0, actions=drop")
289289

@@ -296,7 +296,7 @@ func (plugin *OsdnNode) SetupSDN() (bool, error) {
296296
// eg, "table=60, priority=100, reg0=${tenant_id}, ${service_proto}, nw_dst=${service_ip}, tp_dst=${service_port}, actions=load:${tenant_id}->NXM_NX_REG1[], load:2->NXM_NX_REG2[], goto_table:80"
297297
otx.AddFlow("table=60, priority=0, actions=drop")
298298

299-
// Table 70: IP to local container: vnid/port mappings; filled in by openshift-sdn-ovs
299+
// Table 70: IP to local container: vnid/port mappings; filled in by setupPodFlows
300300
// eg, "table=70, priority=100, ip, nw_dst=${ipaddr}, actions=load:${tenant_id}->NXM_NX_REG1[], load:${ovs_port}->NXM_NX_REG2[], goto_table:80"
301301
otx.AddFlow("table=70, priority=0, actions=drop")
302302

pkg/sdn/plugin/pod.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type podManager struct {
4545
// Live pod setup/teardown stuff not used in testing code
4646
kClient *kclientset.Clientset
4747
policy osdnPolicy
48+
ovs *ovs.Interface
4849
ipamConfig []byte
4950
mtu uint32
5051
hostportHandler kubehostport.HostportHandler
@@ -57,6 +58,7 @@ func newPodManager(host knetwork.Host, localSubnetCIDR string, netInfo *NetworkI
5758
pm := newDefaultPodManager(host)
5859
pm.kClient = kClient
5960
pm.policy = policy
61+
pm.ovs = ovsif
6062
pm.mtu = mtu
6163
pm.hostportHandler = kubehostport.NewHostportHandler()
6264
pm.podHandler = pm

0 commit comments

Comments
 (0)