forked from yusheng-guo/kube-metrics-adapter
Remove unused Configuration key from MetricConfig
This fixes an issue of setting up a ZMON collector where the incorrect key `Configuration` was used, which was not initialized in the metrics config parser. The `Config` key is the right one to use. Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
This commit is contained in:
@@ -28,7 +28,7 @@ func TestZMONCollectorNewCollector(t *testing.T) {
|
||||
MetricTypeName: MetricTypeName{
|
||||
Metric: newMetricIdentifier(ZMONCheckMetric),
|
||||
},
|
||||
Configuration: map[string]string{
|
||||
Config: map[string]string{
|
||||
zmonCheckIDLabelKey: "1234",
|
||||
zmonAggregatorsLabelKey: "max",
|
||||
zmonTagPrefixLabelKey + "alias": "cluster_alias",
|
||||
@@ -70,7 +70,7 @@ func TestZMONCollectorNewCollector(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
|
||||
// should fail if the check id is not specified.
|
||||
delete(config.Configuration, zmonCheckIDLabelKey)
|
||||
delete(config.Config, zmonCheckIDLabelKey)
|
||||
config.Metric.Name = ZMONCheckMetric
|
||||
_, err = collectPlugin.NewCollector(nil, config, 1*time.Second)
|
||||
require.Error(t, err)
|
||||
@@ -88,7 +88,7 @@ func TestZMONCollectorGetMetrics(tt *testing.T) {
|
||||
Metric: newMetricIdentifier(ZMONCheckMetric),
|
||||
Type: "foo",
|
||||
},
|
||||
Configuration: map[string]string{
|
||||
Config: map[string]string{
|
||||
zmonCheckIDLabelKey: "1234",
|
||||
zmonAggregatorsLabelKey: "max",
|
||||
zmonTagPrefixLabelKey + "alias": "cluster_alias",
|
||||
|
Reference in New Issue
Block a user