From 840f4e3383381e6a96e2ee7458b0c80a96df6a36 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 11 Jan 2023 23:02:45 -0800 Subject: [PATCH] lib/promscrape/discovery: missing changes after b4ad3a3b4c2170cd0dd145e55cf350015f4e6e28 --- lib/promscrape/discovery/dockerswarm/nodes.go | 3 +-- lib/promscrape/discovery/dockerswarm/services.go | 3 +-- lib/promscrape/discovery/dockerswarm/tasks.go | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/promscrape/discovery/dockerswarm/nodes.go b/lib/promscrape/discovery/dockerswarm/nodes.go index e3c85be2f..1ce99281c 100644 --- a/lib/promscrape/discovery/dockerswarm/nodes.go +++ b/lib/promscrape/discovery/dockerswarm/nodes.go @@ -47,10 +47,9 @@ func getNodesLabels(cfg *apiConfig) ([]map[string]string, error) { func getNodes(cfg *apiConfig) ([]node, error) { filtersQueryArg := "" - if cfg.role == roleNodes { + if cfg.role == "nodes" { filtersQueryArg = cfg.filtersQueryArg } - resp, err := cfg.getAPIResponse("/nodes", filtersQueryArg) if err != nil { return nil, fmt.Errorf("cannot query dockerswarm api for nodes: %w", err) diff --git a/lib/promscrape/discovery/dockerswarm/services.go b/lib/promscrape/discovery/dockerswarm/services.go index 56d2a504e..d7562202a 100644 --- a/lib/promscrape/discovery/dockerswarm/services.go +++ b/lib/promscrape/discovery/dockerswarm/services.go @@ -60,10 +60,9 @@ func getServicesLabels(cfg *apiConfig) ([]map[string]string, error) { func getServices(cfg *apiConfig) ([]service, error) { filtersQueryArg := "" - if cfg.role == roleServices { + if cfg.role == "services" { filtersQueryArg = cfg.filtersQueryArg } - data, err := cfg.getAPIResponse("/services", filtersQueryArg) if err != nil { return nil, fmt.Errorf("cannot query dockerswarm api for services: %w", err) diff --git a/lib/promscrape/discovery/dockerswarm/tasks.go b/lib/promscrape/discovery/dockerswarm/tasks.go index 01ad64cd0..ddd0d5a0b 100644 --- a/lib/promscrape/discovery/dockerswarm/tasks.go +++ b/lib/promscrape/discovery/dockerswarm/tasks.go @@ -62,10 +62,9 @@ func getTasksLabels(cfg *apiConfig) ([]map[string]string, error) { func getTasks(cfg *apiConfig) ([]task, error) { filtersQueryArg := "" - if cfg.role == roleTasks { + if cfg.role == "tasks" { filtersQueryArg = cfg.filtersQueryArg } - resp, err := cfg.getAPIResponse("/tasks", filtersQueryArg) if err != nil { return nil, fmt.Errorf("cannot query dockerswarm api for tasks: %w", err)