Alerting: Fix matching labels with spaces in their values (#68909)

Fix matching labels with spaces in their values
This commit is contained in:
Virginia Cepeda 2023-05-31 17:10:00 -03:00 committed by GitHub
parent 0c85327bed
commit fb7993d021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -85,6 +85,17 @@ describe('Alertmanager utils', () => {
]);
});
it('should parse with spaces in the value', () => {
expect(parseMatchers('foo=bar bazz')).toEqual<Matcher[]>([
{
name: 'foo',
value: 'bar bazz',
isRegex: false,
isEqual: true,
},
]);
});
it('should return nothing for invalid operator', () => {
expect(parseMatchers('foo=!bar')).toEqual([]);
});