Skip to content

Commit

Permalink
[Fleet][Agent Tampering] Remove unused created_at field from uninst…
Browse files Browse the repository at this point in the history
…all token SO mapping (#159985)

## Summary

`created_at` field was added to the mapping for the uninstall token
Saved Object, but it's not used and causes trouble.
~There is a discussion whether to remove it from the mapping or not,
before the recently added mapping itself is released with v8.9.0, so I
prepared this PR to merge in case we want to remove it.~ The discussion
ended with the decision to remove the field, so the aim is to merge this
PR.
  • Loading branch information
gergoabraham committed Jun 20, 2023
1 parent ee6f0f7 commit 66e87e6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Expand Up @@ -1898,9 +1898,6 @@
"fleet-uninstall-tokens": {
"dynamic": false,
"properties": {
"created_at": {
"type": "date"
},
"policy_id": {
"type": "keyword"
},
Expand Down
Expand Up @@ -96,7 +96,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"fleet-message-signing-keys": "93421f43fed2526b59092a4e3c65d64bc2266c0f",
"fleet-preconfiguration-deletion-record": "c52ea1e13c919afe8a5e8e3adbb7080980ecc08e",
"fleet-proxy": "6cb688f0d2dd856400c1dbc998b28704ff70363d",
"fleet-uninstall-tokens": "d25a8aedb522d2b839ab0950160777528122070f",
"fleet-uninstall-tokens": "ed8aa37e3cdd69e4360709e64944bb81cae0c025",
"graph-workspace": "5cc6bb1455b078fd848c37324672163f09b5e376",
"guided-onboarding-guide-state": "d338972ed887ac480c09a1a7fbf582d6a3827c91",
"guided-onboarding-plugin-state": "bc109e5ef46ca594fdc179eda15f3095ca0a37a4",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/fleet/server/saved_objects/index.ts
Expand Up @@ -410,7 +410,6 @@ const getSavedObjectTypes = (): { [key: string]: SavedObjectsType } => ({
mappings: {
dynamic: false,
properties: {
created_at: { type: 'date' },
policy_id: { type: 'keyword' },
token_plain: { type: 'keyword' },
},
Expand Down
Expand Up @@ -152,7 +152,7 @@ export class UninstallTokenService implements UninstallTokenServiceInterface {
latest: {
top_hits: {
size: 1,
sort: [{ [`${UNINSTALL_TOKENS_SAVED_OBJECT_TYPE}.created_at`]: { order: 'desc' } }],
sort: [{ created_at: { order: 'desc' } }],
},
},
},
Expand Down

0 comments on commit 66e87e6

Please sign in to comment.