Skip to content

Commit 82a0348

Browse files
committed
pointers
1 parent 1629527 commit 82a0348

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/fleet/agent_policy/models.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi
121121
return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags
122122
}
123123

124-
str := model.GlobalDataTags.ValueString()
125-
err := json.Unmarshal([]byte(str), body.GlobalDataTags)
124+
str := model.GlobalDataTags.ValueStringPointer()
125+
err := json.Unmarshal([]byte(*str), &body.GlobalDataTags)
126126
if err != nil {
127127
diags.AddError(err.Error(), "")
128128
return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags
@@ -158,8 +158,8 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi
158158
return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags
159159
}
160160

161-
str := model.GlobalDataTags.ValueString()
162-
err := json.Unmarshal([]byte(str), body.GlobalDataTags)
161+
str := model.GlobalDataTags.ValueStringPointer()
162+
err := json.Unmarshal([]byte(*str), &body.GlobalDataTags)
163163
if err != nil {
164164
diags.AddError(err.Error(), "")
165165
return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags

0 commit comments

Comments
 (0)