From 2e018aebf3a5e0626960e8c656391c2462c7f73c 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 daafd71c7..1e3ea0801 100644 --- a/lib/promscrape/discovery/dockerswarm/nodes.go +++ b/lib/promscrape/discovery/dockerswarm/nodes.go @@ -48,10 +48,9 @@ func getNodesLabels(cfg *apiConfig) ([]*promutils.Labels, 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 7b09d4365..725ceb0f4 100644 --- a/lib/promscrape/discovery/dockerswarm/services.go +++ b/lib/promscrape/discovery/dockerswarm/services.go @@ -60,10 +60,9 @@ func getServicesLabels(cfg *apiConfig) ([]*promutils.Labels, 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 f0e0d9438..d9d25a924 100644 --- a/lib/promscrape/discovery/dockerswarm/tasks.go +++ b/lib/promscrape/discovery/dockerswarm/tasks.go @@ -63,10 +63,9 @@ func getTasksLabels(cfg *apiConfig) ([]*promutils.Labels, 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)