Skip to content

Commit fc99c6d

Browse files
committed
only for min ver and higher
1 parent eecdd15 commit fc99c6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/fleet/agent_policy/models.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi
215215
}
216216
body.GlobalDataTags = &itemsList
217217
} else {
218-
itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0)
219-
body.GlobalDataTags = &itemsList
218+
if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) {
219+
itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0)
220+
body.GlobalDataTags = &itemsList
221+
}
220222
}
221223

222224
return body, nil

0 commit comments

Comments
 (0)