Commit d301f228 authored by Pengfei Ni's avatar Pengfei Ni

CRI: remove PodSandboxStatus.Linux.Namespaces.Network

Closes: #44972
parent 29f37fde
...@@ -338,8 +338,6 @@ message PodSandboxNetworkStatus { ...@@ -338,8 +338,6 @@ message PodSandboxNetworkStatus {
// Namespace contains paths to the namespaces. // Namespace contains paths to the namespaces.
message Namespace { message Namespace {
// Path to the network namespace.
string network = 1;
// Namespace options for Linux namespaces. // Namespace options for Linux namespaces.
NamespaceOption options = 2; NamespaceOption options = 2;
} }
......
...@@ -322,7 +322,6 @@ func (ds *dockerService) PodSandboxStatus(podSandboxID string) (*runtimeapi.PodS ...@@ -322,7 +322,6 @@ func (ds *dockerService) PodSandboxStatus(podSandboxID string) (*runtimeapi.PodS
return nil, err return nil, err
} }
network := &runtimeapi.PodSandboxNetworkStatus{Ip: IP} network := &runtimeapi.PodSandboxNetworkStatus{Ip: IP}
netNS := getNetworkNamespace(r)
hostNetwork := sharesHostNetwork(r) hostNetwork := sharesHostNetwork(r)
// If the sandbox has no containerTypeLabelKey label, treat it as a legacy sandbox. // If the sandbox has no containerTypeLabelKey label, treat it as a legacy sandbox.
...@@ -351,7 +350,6 @@ func (ds *dockerService) PodSandboxStatus(podSandboxID string) (*runtimeapi.PodS ...@@ -351,7 +350,6 @@ func (ds *dockerService) PodSandboxStatus(podSandboxID string) (*runtimeapi.PodS
Network: network, Network: network,
Linux: &runtimeapi.LinuxPodSandboxStatus{ Linux: &runtimeapi.LinuxPodSandboxStatus{
Namespaces: &runtimeapi.Namespace{ Namespaces: &runtimeapi.Namespace{
Network: netNS,
Options: &runtimeapi.NamespaceOption{ Options: &runtimeapi.NamespaceOption{
HostNetwork: hostNetwork, HostNetwork: hostNetwork,
HostPid: sharesHostPid(r), HostPid: sharesHostPid(r),
......
...@@ -20,7 +20,6 @@ import ( ...@@ -20,7 +20,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"net" "net"
"os"
"testing" "testing"
"time" "time"
...@@ -100,7 +99,6 @@ func TestSandboxStatus(t *testing.T) { ...@@ -100,7 +99,6 @@ func TestSandboxStatus(t *testing.T) {
// TODO: The following variables depend on the internal // TODO: The following variables depend on the internal
// implementation of FakeDockerClient, and should be fixed. // implementation of FakeDockerClient, and should be fixed.
fakeIP := "2.3.4.5" fakeIP := "2.3.4.5"
fakeNS := fmt.Sprintf("/proc/%d/ns/net", os.Getpid())
state := runtimeapi.PodSandboxState_SANDBOX_READY state := runtimeapi.PodSandboxState_SANDBOX_READY
ct := int64(0) ct := int64(0)
...@@ -110,7 +108,7 @@ func TestSandboxStatus(t *testing.T) { ...@@ -110,7 +108,7 @@ func TestSandboxStatus(t *testing.T) {
CreatedAt: ct, CreatedAt: ct,
Metadata: config.Metadata, Metadata: config.Metadata,
Network: &runtimeapi.PodSandboxNetworkStatus{Ip: fakeIP}, Network: &runtimeapi.PodSandboxNetworkStatus{Ip: fakeIP},
Linux: &runtimeapi.LinuxPodSandboxStatus{Namespaces: &runtimeapi.Namespace{Network: fakeNS, Options: &runtimeapi.NamespaceOption{HostNetwork: hostNetwork}}}, Linux: &runtimeapi.LinuxPodSandboxStatus{Namespaces: &runtimeapi.Namespace{Options: &runtimeapi.NamespaceOption{HostNetwork: hostNetwork}}},
Labels: labels, Labels: labels,
Annotations: annotations, Annotations: annotations,
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment