mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 13:14:05 +00:00
Merge pull request #3878 from thockin/infra_name
Use a constant for the pod infra container name
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/leaky"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/pod"
|
||||
|
||||
@@ -193,7 +194,7 @@ func (p *PodCache) computePodStatus(pod *api.Pod) (api.PodStatus, error) {
|
||||
} else {
|
||||
newStatus.Info = result.Status.Info
|
||||
newStatus.Phase = getPhase(&pod.Spec, newStatus.Info)
|
||||
if netContainerInfo, ok := newStatus.Info["POD"]; ok {
|
||||
if netContainerInfo, ok := newStatus.Info[leaky.PodInfraContainerName]; ok {
|
||||
if netContainerInfo.PodIP != "" {
|
||||
newStatus.PodIP = netContainerInfo.PodIP
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ import (
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/leaky"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/registrytest"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
)
|
||||
@@ -370,7 +371,7 @@ func TestFillPodStatus(t *testing.T) {
|
||||
HostIP: "ip of machine",
|
||||
PodIP: expectedIP,
|
||||
Info: api.PodInfo{
|
||||
"POD": {
|
||||
leaky.PodInfraContainerName: {
|
||||
State: api.ContainerState{
|
||||
Running: &api.ContainerStateRunning{
|
||||
StartedAt: util.NewTime(expectedTime),
|
||||
@@ -405,7 +406,7 @@ func TestFillPodInfoNoData(t *testing.T) {
|
||||
Host: "machine",
|
||||
HostIP: "ip of machine",
|
||||
Info: api.PodInfo{
|
||||
"POD": {},
|
||||
leaky.PodInfraContainerName: {},
|
||||
},
|
||||
},
|
||||
nodes: []api.Node{*makeHealthyNode("machine")},
|
||||
|
Reference in New Issue
Block a user