Skip to content

Commit

Permalink
Merge pull request openshift#321 from liggitt/rebase-type-changes
Browse files Browse the repository at this point in the history
Adjust types for rebase, add stub Status method
  • Loading branch information
danwinship authored Jun 16, 2016
2 parents 8aa23a3 + b00c000 commit c3721f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 4 additions & 3 deletions plugins/osdn/ovs/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package ovs

import (
"fmt"
"github.com/golang/glog"
"io/ioutil"
"net"
"os/exec"
"strings"
"time"

"github.com/golang/glog"

"github.com/openshift/openshift-sdn/pkg/ipcmd"
"github.com/openshift/openshift-sdn/pkg/netutils"
"github.com/openshift/openshift-sdn/pkg/ovs"
Expand Down Expand Up @@ -362,7 +363,7 @@ func (plugin *ovsPlugin) AddServiceRules(service *kapi.Service, netID uint) erro

otx := ovs.NewTransaction(BR)
for _, port := range service.Spec.Ports {
otx.AddFlow(generateAddServiceRule(netID, service.Spec.ClusterIP, port.Protocol, port.Port))
otx.AddFlow(generateAddServiceRule(netID, service.Spec.ClusterIP, port.Protocol, int(port.Port)))
err := otx.EndTransaction()
if err != nil {
return fmt.Errorf("Error adding OVS flows for service: %v, netid: %d, %v", service, netID, err)
Expand All @@ -380,7 +381,7 @@ func (plugin *ovsPlugin) DeleteServiceRules(service *kapi.Service) error {

otx := ovs.NewTransaction(BR)
for _, port := range service.Spec.Ports {
otx.DeleteFlows(generateDeleteServiceRule(service.Spec.ClusterIP, port.Protocol, port.Port))
otx.DeleteFlows(generateDeleteServiceRule(service.Spec.ClusterIP, port.Protocol, int(port.Port)))
err := otx.EndTransaction()
if err != nil {
return fmt.Errorf("Error deleting OVS flows for service: %v, %v", service, err)
Expand Down
14 changes: 9 additions & 5 deletions plugins/osdn/ovs/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func getScriptError(output []byte) string {
return string(output)
}

func (plugin *ovsPlugin) SetUpPod(namespace string, name string, id kubeletTypes.DockerID) error {
func (plugin *ovsPlugin) SetUpPod(namespace string, name string, id kubeletTypes.ContainerID) error {
err := plugin.WaitForPodNetworkReady()
if err != nil {
return err
Expand Down Expand Up @@ -252,7 +252,7 @@ func (plugin *ovsPlugin) SetUpPod(namespace string, name string, id kubeletTypes
return err
}

out, err := exec.Command(plugin.getExecutable(), setUpCmd, string(id), vnidstr, ingressStr, egressStr, fmt.Sprintf("%t", macvlan)).CombinedOutput()
out, err := exec.Command(plugin.getExecutable(), setUpCmd, id.ID, vnidstr, ingressStr, egressStr, fmt.Sprintf("%t", macvlan)).CombinedOutput()
glog.V(5).Infof("SetUpPod network plugin output: %s, %v", string(out), err)

if isScriptError(err) {
Expand All @@ -262,9 +262,9 @@ func (plugin *ovsPlugin) SetUpPod(namespace string, name string, id kubeletTypes
}
}

func (plugin *ovsPlugin) TearDownPod(namespace string, name string, id kubeletTypes.DockerID) error {
func (plugin *ovsPlugin) TearDownPod(namespace string, name string, id kubeletTypes.ContainerID) error {
// The script's teardown functionality doesn't need the VNID
out, err := exec.Command(plugin.getExecutable(), tearDownCmd, string(id), "-1", "-1", "-1").CombinedOutput()
out, err := exec.Command(plugin.getExecutable(), tearDownCmd, id.ID, "-1", "-1", "-1").CombinedOutput()
glog.V(5).Infof("TearDownPod network plugin output: %s, %v", string(out), err)

if isScriptError(err) {
Expand All @@ -274,7 +274,11 @@ func (plugin *ovsPlugin) TearDownPod(namespace string, name string, id kubeletTy
}
}

func (plugin *ovsPlugin) Status(namespace string, name string, id kubeletTypes.DockerID) (*knetwork.PodNetworkStatus, error) {
func (plugin *ovsPlugin) Status() error {
return nil
}

func (plugin *ovsPlugin) GetPodNetworkStatus(namespace string, name string, podInfraContainerID kubeletTypes.ContainerID) (*knetwork.PodNetworkStatus, error) {
return nil, nil
}

Expand Down

0 comments on commit c3721f6

Please sign in to comment.