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

This commit is contained in:
Jean-Philippe Quéméner
2022-08-26 23:30:07 +02:00
committed by GitHub
parent 3be3b02f59
commit 49b1182f34
2 changed files with 4 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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)