[Bug]: 'pull' and 'get' of AlertRuleGroup with year as duration fails #569
Description
Grizzly Version
v0.7.1
Expected Behavior
In Grafana, it is possible (while not documented) to specify 1y
(or 5y
or any other number) as evaluation interval (for an alert group) and pending period for
in Foundation SDK (for a rule). This is accepted by Grafana, and I guess it is also working as expected.
I expect that resources that all resources allowed to create in Grafana GUI is possible to retrieve with grr get
and grr pull
.
Actual Behavior
When retrieving such resources (AlertRuleGroup with 1y specified as pending period (for
in Foundation SDK) ) with grr get
or grr pull
it fails:
$ grr get AlertRuleGroup.de7o13hjd3abke.delete-this-group
INFO Getting AlertRuleGroup.de7o13hjd3abke.example-group
FATAL unable to parse 1y as duration
This is especially troublesome when using grr pull
, because it does not tell which AlertRuleGroup that failed, so in a large instance you just get this even with debug log mode and have to manually go through all alert groups:
$ grr pull -l DEBUG -t AlertRuleGroup test-folder
INFO Pulling resources to test-folder
Datasource skipped
DashboardFolder skipped
AlertNotificationPolicy skipped
SyntheticMonitoringCheck skipped
PrometheusRuleGroup skipped
LibraryElement skipped
Dashboard skipped
DEBUG Listing remote values for handler AlertRuleGroup
AlertRuleGroup failed: failed listing remote values: unable to parse 1y as duration
1 resource failed
DEBUG Silent error: 1 error occurred:
* unable to parse 1y as duration
Steps to Reproduce
Create and alert rule group with 1y pending period: