mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
minor fix for making map (#6076)
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
This commit is contained in:
parent
fbcf41c90b
commit
1afa476b8a
|
@ -144,7 +144,8 @@ const (
|
|||
)
|
||||
|
||||
func ingressLabels(ingress *v1beta1.Ingress) model.LabelSet {
|
||||
ls := make(model.LabelSet, len(ingress.Labels)+len(ingress.Annotations)+2)
|
||||
// Each label and annotation will create two key-value pairs in the map.
|
||||
ls := make(model.LabelSet, 2*(len(ingress.Labels)+len(ingress.Annotations))+2)
|
||||
ls[ingressNameLabel] = lv(ingress.Name)
|
||||
ls[namespaceLabel] = lv(ingress.Namespace)
|
||||
|
||||
|
|
|
@ -151,7 +151,8 @@ const (
|
|||
)
|
||||
|
||||
func nodeLabels(n *apiv1.Node) model.LabelSet {
|
||||
ls := make(model.LabelSet, len(n.Labels)+len(n.Annotations)+1)
|
||||
// Each label and annotation will create two key-value pairs in the map.
|
||||
ls := make(model.LabelSet, 2*(len(n.Labels)+len(n.Annotations))+1)
|
||||
|
||||
ls[nodeNameLabel] = lv(n.Name)
|
||||
|
||||
|
|
|
@ -149,7 +149,8 @@ const (
|
|||
)
|
||||
|
||||
func serviceLabels(svc *apiv1.Service) model.LabelSet {
|
||||
ls := make(model.LabelSet, len(svc.Labels)+len(svc.Annotations)+2)
|
||||
// Each label and annotation will create two key-value pairs in the map.
|
||||
ls := make(model.LabelSet, 2*(len(svc.Labels)+len(svc.Annotations))+2)
|
||||
|
||||
ls[serviceNameLabel] = lv(svc.Name)
|
||||
ls[namespaceLabel] = lv(svc.Namespace)
|
||||
|
|
Loading…
Reference in a new issue