Skip to content

Commit

Permalink
Port openshift-sdn-ovs script to go
Browse files Browse the repository at this point in the history
  • Loading branch information
danwinship committed Feb 21, 2017
1 parent d60af9a commit 8f4af41
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 133 deletions.
3 changes: 3 additions & 0 deletions pkg/sdn/plugin/bin/openshift-sdn-ovs
@@ -1,6 +1,9 @@
#!/bin/bash
set -ex

# NOTE: This is no longer used; it is now installed solely to avoid breakage during
# upgrades, and will go away in 3.7.

lock_file=/var/lock/openshift-sdn.lock

action=$1
Expand Down
6 changes: 3 additions & 3 deletions pkg/sdn/plugin/controller.go
Expand Up @@ -257,7 +257,7 @@ func (plugin *OsdnNode) SetupSDN() (bool, error) {
// eg, "table=10, priority=100, tun_src=${remote_node_ip}, actions=goto_table:30"
otx.AddFlow("table=10, priority=0, actions=drop")

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

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

Expand All @@ -296,7 +296,7 @@ func (plugin *OsdnNode) SetupSDN() (bool, error) {
// 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"
otx.AddFlow("table=60, priority=0, actions=drop")

// Table 70: IP to local container: vnid/port mappings; filled in by openshift-sdn-ovs
// Table 70: IP to local container: vnid/port mappings; filled in by setupPodFlows
// 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"
otx.AddFlow("table=70, priority=0, actions=drop")

Expand Down

0 comments on commit 8f4af41

Please sign in to comment.