Finalize and close the distributor report path refactor roadmap
This commit is contained in:
@@ -202,6 +202,37 @@ func (c *DistributorNotifyConfig) UnmarshalYAML(value *yaml.Node) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *DistributorBatchNotifyConfig) UnmarshalYAML(value *yaml.Node) error {
|
||||
if value.Kind != yaml.MappingNode {
|
||||
return fmt.Errorf("notify distributor batch entry must be a mapping")
|
||||
}
|
||||
for i := 0; i < len(value.Content); i += 2 {
|
||||
key := value.Content[i].Value
|
||||
node := value.Content[i+1]
|
||||
switch key {
|
||||
case "enabled":
|
||||
if err := node.Decode(&c.Enabled); err != nil {
|
||||
return err
|
||||
}
|
||||
case "pipeline_id_template":
|
||||
if err := node.Decode(&c.PipelineIDTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
case "bundle_id_template":
|
||||
if err := node.Decode(&c.BundleIDTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
case "idempotency_key_template":
|
||||
if err := node.Decode(&c.IdempotencyKeyTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("unknown notify distributor batch field %q", key)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ReportDistributorConfig) UnmarshalYAML(value *yaml.Node) error {
|
||||
if value.Kind != yaml.MappingNode {
|
||||
return fmt.Errorf("report distributor entry must be a mapping")
|
||||
|
||||
Reference in New Issue
Block a user