Skip to content

Commit

Permalink
fix: unexpected validation error when ttl is set with variable
Browse files Browse the repository at this point in the history
fixes: #4412
  • Loading branch information
digglife committed Oct 24, 2024
1 parent 76cb5a1 commit b9e508f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/framework/service/rulesets/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func (v EdgeTTLValidator) ValidateObject(ctx context.Context, req validator.Obje
if resp.Diagnostics.HasError() {
return
}
if parameter.Default.IsUnknown() {
return
}

if parameter.Mode.ValueString() == "override_origin" {
if parameter.Default.ValueInt64() <= 0 {
Expand Down Expand Up @@ -105,6 +108,9 @@ func (v BrowserTTLValidator) ValidateObject(ctx context.Context, req validator.O
if resp.Diagnostics.HasError() {
return
}
if parameter.Default.IsUnknown() {
return
}

if parameter.Mode.ValueString() == "override_origin" {
if parameter.Default.ValueInt64() <= 0 {
Expand Down

0 comments on commit b9e508f

Please sign in to comment.