Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YAML unmarshalers for Alertmanager configuration structs #186

Merged
merged 1 commit into from
May 14, 2024

Conversation

santihernandezc
Copy link
Contributor

This PR adds UnmarshalYAML() methods for the Config and PostableApiAlertingConfig structs. It also adds UnmarshalJSON() to PostableApiReceiver. Json unmarshallers for these structs make use of their respective yaml counterparts, the goal is to get to the same data either from yaml or json.

Being able to parse YAML configuration into PostableApiAlertingConfig will enable us to use this struct for existing configurations in remote Alertmanagers. Related PR: grafana/mimir#8066

This PR also uses the default global configuration for the Alertmanager if the current global config is nil. This fixes panics when using upstream's codebase (see this pointer dereference).

@santihernandezc santihernandezc changed the title Add YAML unmarshalers for Alertmanager configuration struct Add YAML unmarshalers for Alertmanager configuration structs May 13, 2024
@santihernandezc santihernandezc merged commit b986cf0 into main May 14, 2024
3 checks passed
@santihernandezc santihernandezc deleted the santihernandezc/marshal_yaml_postable_config branch May 14, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants