From 287ec6e6cc2f4b8e4af78e52015db911d48bb333 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Wed, 31 May 2017 11:01:13 +0200 Subject: [PATCH] Fix outdated target_group naming in error message The target_groups config has been renamed to static_configs, the error message for overflow attributes should reflect that. --- config/config.go | 2 +- discovery/file/file_test.go | 2 +- discovery/file/fixtures/{target_groups.json => valid.json} | 0 discovery/file/fixtures/{target_groups.yml => valid.yml} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename discovery/file/fixtures/{target_groups.json => valid.json} (100%) rename discovery/file/fixtures/{target_groups.yml => valid.yml} (100%) diff --git a/config/config.go b/config/config.go index 9466a2d7c..ee088fe99 100644 --- a/config/config.go +++ b/config/config.go @@ -728,7 +728,7 @@ func (tg *TargetGroup) UnmarshalYAML(unmarshal func(interface{}) error) error { }) } tg.Labels = g.Labels - return checkOverflow(g.XXX, "target_group") + return checkOverflow(g.XXX, "static_config") } // MarshalYAML implements the yaml.Marshaler interface. diff --git a/discovery/file/file_test.go b/discovery/file/file_test.go index 39ce91f47..fb10fa9dd 100644 --- a/discovery/file/file_test.go +++ b/discovery/file/file_test.go @@ -60,7 +60,7 @@ func testFileSD(t *testing.T, ext string) { } defer newf.Close() - f, err := os.Open("fixtures/target_groups" + ext) + f, err := os.Open("fixtures/valid" + ext) if err != nil { t.Fatal(err) } diff --git a/discovery/file/fixtures/target_groups.json b/discovery/file/fixtures/valid.json similarity index 100% rename from discovery/file/fixtures/target_groups.json rename to discovery/file/fixtures/valid.json diff --git a/discovery/file/fixtures/target_groups.yml b/discovery/file/fixtures/valid.yml similarity index 100% rename from discovery/file/fixtures/target_groups.yml rename to discovery/file/fixtures/valid.yml