|
|
@ -81,6 +81,16 @@ func makeMultiPortPods() *v1.Pod { |
|
|
|
Status: v1.ConditionTrue, |
|
|
|
Status: v1.ConditionTrue, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
ContainerStatuses: []v1.ContainerStatus{ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name: "testcontainer0", |
|
|
|
|
|
|
|
ContainerID: "docker://a1b2c3d4e5f6", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name: "testcontainer1", |
|
|
|
|
|
|
|
ContainerID: "containerd://6f5e4d3c2b1a", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -118,6 +128,12 @@ func makePods() *v1.Pod { |
|
|
|
Status: v1.ConditionTrue, |
|
|
|
Status: v1.ConditionTrue, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
ContainerStatuses: []v1.ContainerStatus{ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name: "testcontainer", |
|
|
|
|
|
|
|
ContainerID: "docker://a1b2c3d4e5f6", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -162,6 +178,18 @@ func makeInitContainerPods() *v1.Pod { |
|
|
|
Status: v1.ConditionFalse, |
|
|
|
Status: v1.ConditionFalse, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
ContainerStatuses: []v1.ContainerStatus{ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name: "testcontainer", |
|
|
|
|
|
|
|
ContainerID: "docker://a1b2c3d4e5f6", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
InitContainerStatuses: []v1.ContainerStatus{ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name: "initcontainer", |
|
|
|
|
|
|
|
ContainerID: "containerd://6f5e4d3c2b1a", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -179,6 +207,7 @@ func expectedPodTargetGroups(ns string) map[string]*targetgroup.Group { |
|
|
|
"__meta_kubernetes_pod_container_port_number": "9000", |
|
|
|
"__meta_kubernetes_pod_container_port_number": "9000", |
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "TCP", |
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "TCP", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
|
|
|
|
"__meta_kubernetes_pod_container_id": "docker://a1b2c3d4e5f6", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
Labels: model.LabelSet{ |
|
|
|
Labels: model.LabelSet{ |
|
|
@ -230,6 +259,7 @@ func TestPodDiscoveryBeforeRun(t *testing.T) { |
|
|
|
"__meta_kubernetes_pod_container_port_number": "9000", |
|
|
|
"__meta_kubernetes_pod_container_port_number": "9000", |
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "TCP", |
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "TCP", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
|
|
|
|
"__meta_kubernetes_pod_container_id": "docker://a1b2c3d4e5f6", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
"__address__": "1.2.3.4:9001", |
|
|
|
"__address__": "1.2.3.4:9001", |
|
|
@ -239,12 +269,14 @@ func TestPodDiscoveryBeforeRun(t *testing.T) { |
|
|
|
"__meta_kubernetes_pod_container_port_number": "9001", |
|
|
|
"__meta_kubernetes_pod_container_port_number": "9001", |
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "UDP", |
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "UDP", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
|
|
|
|
"__meta_kubernetes_pod_container_id": "docker://a1b2c3d4e5f6", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
"__address__": "1.2.3.4", |
|
|
|
"__address__": "1.2.3.4", |
|
|
|
"__meta_kubernetes_pod_container_name": "testcontainer1", |
|
|
|
"__meta_kubernetes_pod_container_name": "testcontainer1", |
|
|
|
"__meta_kubernetes_pod_container_image": "testcontainer1:latest", |
|
|
|
"__meta_kubernetes_pod_container_image": "testcontainer1:latest", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
|
|
|
|
"__meta_kubernetes_pod_container_id": "containerd://6f5e4d3c2b1a", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
Labels: model.LabelSet{ |
|
|
|
Labels: model.LabelSet{ |
|
|
@ -280,6 +312,7 @@ func TestPodDiscoveryInitContainer(t *testing.T) { |
|
|
|
"__meta_kubernetes_pod_container_name": "initcontainer", |
|
|
|
"__meta_kubernetes_pod_container_name": "initcontainer", |
|
|
|
"__meta_kubernetes_pod_container_image": "initcontainer:latest", |
|
|
|
"__meta_kubernetes_pod_container_image": "initcontainer:latest", |
|
|
|
"__meta_kubernetes_pod_container_init": "true", |
|
|
|
"__meta_kubernetes_pod_container_init": "true", |
|
|
|
|
|
|
|
"__meta_kubernetes_pod_container_id": "containerd://6f5e4d3c2b1a", |
|
|
|
}) |
|
|
|
}) |
|
|
|
expected[key].Labels["__meta_kubernetes_pod_phase"] = "Pending" |
|
|
|
expected[key].Labels["__meta_kubernetes_pod_phase"] = "Pending" |
|
|
|
expected[key].Labels["__meta_kubernetes_pod_ready"] = "false" |
|
|
|
expected[key].Labels["__meta_kubernetes_pod_ready"] = "false" |
|
|
|