Merge pull request #39300 from feiskyer/kubenet

Automatic merge from submit-queue (batch tested with PRs 39307, 39300)

kubenet: define KubenetPluginName for all platforms

This PR moved KubenetPluginName to a general file for all platforms.

Fixes #39299.

cc/ @yifan-gu @freehan
This commit is contained in:
Kubernetes Submit Queue 2016-12-29 13:35:03 -08:00 committed by GitHub
commit c7063fd6c0
3 changed files with 30 additions and 10 deletions

View File

@ -10,7 +10,10 @@ load(
go_library(
name = "go_default_library",
srcs = ["kubenet_linux.go"],
srcs = [
"kubenet.go",
"kubenet_linux.go",
],
tags = ["automanaged"],
deps = [
"//pkg/api/v1:go_default_library",

View File

@ -0,0 +1,21 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package kubenet
const (
KubenetPluginName = "kubenet"
)

View File

@ -20,15 +20,15 @@ package kubenet
import (
"fmt"
"io/ioutil"
"net"
"path/filepath"
"strconv"
"strings"
"sync"
"syscall"
"time"
"io/ioutil"
"github.com/containernetworking/cni/libcni"
cnitypes "github.com/containernetworking/cni/pkg/types"
"github.com/golang/glog"
@ -37,6 +37,7 @@ import (
"k8s.io/kubernetes/pkg/apis/componentconfig"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/network"
"k8s.io/kubernetes/pkg/kubelet/network/hostport"
"k8s.io/kubernetes/pkg/util/bandwidth"
utildbus "k8s.io/kubernetes/pkg/util/dbus"
utilebtables "k8s.io/kubernetes/pkg/util/ebtables"
@ -46,16 +47,11 @@ import (
utilnet "k8s.io/kubernetes/pkg/util/net"
utilsets "k8s.io/kubernetes/pkg/util/sets"
utilsysctl "k8s.io/kubernetes/pkg/util/sysctl"
"strconv"
"k8s.io/kubernetes/pkg/kubelet/network/hostport"
)
const (
KubenetPluginName = "kubenet"
BridgeName = "cbr0"
DefaultCNIDir = "/opt/cni/bin"
BridgeName = "cbr0"
DefaultCNIDir = "/opt/cni/bin"
sysctlBridgeCallIPTables = "net/bridge/bridge-nf-call-iptables"