Skip to content

Commit 9a9e190

Browse files
authored
fix: corrected merge issue (#676)
1 parent e9af986 commit 9a9e190

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

  • stackit/internal/services/objectstorage/credential

stackit/internal/services/objectstorage/credential/resource.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,20 @@ type credentialResource struct {
5757
}
5858

5959
// ModifyPlan implements resource.ResourceWithModifyPlan.
60-
// Use the modifier to set the effective region in the current plan.
6160
func (r *credentialResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { // nolint:gocritic // function signature required by Terraform
61+
r.modifyPlanRegion(ctx, &req, resp)
62+
if resp.Diagnostics.HasError() {
63+
return
64+
}
65+
r.modifyPlanExpiration(ctx, &req, resp)
66+
if resp.Diagnostics.HasError() {
67+
return
68+
}
69+
}
70+
71+
// ModifyPlan implements resource.ResourceWithModifyPlan.
72+
// Use the modifier to set the effective region in the current plan.
73+
func (r *credentialResource) modifyPlanRegion(ctx context.Context, req *resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) {
6274
var configModel Model
6375
// skip initial empty configuration to avoid follow-up errors
6476
if req.Config.Raw.IsNull() {
@@ -87,7 +99,7 @@ func (r *credentialResource) ModifyPlan(ctx context.Context, req resource.Modify
8799
}
88100

89101
// ModifyPlan implements resource.ResourceWithModifyPlan.
90-
func (r *credentialResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { // nolint:gocritic // function signature required by Terraform
102+
func (r *credentialResource) modifyPlanExpiration(ctx context.Context, req *resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) {
91103
p := path.Root("expiration_timestamp")
92104
var (
93105
stateDate time.Time

0 commit comments

Comments
 (0)