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{
|
||||
|
|
|
|||
|
|
@ -997,7 +997,7 @@ func toNodepoolsPayload(ctx context.Context, m *Model, availableMachineVersions
|
|||
if v.IsNull() || v.IsUnknown() {
|
||||
continue
|
||||
}
|
||||
s, err := conversion.ToString(context.TODO(), v)
|
||||
s, err := conversion.ToString(ctx, v)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue