fix scraper id
parent
b4e1cd4199
commit
27b2715264
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
|
@ -217,6 +218,9 @@ func (s *ScraperService) ListTargets(ctx context.Context) ([]platform.ScraperTar
|
|||
// UpdateTarget updates a single scraper target with changeset.
|
||||
// Returns the new target state after update.
|
||||
func (s *ScraperService) UpdateTarget(ctx context.Context, update *platform.ScraperTarget) (*platform.ScraperTarget, error) {
|
||||
if !update.ID.Valid() {
|
||||
return nil, errors.New("update scraper: id is invalid")
|
||||
}
|
||||
url, err := newURL(s.Addr, targetIDPath(update.ID))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -33,8 +33,6 @@ func initScraperService(f platformtesting.TargetFields, t *testing.T) (platform.
|
|||
return &client, done
|
||||
}
|
||||
|
||||
/*
|
||||
func TestScraperService(t *testing.T) {
|
||||
platformtesting.ScraperService(initScraperService, t)
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -138,6 +138,7 @@ func AddTarget(
|
|||
},
|
||||
args: args{
|
||||
target: &platform.ScraperTarget{
|
||||
ID: MustIDBase16(targetTwoID),
|
||||
Name: "name2",
|
||||
Type: platform.PrometheusScraperType,
|
||||
OrgName: "org2",
|
||||
|
|
Loading…
Reference in New Issue