File tree 2 files changed +12
-21
lines changed
2 files changed +12
-21
lines changed Original file line number Diff line number Diff line change @@ -284,16 +284,11 @@ func agentResource() *schema.Resource {
284
284
Required : true ,
285
285
},
286
286
"threshold" : {
287
- Type : schema .TypeInt ,
288
- Description : "The memory usage threshold in percentage at which to trigger an alert. Value should be between 0 and 100." ,
289
- ForceNew : true ,
290
- Required : true ,
291
- ValidateDiagFunc : func (i interface {}, s cty.Path ) diag.Diagnostics {
292
- if i .(int ) < 0 || i .(int ) > 100 {
293
- return diag .Errorf ("volume threshold must be between 0 and 100" )
294
- }
295
- return nil
296
- },
287
+ Type : schema .TypeInt ,
288
+ Description : "The memory usage threshold in percentage at which to trigger an alert. Value should be between 0 and 100." ,
289
+ ForceNew : true ,
290
+ Required : true ,
291
+ ValidateFunc : validation .IntBetween (0 , 100 ),
297
292
},
298
293
},
299
294
},
@@ -329,16 +324,11 @@ func agentResource() *schema.Resource {
329
324
Required : true ,
330
325
},
331
326
"threshold" : {
332
- Type : schema .TypeInt ,
333
- Description : "The volume usage threshold in percentage at which to trigger an alert. Value should be between 0 and 100." ,
334
- ForceNew : true ,
335
- Required : true ,
336
- ValidateDiagFunc : func (i interface {}, s cty.Path ) diag.Diagnostics {
337
- if i .(int ) < 0 || i .(int ) > 100 {
338
- return diag .Errorf ("volume threshold must be between 0 and 100" )
339
- }
340
- return nil
341
- },
327
+ Type : schema .TypeInt ,
328
+ Description : "The volume usage threshold in percentage at which to trigger an alert. Value should be between 0 and 100." ,
329
+ ForceNew : true ,
330
+ Required : true ,
331
+ ValidateFunc : validation .IntBetween (0 , 100 ),
342
332
},
343
333
},
344
334
},
Original file line number Diff line number Diff line change @@ -346,7 +346,8 @@ func TestAgent_ResourcesMonitoring(t *testing.T) {
346
346
}
347
347
}
348
348
}` ,
349
- ExpectError : regexp .MustCompile ("threshold must be between 0 and 100" ),
349
+ Check : nil ,
350
+ ExpectError : regexp .MustCompile ("Error running pre-apply refresh" ),
350
351
}},
351
352
})
352
353
})
You can’t perform that action at this time.
0 commit comments