Skip to content

Commit 2828bc9

Browse files
authored
Merge pull request #429 from SumoLogic/tarun_monitor_name_descr_regex_fix
SUMO-200871 fixing the regex for not allowing leading and trailing whitespaces in monitor name and desc
2 parents 40b4b9d + 3c33c8c commit 2828bc9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.18.2 (September 1, 2022)
2+
3+
BUG FIXES:
4+
* Fix bug for validation for monitor name and description regex (GH-428)
5+
16
## 2.18.1 (August 31, 2022)
27

38
BUG FIXES:

sumologic/resource_sumologic_monitors_library_monitor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func resourceSumologicMonitorsLibraryMonitor() *schema.Resource {
275275
"description": {
276276
Type: schema.TypeString,
277277
Optional: true,
278-
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[^\ ].*[^\ ]$`), "description must not contain leading or trailing spaces"),
278+
ValidateFunc: validation.StringMatch(regexp.MustCompile(`(?s)^[^\ ].*[^\ ]$`), "description must not contain leading or trailing spaces"),
279279
},
280280

281281
"created_at": {
@@ -332,7 +332,7 @@ func resourceSumologicMonitorsLibraryMonitor() *schema.Resource {
332332
"name": {
333333
Type: schema.TypeString,
334334
Required: true,
335-
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[^\ ].*[^\ ]$`), "name must not contain leading or trailing spaces"),
335+
ValidateFunc: validation.StringMatch(regexp.MustCompile(`(?s)^[^\ ].*[^\ ]$`), "name must not contain leading or trailing spaces"),
336336
},
337337

338338
"post_request_map": {

0 commit comments

Comments
 (0)