Commit 2371a70b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45166 from feiskyer/namespace-network

Automatic merge from submit-queue (batch tested with PRs 45013, 45166) CRI: remove PodSandboxStatus.Linux.Namespaces.Network **What this PR does / why we need it**: PodSandboxStatus.Linux.Namespaces.Network is not used, so this PR removes it from CRI. **Which issue this PR fixes** Closes: #44972 **Special notes for your reviewer**: **Release note**: ```release-note Remove PodSandboxStatus.Linux.Namespaces.Network from CRI. ``` /assign @Random-Liu @yujuhong
parents 960ff51d d301f228
...@@ -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