File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ func (c Channel) String() string {
69
69
}
70
70
71
71
var (
72
- scopeNamespacePattern = regexp .MustCompile (`^[A-z0-9_\-]*$` )
72
+ scopeNamespacePattern = regexp .MustCompile (`^[A-z0-9_\-\. ]*$` )
73
73
pathPattern = regexp .MustCompile (`^[A-z0-9_\-/=.]*$` )
74
74
)
75
75
Original file line number Diff line number Diff line change @@ -96,6 +96,21 @@ func TestParseChannel_IsValid(t *testing.T) {
96
96
id : "grafana=/test=/path/dash-and-equal" ,
97
97
isValid : false ,
98
98
},
99
+ {
100
+ name : "scope_watch_dashboards" ,
101
+ id : "watch/dashboard.grafana.app/dashboards" ,
102
+ isValid : true ,
103
+ },
104
+ {
105
+ name : "scope_watch_dashboards_with_user_id" ,
106
+ id : "watch/dashboard.grafana.app/dashboards/userid" ,
107
+ isValid : true ,
108
+ },
109
+ {
110
+ name : "scope_watch_dashboards_with_name_anduser_id" ,
111
+ id : "watch/dashboard.grafana.app/dashboards=XYZ/userid" ,
112
+ isValid : true ,
113
+ },
99
114
}
100
115
for _ , tt := range tests {
101
116
t .Run (tt .name , func (t * testing.T ) {
Original file line number Diff line number Diff line change 9
9
ScopeDatasource = "ds"
10
10
// ScopeStream is a managed data frame stream.
11
11
ScopeStream = "stream"
12
+ // ScopeWatch will watch a k8s style resource
13
+ ScopeWatch = "watch"
12
14
)
You can’t perform that action at this time.
0 commit comments