From df44261a65f293b9e3647d0b460f42dc03a259d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Boisseau?= Date: Thu, 19 Dec 2024 10:17:34 +0100 Subject: [PATCH 1/3] update --- internal/framework/service/rulesets/resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/framework/service/rulesets/resource.go b/internal/framework/service/rulesets/resource.go index 84902ef3dc..fdd34683fa 100644 --- a/internal/framework/service/rulesets/resource.go +++ b/internal/framework/service/rulesets/resource.go @@ -622,7 +622,7 @@ func toRulesetResourceModel(ctx context.Context, zoneID, accountID basetypes.Str rule.ActionParameters[0].EdgeTTL[0].StatusCodeTTL = statusCodeTTLs } - if ruleResponse.ActionParameters.ServeStale != nil { + if ruleResponse.ActionParameters.ServeStale != nil && ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating != nil { rule.ActionParameters[0].ServeStale = []*ActionParameterServeStaleModel{{ DisableStaleWhileUpdating: types.BoolValue(*ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating), }} From c27ba4a52325ed392ab057b0484e9e70f26582f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Boisseau?= Date: Fri, 20 Dec 2024 14:59:32 +0100 Subject: [PATCH 2/3] change convert --- internal/framework/service/rulesets/resource.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/framework/service/rulesets/resource.go b/internal/framework/service/rulesets/resource.go index fdd34683fa..4674dca548 100644 --- a/internal/framework/service/rulesets/resource.go +++ b/internal/framework/service/rulesets/resource.go @@ -607,6 +607,7 @@ func toRulesetResourceModel(ctx context.Context, zoneID, accountID basetypes.Str } var sctValue basetypes.Int64Value + if sct.Value != nil { sctValue = types.Int64Value(int64(cfv1.Int(sct.Value))) } else { @@ -622,9 +623,9 @@ func toRulesetResourceModel(ctx context.Context, zoneID, accountID basetypes.Str rule.ActionParameters[0].EdgeTTL[0].StatusCodeTTL = statusCodeTTLs } - if ruleResponse.ActionParameters.ServeStale != nil && ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating != nil { + if ruleResponse.ActionParameters.ServeStale != nil { rule.ActionParameters[0].ServeStale = []*ActionParameterServeStaleModel{{ - DisableStaleWhileUpdating: types.BoolValue(*ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating), + DisableStaleWhileUpdating: flatteners.Bool(ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating), }} } From 36bb8cf12cd140e6ccc94246724b026da68d214a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Boisseau?= Date: Fri, 20 Dec 2024 15:01:01 +0100 Subject: [PATCH 3/3] remove empty line --- internal/framework/service/rulesets/resource.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/framework/service/rulesets/resource.go b/internal/framework/service/rulesets/resource.go index 4674dca548..8b62efbeaa 100644 --- a/internal/framework/service/rulesets/resource.go +++ b/internal/framework/service/rulesets/resource.go @@ -607,7 +607,6 @@ func toRulesetResourceModel(ctx context.Context, zoneID, accountID basetypes.Str } var sctValue basetypes.Int64Value - if sct.Value != nil { sctValue = types.Int64Value(int64(cfv1.Int(sct.Value))) } else {