Alerting: add missing yaml tag to mute time struct (#54287) (#54355)

(cherry picked from commit 49b1182f34)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-08-26 17:41:51 -04:00
committed by GitHub
co-authored by Jean-Philippe Quéméner
parent 34d32edcce
commit 867c695646
2 changed files with 4 additions and 3 deletions
@@ -69,8 +69,8 @@ type MuteTimingPayload struct {
// swagger:model
type MuteTimeInterval struct {
config.MuteTimeInterval
Provenance models.Provenance `json:"provenance,omitempty"`
config.MuteTimeInterval `json:",inline" yaml:",inline"`
Provenance models.Provenance `json:"provenance,omitempty"`
}
func (mt *MuteTimeInterval) ResourceType() string {
@@ -126,8 +126,9 @@ func TestConfigReader(t *testing.T) {
require.Len(t, file[0].Policies, 2)
})
t.Run("a mute times file with correct properties and specific org should not error", func(t *testing.T) {
_, err := configReader.readConfig(ctx, testFileCorrectProperties_mt)
file, err := configReader.readConfig(ctx, testFileCorrectProperties_mt)
require.NoError(t, err)
require.Equal(t, "test", file[0].MuteTimes[0].MuteTime.Name)
})
t.Run("a mute times file with correct properties and specific org should not error", func(t *testing.T) {
file, err := configReader.readConfig(ctx, testFileCorrectPropertiesWithOrg_mt)