fix(alertgroups): add expression validator to detect new lines on expressions (#807)
This commit is contained in:
parent
9cd402e09f
commit
f4498e85f3
5 changed files with 111 additions and 1 deletions
|
|
@ -207,6 +207,10 @@ func (a *alertGroupResource) Schema(_ context.Context, _ resource.SchemaRequest,
|
|||
Required: true,
|
||||
Validators: []validator.String{
|
||||
stringvalidator.LengthBetween(1, 600),
|
||||
// The API currently accepts expressions with trailing newlines but does not return them,
|
||||
// leading to inconsistent Terraform results. This issue has been reported to the Obs team.
|
||||
// Until it is resolved, we proactively notify users if their input contains a trailing newline.
|
||||
validate.ValidNoTrailingNewline(),
|
||||
},
|
||||
},
|
||||
"for": schema.StringAttribute{
|
||||
|
|
|
|||
|
|
@ -207,6 +207,10 @@ func (l *logAlertGroupResource) Schema(_ context.Context, _ resource.SchemaReque
|
|||
Required: true,
|
||||
Validators: []validator.String{
|
||||
stringvalidator.LengthBetween(1, 600),
|
||||
// The API currently accepts expressions with trailing newlines but does not return them,
|
||||
// leading to inconsistent Terraform results. This issue has been reported to the Obs team.
|
||||
// Until it is resolved, we proactively notify users if their input contains a trailing newline.
|
||||
validate.ValidNoTrailingNewline(),
|
||||
},
|
||||
},
|
||||
"for": schema.StringAttribute{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue