-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] Fleet uses the wrong configuration key for agent.download.sourceURI #141470
Comments
Pinging @elastic/fleet (Team:Fleet) |
@cmacknz is there somewhere a JSON schema of the agent policy that we can maybe use in our test to validate that we always generate a correct agent policy. |
Thanks, there isn't a JSON schema for the agent policy unfortunately. Creating something like this has come up a few times, I'll look into creating one. |
…6303) ## Summary Closes #141470 The source_uri parameter in agent policy should actually be `sourceURI`. I didn't change the parameter everywhere in the code but only where is exposed to the agent policy/actions, since in other places is only used internally by fleet. <img width="748" alt="Screenshot 2022-11-24 at 15 59 54" src="https://user-images.githubusercontent.com/16084106/203814663-b9e37be2-5017-4aba-94da-9f928de490c8.png"> ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Kibana Machine <[email protected]>
…stic#146303) ## Summary Closes elastic#141470 The source_uri parameter in agent policy should actually be `sourceURI`. I didn't change the parameter everywhere in the code but only where is exposed to the agent policy/actions, since in other places is only used internally by fleet. <img width="748" alt="Screenshot 2022-11-24 at 15 59 54" src="https://user-images.githubusercontent.com/16084106/203814663-b9e37be2-5017-4aba-94da-9f928de490c8.png"> ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit fbd040f)
#146303) (#147204) # Backport This will backport the following commits from `main` to `8.6`: - [[Fleet] Rename parameter source_uri to sourceURI in agent policy (#146303)](#146303) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-30T13:46:19Z","message":"[Fleet] Rename parameter source_uri to sourceURI in agent policy (#146303)\n\n## Summary\r\nCloses https://github.com/elastic/kibana/issues/141470\r\n\r\nThe source_uri parameter in agent policy should actually be `sourceURI`.\r\nI didn't change the parameter everywhere in the code but only where is\r\nexposed to the agent policy/actions, since in other places is only used\r\ninternally by fleet.\r\n\r\n<img width=\"748\" alt=\"Screenshot 2022-11-24 at 15 59 54\"\r\nsrc=\"https://user-images.githubusercontent.com/16084106/203814663-b9e37be2-5017-4aba-94da-9f928de490c8.png\">\r\n\r\n\r\n### Checklist\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"fbd040febb23db22a38ee40b0efdedaa65508f4d","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v8.7.0"],"number":146303,"url":"https://github.com/elastic/kibana/pull/146303","mergeCommit":{"message":"[Fleet] Rename parameter source_uri to sourceURI in agent policy (#146303)\n\n## Summary\r\nCloses https://github.com/elastic/kibana/issues/141470\r\n\r\nThe source_uri parameter in agent policy should actually be `sourceURI`.\r\nI didn't change the parameter everywhere in the code but only where is\r\nexposed to the agent policy/actions, since in other places is only used\r\ninternally by fleet.\r\n\r\n<img width=\"748\" alt=\"Screenshot 2022-11-24 at 15 59 54\"\r\nsrc=\"https://user-images.githubusercontent.com/16084106/203814663-b9e37be2-5017-4aba-94da-9f928de490c8.png\">\r\n\r\n\r\n### Checklist\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"fbd040febb23db22a38ee40b0efdedaa65508f4d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146303","number":146303,"mergeCommit":{"message":"[Fleet] Rename parameter source_uri to sourceURI in agent policy (#146303)\n\n## Summary\r\nCloses https://github.com/elastic/kibana/issues/141470\r\n\r\nThe source_uri parameter in agent policy should actually be `sourceURI`.\r\nI didn't change the parameter everywhere in the code but only where is\r\nexposed to the agent policy/actions, since in other places is only used\r\ninternally by fleet.\r\n\r\n<img width=\"748\" alt=\"Screenshot 2022-11-24 at 15 59 54\"\r\nsrc=\"https://user-images.githubusercontent.com/16084106/203814663-b9e37be2-5017-4aba-94da-9f928de490c8.png\">\r\n\r\n\r\n### Checklist\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"fbd040febb23db22a38ee40b0efdedaa65508f4d"}}]}] BACKPORT--> Co-authored-by: Cristina Amico <[email protected]>
Fleet is creating agent policies with
agent.download.source_uri
when the agent expects it to beagent.download.sourceURI
. This has caused several bugs with agent artifact downloads not working correctly, causing the agent to have to handle both formats. See elastic/elastic-agent#1252 for one example.The agent configuration entry for the download URI is defined here:
I am not entirely sure where Fleet defines this, but one reference to
source_uri
instead ofsourceURI
can be found at:kibana/x-pack/plugins/fleet/common/types/models/agent_policy.ts
Lines 104 to 113 in e8e1203
Fixing this would require migrating existing agent policies to the expected configuration key.
I am less interested in fixing this particular instance of Fleet being out of sync with the Agent, and more interested in defining a way to prevent this type of problem in the future.
The text was updated successfully, but these errors were encountered: