Skip to content

Commit 708a26c

Browse files
committed
Copilot PR feedback
1 parent f7a8fd9 commit 708a26c

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

internal/kibana/security_list/models.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package security_list
33
import (
44
"context"
55
"encoding/json"
6+
"time"
67

78
"github.com/elastic/terraform-provider-elasticstack/generated/kbapi"
89
"github.com/elastic/terraform-provider-elasticstack/internal/utils"
@@ -116,9 +117,9 @@ func (m *SecurityListModel) fromAPI(ctx context.Context, apiList *kbapi.Security
116117
m.Immutable = types.BoolValue(apiList.Immutable)
117118
m.Version = types.Int64Value(int64(apiList.Version))
118119
m.TieBreakerID = types.StringValue(apiList.TieBreakerId)
119-
m.CreatedAt = types.StringValue(apiList.CreatedAt.String())
120+
m.CreatedAt = types.StringValue(apiList.CreatedAt.Format(time.RFC3339))
120121
m.CreatedBy = types.StringValue(apiList.CreatedBy)
121-
m.UpdatedAt = types.StringValue(apiList.UpdatedAt.String())
122+
m.UpdatedAt = types.StringValue(apiList.UpdatedAt.Format(time.RFC3339))
122123
m.UpdatedBy = types.StringValue(apiList.UpdatedBy)
123124

124125
// Set optional _version field

internal/kibana/security_list/read.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ func (r *securityListResource) Read(ctx context.Context, req resource.ReadReques
2222
}
2323

2424
spaceID := state.SpaceID.ValueString()
25-
listID := state.ListID.ValueString()
2625

2726
params := &kbapi.ReadListParams{
28-
Id: kbapi.SecurityListsAPIListId(listID),
27+
Id: kbapi.SecurityListsAPIListId(state.ID.ValueString()),
2928
}
3029

3130
readResp, diags := kibana_oapi.GetList(ctx, client, spaceID, params)

internal/kibana/security_list/schema.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ func (r *securityListResource) Schema(_ context.Context, _ resource.SchemaReques
2626
Optional: true,
2727
PlanModifiers: []planmodifier.String{
2828
stringplanmodifier.RequiresReplace(),
29-
stringplanmodifier.UseStateForUnknown(),
3029
},
3130
},
3231
"space_id": schema.StringAttribute{

internal/kibana/security_list/update.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ func (r *securityListResource) Update(ctx context.Context, req resource.UpdateRe
2121
return
2222
}
2323

24-
// Preserve version_id from state for optimistic locking
25-
if state.VersionID.ValueString() != "" {
26-
plan.VersionID = state.VersionID
27-
}
28-
2924
// Convert plan to API request
3025
updateReq, diags := plan.toUpdateRequest()
3126
resp.Diagnostics.Append(diags...)

0 commit comments

Comments
 (0)