Browse Source

chore(style): Comply with style guide, order list

Signed-off-by: sh0rez <me@shorez.de>
pull/5598/head
sh0rez 6 years ago
parent
commit
88b79bae64
No known key found for this signature in database
GPG Key ID: 87C71DF9F8181FF1
  1. 6
      discovery/kubernetes/pod.go
  2. 2
      docs/configuration/configuration.md

6
discovery/kubernetes/pod.go

@ -216,7 +216,7 @@ func (p *Pod) buildPod(pod *apiv1.Pod) *targetgroup.Group {
containers := append(pod.Spec.Containers, pod.Spec.InitContainers...)
for i, c := range containers {
is_init := i >= len(pod.Spec.Containers)
isInit := i >= len(pod.Spec.Containers)
// If no ports are defined for the container, create an anonymous
// target per container.
@ -226,7 +226,7 @@ func (p *Pod) buildPod(pod *apiv1.Pod) *targetgroup.Group {
tg.Targets = append(tg.Targets, model.LabelSet{
model.AddressLabel: lv(pod.Status.PodIP),
podContainerNameLabel: lv(c.Name),
podContainerIsInit: lv(strconv.FormatBool(is_init)),
podContainerIsInit: lv(strconv.FormatBool(isInit)),
})
continue
}
@ -241,7 +241,7 @@ func (p *Pod) buildPod(pod *apiv1.Pod) *targetgroup.Group {
podContainerPortNumberLabel: lv(ports),
podContainerPortNameLabel: lv(port.Name),
podContainerPortProtocolLabel: lv(string(port.Protocol)),
podContainerIsInit: lv(strconv.FormatBool(is_init)),
podContainerIsInit: lv(strconv.FormatBool(isInit)),
})
}
}

2
docs/configuration/configuration.md

@ -754,10 +754,10 @@ Available meta labels:
* `__meta_kubernetes_pod_annotation_<annotationname>`: Each annotation from the pod object.
* `__meta_kubernetes_pod_annotationpresent_<annotationname>`: `true` for each annotation from the pod object.
* `__meta_kubernetes_pod_container_name`: Name of the container the target address points to.
* `__meta_kubernetes_pod_container_port_is_init`: `true` if the container is an [InitContainer](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
* `__meta_kubernetes_pod_container_port_name`: Name of the container port.
* `__meta_kubernetes_pod_container_port_number`: Number of the container port.
* `__meta_kubernetes_pod_container_port_protocol`: Protocol of the container port.
* `__meta_kubernetes_pod_container_port_is_init`: Designates whether the container is an [InitContainer](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
* `__meta_kubernetes_pod_ready`: Set to `true` or `false` for the pod's ready state.
* `__meta_kubernetes_pod_phase`: Set to `Pending`, `Running`, `Succeeded`, `Failed` or `Unknown`
in the [lifecycle](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase).

Loading…
Cancel
Save