lib/promscrape/discovery: missing changes after b4ad3a3b4c

This commit is contained in:
Aliaksandr Valialkin 2023-01-11 23:02:45 -08:00
parent 20af29294e
commit ec23ab6bc2
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1
3 changed files with 3 additions and 6 deletions

View File

@ -48,10 +48,9 @@ func getNodesLabels(cfg *apiConfig) ([]*promutils.Labels, error) {
func getNodes(cfg *apiConfig) ([]node, error) { func getNodes(cfg *apiConfig) ([]node, error) {
filtersQueryArg := "" filtersQueryArg := ""
if cfg.role == roleNodes { if cfg.role == "nodes" {
filtersQueryArg = cfg.filtersQueryArg filtersQueryArg = cfg.filtersQueryArg
} }
resp, err := cfg.getAPIResponse("/nodes", filtersQueryArg) resp, err := cfg.getAPIResponse("/nodes", filtersQueryArg)
if err != nil { if err != nil {
return nil, fmt.Errorf("cannot query dockerswarm api for nodes: %w", err) return nil, fmt.Errorf("cannot query dockerswarm api for nodes: %w", err)

View File

@ -60,10 +60,9 @@ func getServicesLabels(cfg *apiConfig) ([]*promutils.Labels, error) {
func getServices(cfg *apiConfig) ([]service, error) { func getServices(cfg *apiConfig) ([]service, error) {
filtersQueryArg := "" filtersQueryArg := ""
if cfg.role == roleServices { if cfg.role == "services" {
filtersQueryArg = cfg.filtersQueryArg filtersQueryArg = cfg.filtersQueryArg
} }
data, err := cfg.getAPIResponse("/services", filtersQueryArg) data, err := cfg.getAPIResponse("/services", filtersQueryArg)
if err != nil { if err != nil {
return nil, fmt.Errorf("cannot query dockerswarm api for services: %w", err) return nil, fmt.Errorf("cannot query dockerswarm api for services: %w", err)

View File

@ -63,10 +63,9 @@ func getTasksLabels(cfg *apiConfig) ([]*promutils.Labels, error) {
func getTasks(cfg *apiConfig) ([]task, error) { func getTasks(cfg *apiConfig) ([]task, error) {
filtersQueryArg := "" filtersQueryArg := ""
if cfg.role == roleTasks { if cfg.role == "tasks" {
filtersQueryArg = cfg.filtersQueryArg filtersQueryArg = cfg.filtersQueryArg
} }
resp, err := cfg.getAPIResponse("/tasks", filtersQueryArg) resp, err := cfg.getAPIResponse("/tasks", filtersQueryArg)
if err != nil { if err != nil {
return nil, fmt.Errorf("cannot query dockerswarm api for tasks: %w", err) return nil, fmt.Errorf("cannot query dockerswarm api for tasks: %w", err)