From 9a9e1902e0fd1d1023c02d3b4e9aa52a441b3aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Schmitz?= Date: Tue, 11 Feb 2025 14:02:12 +0100 Subject: [PATCH] fix: corrected merge issue (#676) --- .../objectstorage/credential/resource.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/stackit/internal/services/objectstorage/credential/resource.go b/stackit/internal/services/objectstorage/credential/resource.go index ddf0d08e..1608eca1 100644 --- a/stackit/internal/services/objectstorage/credential/resource.go +++ b/stackit/internal/services/objectstorage/credential/resource.go @@ -57,8 +57,20 @@ type credentialResource struct { } // ModifyPlan implements resource.ResourceWithModifyPlan. -// Use the modifier to set the effective region in the current plan. func (r *credentialResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { // nolint:gocritic // function signature required by Terraform + r.modifyPlanRegion(ctx, &req, resp) + if resp.Diagnostics.HasError() { + return + } + r.modifyPlanExpiration(ctx, &req, resp) + if resp.Diagnostics.HasError() { + return + } +} + +// ModifyPlan implements resource.ResourceWithModifyPlan. +// Use the modifier to set the effective region in the current plan. +func (r *credentialResource) modifyPlanRegion(ctx context.Context, req *resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { var configModel Model // skip initial empty configuration to avoid follow-up errors if req.Config.Raw.IsNull() { @@ -87,7 +99,7 @@ func (r *credentialResource) ModifyPlan(ctx context.Context, req resource.Modify } // ModifyPlan implements resource.ResourceWithModifyPlan. -func (r *credentialResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialResource) modifyPlanExpiration(ctx context.Context, req *resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { p := path.Root("expiration_timestamp") var ( stateDate time.Time