diff --git a/hack/lib/build/constants.sh b/hack/lib/build/constants.sh old mode 100644 new mode 100755 index 0b6309c1999a..66d6982e6d74 --- a/hack/lib/build/constants.sh +++ b/hack/lib/build/constants.sh @@ -19,7 +19,7 @@ readonly OS_OUTPUT_PKGDIR="${OS_OUTPUT}/pkgdir" readonly OS_GO_PACKAGE=github.com/openshift/origin readonly OS_SDN_COMPILE_TARGETS_LINUX=( - pkg/sdn/plugin/sdn-cni-plugin + pkg/sdn/sdn-cni-plugin vendor/github.com/containernetworking/cni/plugins/ipam/host-local vendor/github.com/containernetworking/cni/plugins/main/loopback ) diff --git a/pkg/cmd/server/kubernetes/node/node.go b/pkg/cmd/server/kubernetes/node/node.go index d5c7bffe7562..edcc20151555 100644 --- a/pkg/cmd/server/kubernetes/node/node.go +++ b/pkg/cmd/server/kubernetes/node/node.go @@ -301,12 +301,12 @@ func SetFakeContainerManagerInterfaceForIntegrationTest() { defaultContainerManagerInterface = cm.NewStubContainerManager() } -// RunPlugin starts the local SDN plugin, if enabled in configuration. -func (c *NodeConfig) RunPlugin() { - if c.SDNPlugin == nil { +// RunSDN starts the SDN, if the OpenShift SDN network plugin is enabled in configuration. +func (c *NodeConfig) RunSDN() { + if c.SDNNode == nil { return } - if err := c.SDNPlugin.Start(); err != nil { + if err := c.SDNNode.Start(); err != nil { glog.Fatalf("error: SDN node startup failed: %v", err) } } diff --git a/pkg/cmd/server/kubernetes/node/node_config.go b/pkg/cmd/server/kubernetes/node/node_config.go index 22e777a142cd..cf01786fb1a6 100644 --- a/pkg/cmd/server/kubernetes/node/node_config.go +++ b/pkg/cmd/server/kubernetes/node/node_config.go @@ -42,7 +42,8 @@ import ( "github.com/openshift/origin/pkg/cmd/util/variable" "github.com/openshift/origin/pkg/dns" sdnapi "github.com/openshift/origin/pkg/sdn/apis/network" - sdnplugin "github.com/openshift/origin/pkg/sdn/plugin" + sdnnode "github.com/openshift/origin/pkg/sdn/node" + sdnproxy "github.com/openshift/origin/pkg/sdn/proxy" ) // NodeConfig represents the required parameters to start the OpenShift node @@ -79,10 +80,10 @@ type NodeConfig struct { // DNSConfig controls the DNS configuration. DNSServer *dns.Server - // SDNPlugin is an optional SDN plugin - SDNPlugin *sdnplugin.OsdnNode + // SDNNode is an optional SDN plugin + SDNNode *sdnnode.OsdnNode // SDNProxy is an optional service endpoints filterer - SDNProxy *sdnplugin.OsdnProxy + SDNProxy *sdnproxy.OsdnProxy } func BuildKubernetesNodeConfig(options configapi.NodeConfig, enableProxy, enableDNS bool) (*NodeConfig, error) { @@ -234,7 +235,7 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig, enableProxy, enable internalKubeInformers := kinternalinformers.NewSharedInformerFactory(kubeClient, proxyconfig.ConfigSyncPeriod.Duration) // Initialize SDN before building kubelet config so it can modify option - sdnNodeConfig := &sdnplugin.OsdnNodeConfig{ + sdnNodeConfig := &sdnnode.OsdnNodeConfig{ PluginName: options.NetworkConfig.NetworkPluginName, Hostname: options.NodeName, SelfIP: options.NodeIP, @@ -246,12 +247,12 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig, enableProxy, enable IPTablesSyncPeriod: proxyconfig.IPTables.SyncPeriod.Duration, ProxyMode: proxyconfig.Mode, } - sdnPlugin, err := sdnplugin.NewNodePlugin(sdnNodeConfig) + sdnNode, err := sdnnode.New(sdnNodeConfig) if err != nil { return nil, fmt.Errorf("SDN initialization failed: %v", err) } - if sdnPlugin != nil { - // SDN plugin pod setup/teardown is implemented as a CNI plugin + if sdnNode != nil { + // SDN pod setup/teardown is implemented as a CNI plugin server.NetworkPluginName = kubeletcni.CNIPluginName server.NetworkPluginDir = kubeletcni.DefaultNetDir server.CNIConfDir = kubeletcni.DefaultNetDir @@ -303,7 +304,7 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig, enableProxy, enable KeyFile: options.ServingInfo.ServerCert.KeyFile, } - sdnProxy, err := sdnplugin.NewProxyPlugin(options.NetworkConfig.NetworkPluginName, originClient, kubeClient) + sdnProxy, err := sdnproxy.New(options.NetworkConfig.NetworkPluginName, originClient, kubeClient) if err != nil { return nil, fmt.Errorf("SDN proxy initialization failed: %v", err) } @@ -326,8 +327,8 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig, enableProxy, enable ProxyConfig: proxyconfig, EnableUnidling: options.EnableUnidling, - SDNPlugin: sdnPlugin, - SDNProxy: sdnProxy, + SDNNode: sdnNode, + SDNProxy: sdnProxy, } if enableDNS { diff --git a/pkg/cmd/server/origin/controller/network.go b/pkg/cmd/server/origin/controller/network.go index 3be24b0616fe..008097ad989e 100644 --- a/pkg/cmd/server/origin/controller/network.go +++ b/pkg/cmd/server/origin/controller/network.go @@ -10,7 +10,7 @@ import ( osclient "github.com/openshift/origin/pkg/client" configapi "github.com/openshift/origin/pkg/cmd/server/api" "github.com/openshift/origin/pkg/cmd/server/bootstrappolicy" - sdnplugin "github.com/openshift/origin/pkg/sdn/plugin" + "github.com/openshift/origin/pkg/sdn/master" "github.com/openshift/origin/pkg/service/controller/ingressip" ) @@ -32,14 +32,14 @@ func (c *SDNControllerConfig) RunController(ctx ControllerContext) (bool, error) if err != nil { return false, err } - err = sdnplugin.StartMaster( + err = master.Start( c.NetworkConfig, osClient, kClient, ctx.InternalKubeInformers, ) if err != nil { - return false, fmt.Errorf("failed to start SDN plugin controller: %v", err) + return false, fmt.Errorf("failed to start SDN master controller: %v", err) } return true, nil } diff --git a/pkg/cmd/server/start/start_node.go b/pkg/cmd/server/start/start_node.go index 3ebcb6baa588..fd28902f969f 100644 --- a/pkg/cmd/server/start/start_node.go +++ b/pkg/cmd/server/start/start_node.go @@ -365,7 +365,7 @@ func StartNode(nodeConfig configapi.NodeConfig, components *utilflags.ComponentF config.RunKubelet() } if components.Enabled(ComponentPlugins) { - config.RunPlugin() + config.RunSDN() } if components.Enabled(ComponentProxy) { config.RunProxy() diff --git a/pkg/diagnostics/networkpod/util/log.go b/pkg/diagnostics/networkpod/util/log.go index 7761faebb8d8..7c7417cc8174 100644 --- a/pkg/diagnostics/networkpod/util/log.go +++ b/pkg/diagnostics/networkpod/util/log.go @@ -12,7 +12,7 @@ import ( kcontainer "k8s.io/kubernetes/pkg/kubelet/container" "github.com/openshift/origin/pkg/diagnostics/types" - sdnplugin "github.com/openshift/origin/pkg/sdn/plugin" + sdnnode "github.com/openshift/origin/pkg/sdn/node" ) type LogInterface struct { @@ -26,8 +26,8 @@ func (l *LogInterface) LogNode(kubeClient kclientset.Interface) { l.Run("brctl show", "bridges") l.Run("docker ps -a", "docker-ps") - l.Run(fmt.Sprintf("ovs-ofctl -O OpenFlow13 dump-flows %s", sdnplugin.Br0), "flows") - l.Run(fmt.Sprintf("ovs-ofctl -O OpenFlow13 show %s", sdnplugin.Br0), "ovs-show") + l.Run(fmt.Sprintf("ovs-ofctl -O OpenFlow13 dump-flows %s", sdnnode.Br0), "flows") + l.Run(fmt.Sprintf("ovs-ofctl -O OpenFlow13 show %s", sdnnode.Br0), "ovs-show") l.Run("tc qdisc show", "tc-qdisc") l.Run("tc class show", "tc-class") l.Run("tc filter show", "tc-filter") diff --git a/pkg/sdn/master/doc.go b/pkg/sdn/master/doc.go new file mode 100644 index 000000000000..44eb3b9fcb94 --- /dev/null +++ b/pkg/sdn/master/doc.go @@ -0,0 +1,2 @@ +// Package master contains the OpenShift SDN code that runs on the master +package master diff --git a/pkg/sdn/plugin/master.go b/pkg/sdn/master/master.go similarity index 95% rename from pkg/sdn/plugin/master.go rename to pkg/sdn/master/master.go index 088148bedd45..717461dcf5d0 100644 --- a/pkg/sdn/plugin/master.go +++ b/pkg/sdn/master/master.go @@ -1,4 +1,4 @@ -package plugin +package master import ( "fmt" @@ -12,6 +12,7 @@ import ( osapi "github.com/openshift/origin/pkg/sdn/apis/network" osapivalidation "github.com/openshift/origin/pkg/sdn/apis/network/validation" "github.com/openshift/origin/pkg/sdn/common" + "github.com/openshift/origin/pkg/sdn/node" "github.com/openshift/origin/pkg/util/netutils" kapierrors "k8s.io/apimachinery/pkg/api/errors" @@ -35,7 +36,7 @@ type OsdnMaster struct { hostSubnetNodeIPs map[ktypes.UID]string } -func StartMaster(networkConfig osconfigapi.MasterNetworkConfig, osClient *osclient.Client, kClient kclientset.Interface, informers kinternalinformers.SharedInformerFactory) error { +func Start(networkConfig osconfigapi.MasterNetworkConfig, osClient *osclient.Client, kClient kclientset.Interface, informers kinternalinformers.SharedInformerFactory) error { if !osapi.IsOpenShiftNetworkPlugin(networkConfig.NetworkPluginName) { return nil } @@ -137,7 +138,7 @@ func StartMaster(networkConfig osconfigapi.MasterNetworkConfig, osClient *osclie } func (master *OsdnMaster) checkClusterNetworkAgainstLocalNetworks() error { - hostIPNets, _, err := netutils.GetHostIPNetworks([]string{Tun0}) + hostIPNets, _, err := netutils.GetHostIPNetworks([]string{node.Tun0}) if err != nil { return err } diff --git a/pkg/sdn/plugin/master_test.go b/pkg/sdn/master/master_test.go similarity index 99% rename from pkg/sdn/plugin/master_test.go rename to pkg/sdn/master/master_test.go index f2367db5d227..4f59f08686d1 100644 --- a/pkg/sdn/plugin/master_test.go +++ b/pkg/sdn/master/master_test.go @@ -1,4 +1,4 @@ -package plugin +package master import ( "testing" diff --git a/pkg/sdn/plugin/netid/allocator.go b/pkg/sdn/master/netid/allocator.go similarity index 100% rename from pkg/sdn/plugin/netid/allocator.go rename to pkg/sdn/master/netid/allocator.go diff --git a/pkg/sdn/plugin/netid/allocator_test.go b/pkg/sdn/master/netid/allocator_test.go similarity index 100% rename from pkg/sdn/plugin/netid/allocator_test.go rename to pkg/sdn/master/netid/allocator_test.go diff --git a/pkg/sdn/plugin/netid/netid.go b/pkg/sdn/master/netid/netid.go similarity index 100% rename from pkg/sdn/plugin/netid/netid.go rename to pkg/sdn/master/netid/netid.go diff --git a/pkg/sdn/plugin/netid/netid_test.go b/pkg/sdn/master/netid/netid_test.go similarity index 100% rename from pkg/sdn/plugin/netid/netid_test.go rename to pkg/sdn/master/netid/netid_test.go diff --git a/pkg/sdn/plugin/subnets_master.go b/pkg/sdn/master/subnets.go similarity index 99% rename from pkg/sdn/plugin/subnets_master.go rename to pkg/sdn/master/subnets.go index b4b86aabc085..0c2081b45707 100644 --- a/pkg/sdn/plugin/subnets_master.go +++ b/pkg/sdn/master/subnets.go @@ -1,4 +1,4 @@ -package plugin +package master import ( "fmt" diff --git a/pkg/sdn/plugin/vnids_master.go b/pkg/sdn/master/vnids.go similarity index 99% rename from pkg/sdn/plugin/vnids_master.go rename to pkg/sdn/master/vnids.go index 5977fc095446..9c611685d02e 100644 --- a/pkg/sdn/plugin/vnids_master.go +++ b/pkg/sdn/master/vnids.go @@ -1,4 +1,4 @@ -package plugin +package master import ( "fmt" @@ -16,7 +16,7 @@ import ( osclient "github.com/openshift/origin/pkg/client" osapi "github.com/openshift/origin/pkg/sdn/apis/network" "github.com/openshift/origin/pkg/sdn/common" - pnetid "github.com/openshift/origin/pkg/sdn/plugin/netid" + pnetid "github.com/openshift/origin/pkg/sdn/master/netid" ) type masterVNIDMap struct { diff --git a/pkg/sdn/plugin/vnids_master_test.go b/pkg/sdn/master/vnids_test.go similarity index 99% rename from pkg/sdn/plugin/vnids_master_test.go rename to pkg/sdn/master/vnids_test.go index ecded26dba47..73b193099e71 100644 --- a/pkg/sdn/plugin/vnids_master_test.go +++ b/pkg/sdn/master/vnids_test.go @@ -1,4 +1,4 @@ -package plugin +package master import ( "testing" diff --git a/pkg/sdn/plugin/cniserver/cniserver.go b/pkg/sdn/node/cniserver/cniserver.go similarity index 100% rename from pkg/sdn/plugin/cniserver/cniserver.go rename to pkg/sdn/node/cniserver/cniserver.go diff --git a/pkg/sdn/plugin/cniserver/cniserver_test.go b/pkg/sdn/node/cniserver/cniserver_test.go similarity index 100% rename from pkg/sdn/plugin/cniserver/cniserver_test.go rename to pkg/sdn/node/cniserver/cniserver_test.go diff --git a/pkg/sdn/node/doc.go b/pkg/sdn/node/doc.go new file mode 100644 index 000000000000..c9c66480352d --- /dev/null +++ b/pkg/sdn/node/doc.go @@ -0,0 +1,2 @@ +// Package node contains the OpenShift SDN networking code that runs on the nodes +package node diff --git a/pkg/sdn/plugin/egress_network_policy.go b/pkg/sdn/node/egress_network_policy.go similarity index 99% rename from pkg/sdn/plugin/egress_network_policy.go rename to pkg/sdn/node/egress_network_policy.go index 51587b711f1d..ec06817411f9 100644 --- a/pkg/sdn/plugin/egress_network_policy.go +++ b/pkg/sdn/node/egress_network_policy.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" diff --git a/pkg/sdn/plugin/node_iptables.go b/pkg/sdn/node/iptables.go similarity index 99% rename from pkg/sdn/plugin/node_iptables.go rename to pkg/sdn/node/iptables.go index cada92f6b3ac..269c01998cef 100644 --- a/pkg/sdn/plugin/node_iptables.go +++ b/pkg/sdn/node/iptables.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" diff --git a/pkg/sdn/plugin/multitenant.go b/pkg/sdn/node/multitenant.go similarity index 99% rename from pkg/sdn/plugin/multitenant.go rename to pkg/sdn/node/multitenant.go index 2a9b13d90847..1b162d9fac97 100644 --- a/pkg/sdn/plugin/multitenant.go +++ b/pkg/sdn/node/multitenant.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "sync" diff --git a/pkg/sdn/plugin/networkpolicy.go b/pkg/sdn/node/networkpolicy.go similarity index 99% rename from pkg/sdn/plugin/networkpolicy.go rename to pkg/sdn/node/networkpolicy.go index 6ec3e62004d0..1ba6f0bf3e27 100644 --- a/pkg/sdn/plugin/networkpolicy.go +++ b/pkg/sdn/node/networkpolicy.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" diff --git a/pkg/sdn/plugin/node.go b/pkg/sdn/node/node.go similarity index 99% rename from pkg/sdn/plugin/node.go rename to pkg/sdn/node/node.go index 8fe54d8ca79c..47e017b8d50a 100644 --- a/pkg/sdn/plugin/node.go +++ b/pkg/sdn/node/node.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" @@ -13,7 +13,7 @@ import ( log "github.com/golang/glog" - "github.com/openshift/origin/pkg/sdn/plugin/cniserver" + "github.com/openshift/origin/pkg/sdn/node/cniserver" osclient "github.com/openshift/origin/pkg/client" osapi "github.com/openshift/origin/pkg/sdn/apis/network" @@ -111,7 +111,7 @@ type OsdnNode struct { } // Called by higher layers to create the plugin SDN node instance -func NewNodePlugin(c *OsdnNodeConfig) (*OsdnNode, error) { +func New(c *OsdnNodeConfig) (*OsdnNode, error) { var policy osdnPolicy var pluginId int var minOvsVersion string diff --git a/pkg/sdn/plugin/ovscontroller.go b/pkg/sdn/node/ovscontroller.go similarity index 99% rename from pkg/sdn/plugin/ovscontroller.go rename to pkg/sdn/node/ovscontroller.go index eea6bdbfaf8c..085d5ef83d03 100644 --- a/pkg/sdn/plugin/ovscontroller.go +++ b/pkg/sdn/node/ovscontroller.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "encoding/hex" diff --git a/pkg/sdn/plugin/ovscontroller_test.go b/pkg/sdn/node/ovscontroller_test.go similarity index 99% rename from pkg/sdn/plugin/ovscontroller_test.go rename to pkg/sdn/node/ovscontroller_test.go index e1f2c3d84fbb..cbd6364d9f38 100644 --- a/pkg/sdn/plugin/ovscontroller_test.go +++ b/pkg/sdn/node/ovscontroller_test.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" diff --git a/pkg/sdn/plugin/pod.go b/pkg/sdn/node/pod.go similarity index 99% rename from pkg/sdn/plugin/pod.go rename to pkg/sdn/node/pod.go index 786c4e080c6a..43bca7f35a41 100644 --- a/pkg/sdn/plugin/pod.go +++ b/pkg/sdn/node/pod.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "encoding/json" @@ -6,7 +6,7 @@ import ( "net" "sync" - "github.com/openshift/origin/pkg/sdn/plugin/cniserver" + "github.com/openshift/origin/pkg/sdn/node/cniserver" "github.com/openshift/origin/pkg/util/netutils" "github.com/golang/glog" diff --git a/pkg/sdn/plugin/pod_linux.go b/pkg/sdn/node/pod_linux.go similarity index 99% rename from pkg/sdn/plugin/pod_linux.go rename to pkg/sdn/node/pod_linux.go index 438ff5ebfdd8..a04912a8891c 100644 --- a/pkg/sdn/plugin/pod_linux.go +++ b/pkg/sdn/node/pod_linux.go @@ -1,6 +1,6 @@ // +build linux -package plugin +package node import ( "fmt" @@ -9,7 +9,7 @@ import ( "syscall" sdnapi "github.com/openshift/origin/pkg/sdn/apis/network" - "github.com/openshift/origin/pkg/sdn/plugin/cniserver" + "github.com/openshift/origin/pkg/sdn/node/cniserver" "github.com/openshift/origin/pkg/util/ipcmd" "github.com/golang/glog" diff --git a/pkg/sdn/plugin/pod_test.go b/pkg/sdn/node/pod_test.go similarity index 99% rename from pkg/sdn/plugin/pod_test.go rename to pkg/sdn/node/pod_test.go index 1d05a588426c..5f575b44ed14 100644 --- a/pkg/sdn/plugin/pod_test.go +++ b/pkg/sdn/node/pod_test.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "encoding/json" @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/openshift/origin/pkg/sdn/plugin/cniserver" + "github.com/openshift/origin/pkg/sdn/node/cniserver" utiltesting "k8s.io/client-go/util/testing" khostport "k8s.io/kubernetes/pkg/kubelet/network/hostport" diff --git a/pkg/sdn/plugin/pod_unsupported.go b/pkg/sdn/node/pod_unsupported.go similarity index 89% rename from pkg/sdn/plugin/pod_unsupported.go rename to pkg/sdn/node/pod_unsupported.go index b4e25dd27e4d..42ed5dbdf76b 100644 --- a/pkg/sdn/plugin/pod_unsupported.go +++ b/pkg/sdn/node/pod_unsupported.go @@ -1,13 +1,13 @@ // +build !linux -package plugin +package node import ( "fmt" cnitypes "github.com/containernetworking/cni/pkg/types" - "github.com/openshift/origin/pkg/sdn/plugin/cniserver" + "github.com/openshift/origin/pkg/sdn/node/cniserver" ) func (m *podManager) setup(req *cniserver.PodRequest) (cnitypes.Result, *runningPod, error) { diff --git a/pkg/sdn/plugin/runtime.go b/pkg/sdn/node/runtime.go similarity index 99% rename from pkg/sdn/plugin/runtime.go rename to pkg/sdn/node/runtime.go index 9ba8a5707e6f..e531584f3119 100644 --- a/pkg/sdn/plugin/runtime.go +++ b/pkg/sdn/node/runtime.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" diff --git a/pkg/sdn/plugin/sdn_controller.go b/pkg/sdn/node/sdn_controller.go similarity index 99% rename from pkg/sdn/plugin/sdn_controller.go rename to pkg/sdn/node/sdn_controller.go index 053fee569a71..0e9d481d98cb 100644 --- a/pkg/sdn/plugin/sdn_controller.go +++ b/pkg/sdn/node/sdn_controller.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" diff --git a/pkg/sdn/plugin/singletenant.go b/pkg/sdn/node/singletenant.go similarity index 98% rename from pkg/sdn/plugin/singletenant.go rename to pkg/sdn/node/singletenant.go index 5aa2b51ae23f..fb25b36703d5 100644 --- a/pkg/sdn/plugin/singletenant.go +++ b/pkg/sdn/node/singletenant.go @@ -1,4 +1,4 @@ -package plugin +package node import ( osapi "github.com/openshift/origin/pkg/sdn/apis/network" diff --git a/pkg/sdn/plugin/subnets_node.go b/pkg/sdn/node/subnets.go similarity index 99% rename from pkg/sdn/plugin/subnets_node.go rename to pkg/sdn/node/subnets.go index 67f58fe8810f..f429d4842d48 100644 --- a/pkg/sdn/plugin/subnets_node.go +++ b/pkg/sdn/node/subnets.go @@ -1,4 +1,4 @@ -package plugin +package node import ( log "github.com/golang/glog" diff --git a/pkg/sdn/plugin/vnids_node.go b/pkg/sdn/node/vnids.go similarity index 99% rename from pkg/sdn/plugin/vnids_node.go rename to pkg/sdn/node/vnids.go index 55a34268a340..2b46e2973b1f 100644 --- a/pkg/sdn/plugin/vnids_node.go +++ b/pkg/sdn/node/vnids.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "fmt" diff --git a/pkg/sdn/plugin/vnids_node_test.go b/pkg/sdn/node/vnids_test.go similarity index 99% rename from pkg/sdn/plugin/vnids_node_test.go rename to pkg/sdn/node/vnids_test.go index 0aaf90257b20..d90507dbbd0b 100644 --- a/pkg/sdn/plugin/vnids_node_test.go +++ b/pkg/sdn/node/vnids_test.go @@ -1,4 +1,4 @@ -package plugin +package node import ( "testing" diff --git a/pkg/sdn/proxy/doc.go b/pkg/sdn/proxy/doc.go new file mode 100644 index 000000000000..92cb752d608d --- /dev/null +++ b/pkg/sdn/proxy/doc.go @@ -0,0 +1,2 @@ +// Package proxy contains the OpenShift SDN code that runs as part of the service proxy +package proxy diff --git a/pkg/sdn/plugin/proxy.go b/pkg/sdn/proxy/proxy.go similarity index 98% rename from pkg/sdn/plugin/proxy.go rename to pkg/sdn/proxy/proxy.go index 50b4d791a61a..3f77a5fd0152 100644 --- a/pkg/sdn/plugin/proxy.go +++ b/pkg/sdn/proxy/proxy.go @@ -1,4 +1,4 @@ -package plugin +package proxy import ( "fmt" @@ -59,7 +59,7 @@ type OsdnProxy struct { } // Called by higher layers to create the proxy plugin instance; only used by nodes -func NewProxyPlugin(pluginName string, osClient *osclient.Client, kClient kclientset.Interface) (*OsdnProxy, error) { +func New(pluginName string, osClient *osclient.Client, kClient kclientset.Interface) (*OsdnProxy, error) { if !osapi.IsOpenShiftMultitenantNetworkPlugin(pluginName) { return nil, nil } diff --git a/pkg/sdn/plugin/sdn-cni-plugin/doc.go b/pkg/sdn/sdn-cni-plugin/doc.go similarity index 100% rename from pkg/sdn/plugin/sdn-cni-plugin/doc.go rename to pkg/sdn/sdn-cni-plugin/doc.go diff --git a/pkg/sdn/plugin/sdn-cni-plugin/openshift-sdn.go b/pkg/sdn/sdn-cni-plugin/openshift-sdn.go similarity index 98% rename from pkg/sdn/plugin/sdn-cni-plugin/openshift-sdn.go rename to pkg/sdn/sdn-cni-plugin/openshift-sdn.go index fede0f1c61d6..9e1a078850b1 100644 --- a/pkg/sdn/plugin/sdn-cni-plugin/openshift-sdn.go +++ b/pkg/sdn/sdn-cni-plugin/openshift-sdn.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/openshift/origin/pkg/sdn/plugin/cniserver" + "github.com/openshift/origin/pkg/sdn/node/cniserver" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/cni/pkg/types" diff --git a/pkg/sdn/plugin/sdn-cni-plugin/sdn_cni_plugin_test.go b/pkg/sdn/sdn-cni-plugin/sdn_cni_plugin_test.go similarity index 98% rename from pkg/sdn/plugin/sdn-cni-plugin/sdn_cni_plugin_test.go rename to pkg/sdn/sdn-cni-plugin/sdn_cni_plugin_test.go index faf9f28316b3..53cf3abe0564 100644 --- a/pkg/sdn/plugin/sdn-cni-plugin/sdn_cni_plugin_test.go +++ b/pkg/sdn/sdn-cni-plugin/sdn_cni_plugin_test.go @@ -16,7 +16,7 @@ import ( cnitypes "github.com/containernetworking/cni/pkg/types" cni020 "github.com/containernetworking/cni/pkg/types/020" - "github.com/openshift/origin/pkg/sdn/plugin/cniserver" + "github.com/openshift/origin/pkg/sdn/node/cniserver" utiltesting "k8s.io/client-go/util/testing" )