|
|
|
@ -51,6 +51,7 @@ func makeMultiPortPods() *v1.Pod {
|
|
|
|
|
Containers: []v1.Container{ |
|
|
|
|
{ |
|
|
|
|
Name: "testcontainer0", |
|
|
|
|
Image: "testcontainer0:latest", |
|
|
|
|
Ports: []v1.ContainerPort{ |
|
|
|
|
{ |
|
|
|
|
Name: "testport0", |
|
|
|
@ -66,6 +67,7 @@ func makeMultiPortPods() *v1.Pod {
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
Name: "testcontainer1", |
|
|
|
|
Image: "testcontainer1:latest", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -95,6 +97,7 @@ func makePods() *v1.Pod {
|
|
|
|
|
Containers: []v1.Container{ |
|
|
|
|
{ |
|
|
|
|
Name: "testcontainer", |
|
|
|
|
Image: "testcontainer:latest", |
|
|
|
|
Ports: []v1.ContainerPort{ |
|
|
|
|
{ |
|
|
|
|
Name: "testport", |
|
|
|
@ -131,6 +134,7 @@ func makeInitContainerPods() *v1.Pod {
|
|
|
|
|
Containers: []v1.Container{ |
|
|
|
|
{ |
|
|
|
|
Name: "testcontainer", |
|
|
|
|
Image: "testcontainer:latest", |
|
|
|
|
Ports: []v1.ContainerPort{ |
|
|
|
|
{ |
|
|
|
|
Name: "testport", |
|
|
|
@ -144,6 +148,7 @@ func makeInitContainerPods() *v1.Pod {
|
|
|
|
|
InitContainers: []v1.Container{ |
|
|
|
|
{ |
|
|
|
|
Name: "initcontainer", |
|
|
|
|
Image: "initcontainer:latest", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -169,6 +174,7 @@ func expectedPodTargetGroups(ns string) map[string]*targetgroup.Group {
|
|
|
|
|
{ |
|
|
|
|
"__address__": "1.2.3.4:9000", |
|
|
|
|
"__meta_kubernetes_pod_container_name": "testcontainer", |
|
|
|
|
"__meta_kubernetes_pod_container_image": "testcontainer:latest", |
|
|
|
|
"__meta_kubernetes_pod_container_port_name": "testport", |
|
|
|
|
"__meta_kubernetes_pod_container_port_number": "9000", |
|
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "TCP", |
|
|
|
@ -219,6 +225,7 @@ func TestPodDiscoveryBeforeRun(t *testing.T) {
|
|
|
|
|
{ |
|
|
|
|
"__address__": "1.2.3.4:9000", |
|
|
|
|
"__meta_kubernetes_pod_container_name": "testcontainer0", |
|
|
|
|
"__meta_kubernetes_pod_container_image": "testcontainer0:latest", |
|
|
|
|
"__meta_kubernetes_pod_container_port_name": "testport0", |
|
|
|
|
"__meta_kubernetes_pod_container_port_number": "9000", |
|
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "TCP", |
|
|
|
@ -227,6 +234,7 @@ func TestPodDiscoveryBeforeRun(t *testing.T) {
|
|
|
|
|
{ |
|
|
|
|
"__address__": "1.2.3.4:9001", |
|
|
|
|
"__meta_kubernetes_pod_container_name": "testcontainer0", |
|
|
|
|
"__meta_kubernetes_pod_container_image": "testcontainer0:latest", |
|
|
|
|
"__meta_kubernetes_pod_container_port_name": "testport1", |
|
|
|
|
"__meta_kubernetes_pod_container_port_number": "9001", |
|
|
|
|
"__meta_kubernetes_pod_container_port_protocol": "UDP", |
|
|
|
@ -235,6 +243,7 @@ func TestPodDiscoveryBeforeRun(t *testing.T) {
|
|
|
|
|
{ |
|
|
|
|
"__address__": "1.2.3.4", |
|
|
|
|
"__meta_kubernetes_pod_container_name": "testcontainer1", |
|
|
|
|
"__meta_kubernetes_pod_container_image": "testcontainer1:latest", |
|
|
|
|
"__meta_kubernetes_pod_container_init": "false", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
@ -269,6 +278,7 @@ func TestPodDiscoveryInitContainer(t *testing.T) {
|
|
|
|
|
expected[key].Targets = append(expected[key].Targets, model.LabelSet{ |
|
|
|
|
"__address__": "1.2.3.4", |
|
|
|
|
"__meta_kubernetes_pod_container_name": "initcontainer", |
|
|
|
|
"__meta_kubernetes_pod_container_image": "initcontainer:latest", |
|
|
|
|
"__meta_kubernetes_pod_container_init": "true", |
|
|
|
|
}) |
|
|
|
|
expected[key].Labels["__meta_kubernetes_pod_phase"] = "Pending" |
|
|
|
@ -330,6 +340,7 @@ func TestPodDiscoveryUpdate(t *testing.T) {
|
|
|
|
|
Containers: []v1.Container{ |
|
|
|
|
{ |
|
|
|
|
Name: "testcontainer", |
|
|
|
|
Image: "testcontainer:latest", |
|
|
|
|
Ports: []v1.ContainerPort{ |
|
|
|
|
{ |
|
|
|
|
Name: "testport", |
|
|
|
|