mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #23940 from freehan/netinterface
Automatic merge from submit-queue switch to use ContainerID instead of DockerID in network plugin interface fix: #15663
This commit is contained in:
commit
8990897ce6
@ -325,7 +325,7 @@ func (dm *DockerManager) determineContainerIP(podNamespace, podName string, cont
|
|||||||
}
|
}
|
||||||
|
|
||||||
if dm.networkPlugin.Name() != network.DefaultPluginName {
|
if dm.networkPlugin.Name() != network.DefaultPluginName {
|
||||||
netStatus, err := dm.networkPlugin.Status(podNamespace, podName, kubecontainer.DockerID(container.ID))
|
netStatus, err := dm.networkPlugin.Status(podNamespace, podName, kubecontainer.DockerID(container.ID).ContainerID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("NetworkPlugin %s failed on the status hook for pod '%s' - %v", dm.networkPlugin.Name(), podName, err)
|
glog.Errorf("NetworkPlugin %s failed on the status hook for pod '%s' - %v", dm.networkPlugin.Name(), podName, err)
|
||||||
} else if netStatus != nil {
|
} else if netStatus != nil {
|
||||||
@ -1292,7 +1292,7 @@ func (dm *DockerManager) killPodWithSyncResult(pod *api.Pod, runningPod kubecont
|
|||||||
if getDockerNetworkMode(ins) != namespaceModeHost {
|
if getDockerNetworkMode(ins) != namespaceModeHost {
|
||||||
teardownNetworkResult := kubecontainer.NewSyncResult(kubecontainer.TeardownNetwork, kubecontainer.BuildPodFullName(runningPod.Name, runningPod.Namespace))
|
teardownNetworkResult := kubecontainer.NewSyncResult(kubecontainer.TeardownNetwork, kubecontainer.BuildPodFullName(runningPod.Name, runningPod.Namespace))
|
||||||
result.AddSyncResult(teardownNetworkResult)
|
result.AddSyncResult(teardownNetworkResult)
|
||||||
if err := dm.networkPlugin.TearDownPod(runningPod.Namespace, runningPod.Name, kubecontainer.DockerID(networkContainer.ID.ID)); err != nil {
|
if err := dm.networkPlugin.TearDownPod(runningPod.Namespace, runningPod.Name, networkContainer.ID); err != nil {
|
||||||
message := fmt.Sprintf("Failed to teardown network for pod %q using network plugins %q: %v", runningPod.ID, dm.networkPlugin.Name(), err)
|
message := fmt.Sprintf("Failed to teardown network for pod %q using network plugins %q: %v", runningPod.ID, dm.networkPlugin.Name(), err)
|
||||||
teardownNetworkResult.Fail(kubecontainer.ErrTeardownNetwork, message)
|
teardownNetworkResult.Fail(kubecontainer.ErrTeardownNetwork, message)
|
||||||
glog.Error(message)
|
glog.Error(message)
|
||||||
@ -1919,7 +1919,7 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, _ api.PodStatus, podStatus *kubec
|
|||||||
result.AddSyncResult(setupNetworkResult)
|
result.AddSyncResult(setupNetworkResult)
|
||||||
if !kubecontainer.IsHostNetworkPod(pod) {
|
if !kubecontainer.IsHostNetworkPod(pod) {
|
||||||
// Call the networking plugin
|
// Call the networking plugin
|
||||||
err = dm.networkPlugin.SetUpPod(pod.Namespace, pod.Name, podInfraContainerID)
|
err = dm.networkPlugin.SetUpPod(pod.Namespace, pod.Name, podInfraContainerID.ContainerID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: (random-liu) There shouldn't be "Skipping pod" in sync result message
|
// TODO: (random-liu) There shouldn't be "Skipping pod" in sync result message
|
||||||
message := fmt.Sprintf("Failed to setup network for pod %q using network plugins %q: %v; Skipping pod", format.Pod(pod), dm.networkPlugin.Name(), err)
|
message := fmt.Sprintf("Failed to setup network for pod %q using network plugins %q: %v; Skipping pod", format.Pod(pod), dm.networkPlugin.Name(), err)
|
||||||
|
@ -102,17 +102,17 @@ func (plugin *cniNetworkPlugin) Name() string {
|
|||||||
return CNIPluginName
|
return CNIPluginName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *cniNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *cniNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager)
|
runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("CNI execution called on non-docker runtime")
|
return fmt.Errorf("CNI execution called on non-docker runtime")
|
||||||
}
|
}
|
||||||
netns, err := runtime.GetNetNS(id.ContainerID())
|
netns, err := runtime.GetNetNS(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = plugin.defaultNetwork.addToNetwork(name, namespace, id.ContainerID(), netns)
|
_, err = plugin.defaultNetwork.addToNetwork(name, namespace, id, netns)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error while adding to cni network: %s", err)
|
glog.Errorf("Error while adding to cni network: %s", err)
|
||||||
return err
|
return err
|
||||||
@ -121,27 +121,27 @@ func (plugin *cniNetworkPlugin) SetUpPod(namespace string, name string, id kubec
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *cniNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *cniNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager)
|
runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("CNI execution called on non-docker runtime")
|
return fmt.Errorf("CNI execution called on non-docker runtime")
|
||||||
}
|
}
|
||||||
netns, err := runtime.GetNetNS(id.ContainerID())
|
netns, err := runtime.GetNetNS(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return plugin.defaultNetwork.deleteFromNetwork(name, namespace, id.ContainerID(), netns)
|
return plugin.defaultNetwork.deleteFromNetwork(name, namespace, id, netns)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use the addToNetwork function to obtain the IP of the Pod. That will assume idempotent ADD call to the plugin.
|
// TODO: Use the addToNetwork function to obtain the IP of the Pod. That will assume idempotent ADD call to the plugin.
|
||||||
// Also fix the runtime's call to Status function to be done only in the case that the IP is lost, no need to do periodic calls
|
// Also fix the runtime's call to Status function to be done only in the case that the IP is lost, no need to do periodic calls
|
||||||
func (plugin *cniNetworkPlugin) Status(namespace string, name string, id kubecontainer.DockerID) (*network.PodNetworkStatus, error) {
|
func (plugin *cniNetworkPlugin) Status(namespace string, name string, id kubecontainer.ContainerID) (*network.PodNetworkStatus, error) {
|
||||||
runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager)
|
runtime, ok := plugin.host.GetRuntime().(*dockertools.DockerManager)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("CNI execution called on non-docker runtime")
|
return nil, fmt.Errorf("CNI execution called on non-docker runtime")
|
||||||
}
|
}
|
||||||
ipStr, err := runtime.GetContainerIP(string(id), network.DefaultInterfaceName)
|
ipStr, err := runtime.GetContainerIP(id.ID, network.DefaultInterfaceName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ func TestCNIPlugin(t *testing.T) {
|
|||||||
t.Fatalf("Failed to select the desired plugin: %v", err)
|
t.Fatalf("Failed to select the desired plugin: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = plug.SetUpPod("podNamespace", "podName", "test_infra_container")
|
err = plug.SetUpPod("podNamespace", "podName", kubecontainer.ContainerID{"docker", "test_infra_container"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Expected nil: %v", err)
|
t.Errorf("Expected nil: %v", err)
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ func TestCNIPlugin(t *testing.T) {
|
|||||||
if string(output) != expectedOutput {
|
if string(output) != expectedOutput {
|
||||||
t.Errorf("Mismatch in expected output for setup hook. Expected '%s', got '%s'", expectedOutput, string(output))
|
t.Errorf("Mismatch in expected output for setup hook. Expected '%s', got '%s'", expectedOutput, string(output))
|
||||||
}
|
}
|
||||||
err = plug.TearDownPod("podNamespace", "podName", "test_infra_container")
|
err = plug.TearDownPod("podNamespace", "podName", kubecontainer.ContainerID{"docker", "test_infra_container"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Expected nil: %v", err)
|
t.Errorf("Expected nil: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -134,20 +134,20 @@ func (plugin *execNetworkPlugin) validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *execNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *execNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
out, err := utilexec.New().Command(plugin.getExecutable(), setUpCmd, namespace, name, string(id)).CombinedOutput()
|
out, err := utilexec.New().Command(plugin.getExecutable(), setUpCmd, namespace, name, id.ID).CombinedOutput()
|
||||||
glog.V(5).Infof("SetUpPod 'exec' network plugin output: %s, %v", string(out), err)
|
glog.V(5).Infof("SetUpPod 'exec' network plugin output: %s, %v", string(out), err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *execNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *execNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
out, err := utilexec.New().Command(plugin.getExecutable(), tearDownCmd, namespace, name, string(id)).CombinedOutput()
|
out, err := utilexec.New().Command(plugin.getExecutable(), tearDownCmd, namespace, name, id.ID).CombinedOutput()
|
||||||
glog.V(5).Infof("TearDownPod 'exec' network plugin output: %s, %v", string(out), err)
|
glog.V(5).Infof("TearDownPod 'exec' network plugin output: %s, %v", string(out), err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *execNetworkPlugin) Status(namespace string, name string, id kubecontainer.DockerID) (*network.PodNetworkStatus, error) {
|
func (plugin *execNetworkPlugin) Status(namespace string, name string, id kubecontainer.ContainerID) (*network.PodNetworkStatus, error) {
|
||||||
out, err := utilexec.New().Command(plugin.getExecutable(), statusCmd, namespace, name, string(id)).CombinedOutput()
|
out, err := utilexec.New().Command(plugin.getExecutable(), statusCmd, namespace, name, id.ID).CombinedOutput()
|
||||||
glog.V(5).Infof("Status 'exec' network plugin output: %s, %v", string(out), err)
|
glog.V(5).Infof("Status 'exec' network plugin output: %s, %v", string(out), err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -29,6 +29,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
|
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/network"
|
"k8s.io/kubernetes/pkg/kubelet/network"
|
||||||
nettest "k8s.io/kubernetes/pkg/kubelet/network/testing"
|
nettest "k8s.io/kubernetes/pkg/kubelet/network/testing"
|
||||||
"k8s.io/kubernetes/pkg/util/sets"
|
"k8s.io/kubernetes/pkg/util/sets"
|
||||||
@ -224,7 +225,7 @@ func TestPluginSetupHook(t *testing.T) {
|
|||||||
|
|
||||||
plug, err := network.InitNetworkPlugin(ProbeNetworkPlugins(testPluginPath), pluginName, nettest.NewFakeHost(nil))
|
plug, err := network.InitNetworkPlugin(ProbeNetworkPlugins(testPluginPath), pluginName, nettest.NewFakeHost(nil))
|
||||||
|
|
||||||
err = plug.SetUpPod("podNamespace", "podName", "dockerid2345")
|
err = plug.SetUpPod("podNamespace", "podName", kubecontainer.ContainerID{"docker", "dockerid2345"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Expected nil: %v", err)
|
t.Errorf("Expected nil: %v", err)
|
||||||
}
|
}
|
||||||
@ -252,7 +253,7 @@ func TestPluginTearDownHook(t *testing.T) {
|
|||||||
|
|
||||||
plug, err := network.InitNetworkPlugin(ProbeNetworkPlugins(testPluginPath), pluginName, nettest.NewFakeHost(nil))
|
plug, err := network.InitNetworkPlugin(ProbeNetworkPlugins(testPluginPath), pluginName, nettest.NewFakeHost(nil))
|
||||||
|
|
||||||
err = plug.TearDownPod("podNamespace", "podName", "dockerid2345")
|
err = plug.TearDownPod("podNamespace", "podName", kubecontainer.ContainerID{"docker", "dockerid2345"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Expected nil")
|
t.Errorf("Expected nil")
|
||||||
}
|
}
|
||||||
@ -280,7 +281,7 @@ func TestPluginStatusHook(t *testing.T) {
|
|||||||
|
|
||||||
plug, err := network.InitNetworkPlugin(ProbeNetworkPlugins(testPluginPath), pluginName, nettest.NewFakeHost(nil))
|
plug, err := network.InitNetworkPlugin(ProbeNetworkPlugins(testPluginPath), pluginName, nettest.NewFakeHost(nil))
|
||||||
|
|
||||||
ip, err := plug.Status("namespace", "name", "dockerid2345")
|
ip, err := plug.Status("namespace", "name", kubecontainer.ContainerID{"docker", "dockerid2345"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Expected nil got %v", err)
|
t.Errorf("Expected nil got %v", err)
|
||||||
}
|
}
|
||||||
@ -319,7 +320,7 @@ func TestPluginStatusHookIPv6(t *testing.T) {
|
|||||||
t.Errorf("InitNetworkPlugin() failed: %v", err)
|
t.Errorf("InitNetworkPlugin() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ip, err := plug.Status("namespace", "name", "dockerid2345")
|
ip, err := plug.Status("namespace", "name", kubecontainer.ContainerID{"docker", "dockerid2345"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Status() failed: %v", err)
|
t.Errorf("Status() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -48,13 +48,13 @@ type kubenetNetworkPlugin struct {
|
|||||||
cniConfig *libcni.CNIConfig
|
cniConfig *libcni.CNIConfig
|
||||||
shaper bandwidth.BandwidthShaper
|
shaper bandwidth.BandwidthShaper
|
||||||
|
|
||||||
podCIDRs map[kubecontainer.DockerID]string
|
podCIDRs map[kubecontainer.ContainerID]string
|
||||||
MTU int
|
MTU int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPlugin() network.NetworkPlugin {
|
func NewPlugin() network.NetworkPlugin {
|
||||||
return &kubenetNetworkPlugin{
|
return &kubenetNetworkPlugin{
|
||||||
podCIDRs: make(map[kubecontainer.DockerID]string),
|
podCIDRs: make(map[kubecontainer.ContainerID]string),
|
||||||
MTU: 1460,
|
MTU: 1460,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ func (plugin *kubenetNetworkPlugin) Name() string {
|
|||||||
return KubenetPluginName
|
return KubenetPluginName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
// Can't set up pods if we don't have a PodCIDR yet
|
// Can't set up pods if we don't have a PodCIDR yet
|
||||||
if plugin.netConfig == nil {
|
if plugin.netConfig == nil {
|
||||||
return fmt.Errorf("Kubenet needs a PodCIDR to set up pods")
|
return fmt.Errorf("Kubenet needs a PodCIDR to set up pods")
|
||||||
@ -190,12 +190,12 @@ func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id k
|
|||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("Kubenet execution called on non-docker runtime")
|
return fmt.Errorf("Kubenet execution called on non-docker runtime")
|
||||||
}
|
}
|
||||||
netnsPath, err := runtime.GetNetNS(id.ContainerID())
|
netnsPath, err := runtime.GetNetNS(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
rt := buildCNIRuntimeConf(name, namespace, id.ContainerID(), netnsPath)
|
rt := buildCNIRuntimeConf(name, namespace, id, netnsPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error building CNI config: %v", err)
|
return fmt.Errorf("Error building CNI config: %v", err)
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id k
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
if plugin.netConfig == nil {
|
if plugin.netConfig == nil {
|
||||||
return fmt.Errorf("Kubenet needs a PodCIDR to tear down pods")
|
return fmt.Errorf("Kubenet needs a PodCIDR to tear down pods")
|
||||||
}
|
}
|
||||||
@ -234,12 +234,12 @@ func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, i
|
|||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("Kubenet execution called on non-docker runtime")
|
return fmt.Errorf("Kubenet execution called on non-docker runtime")
|
||||||
}
|
}
|
||||||
netnsPath, err := runtime.GetNetNS(id.ContainerID())
|
netnsPath, err := runtime.GetNetNS(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
rt := buildCNIRuntimeConf(name, namespace, id.ContainerID(), netnsPath)
|
rt := buildCNIRuntimeConf(name, namespace, id, netnsPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error building CNI config: %v", err)
|
return fmt.Errorf("Error building CNI config: %v", err)
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, i
|
|||||||
|
|
||||||
// TODO: Use the addToNetwork function to obtain the IP of the Pod. That will assume idempotent ADD call to the plugin.
|
// TODO: Use the addToNetwork function to obtain the IP of the Pod. That will assume idempotent ADD call to the plugin.
|
||||||
// Also fix the runtime's call to Status function to be done only in the case that the IP is lost, no need to do periodic calls
|
// Also fix the runtime's call to Status function to be done only in the case that the IP is lost, no need to do periodic calls
|
||||||
func (plugin *kubenetNetworkPlugin) Status(namespace string, name string, id kubecontainer.DockerID) (*network.PodNetworkStatus, error) {
|
func (plugin *kubenetNetworkPlugin) Status(namespace string, name string, id kubecontainer.ContainerID) (*network.PodNetworkStatus, error) {
|
||||||
cidr, ok := plugin.podCIDRs[id]
|
cidr, ok := plugin.podCIDRs[id]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("No IP address found for pod %v", id)
|
return nil, fmt.Errorf("No IP address found for pod %v", id)
|
||||||
|
@ -41,14 +41,14 @@ func (plugin *kubenetNetworkPlugin) Name() string {
|
|||||||
return "kubenet"
|
return "kubenet"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *kubenetNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
return fmt.Errorf("Kubenet is not supported in this build")
|
return fmt.Errorf("Kubenet is not supported in this build")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *kubenetNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
return fmt.Errorf("Kubenet is not supported in this build")
|
return fmt.Errorf("Kubenet is not supported in this build")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *kubenetNetworkPlugin) Status(namespace string, name string, id kubecontainer.DockerID) (*network.PodNetworkStatus, error) {
|
func (plugin *kubenetNetworkPlugin) Status(namespace string, name string, id kubecontainer.ContainerID) (*network.PodNetworkStatus, error) {
|
||||||
return nil, fmt.Errorf("Kubenet is not supported in this build")
|
return nil, fmt.Errorf("Kubenet is not supported in this build")
|
||||||
}
|
}
|
||||||
|
@ -67,13 +67,13 @@ type NetworkPlugin interface {
|
|||||||
// SetUpPod is the method called after the infra container of
|
// SetUpPod is the method called after the infra container of
|
||||||
// the pod has been created but before the other containers of the
|
// the pod has been created but before the other containers of the
|
||||||
// pod are launched.
|
// pod are launched.
|
||||||
SetUpPod(namespace string, name string, podInfraContainerID kubecontainer.DockerID) error
|
SetUpPod(namespace string, name string, podInfraContainerID kubecontainer.ContainerID) error
|
||||||
|
|
||||||
// TearDownPod is the method called before a pod's infra container will be deleted
|
// TearDownPod is the method called before a pod's infra container will be deleted
|
||||||
TearDownPod(namespace string, name string, podInfraContainerID kubecontainer.DockerID) error
|
TearDownPod(namespace string, name string, podInfraContainerID kubecontainer.ContainerID) error
|
||||||
|
|
||||||
// Status is the method called to obtain the ipv4 or ipv6 addresses of the container
|
// Status is the method called to obtain the ipv4 or ipv6 addresses of the container
|
||||||
Status(namespace string, name string, podInfraContainerID kubecontainer.DockerID) (*PodNetworkStatus, error)
|
Status(namespace string, name string, podInfraContainerID kubecontainer.ContainerID) (*PodNetworkStatus, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodNetworkStatus stores the network status of a pod (currently just the primary IP address)
|
// PodNetworkStatus stores the network status of a pod (currently just the primary IP address)
|
||||||
@ -180,14 +180,14 @@ func (plugin *NoopNetworkPlugin) Capabilities() utilsets.Int {
|
|||||||
return utilsets.NewInt()
|
return utilsets.NewInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *NoopNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *NoopNetworkPlugin) SetUpPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *NoopNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.DockerID) error {
|
func (plugin *NoopNetworkPlugin) TearDownPod(namespace string, name string, id kubecontainer.ContainerID) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *NoopNetworkPlugin) Status(namespace string, name string, id kubecontainer.DockerID) (*PodNetworkStatus, error) {
|
func (plugin *NoopNetworkPlugin) Status(namespace string, name string, id kubecontainer.ContainerID) (*PodNetworkStatus, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user