-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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] Modify Agent policy and agent upgrades to handle custom source_uri #135629
[Fleet] Modify Agent policy and agent upgrades to handle custom source_uri #135629
Conversation
@elasticmachine merge upstream |
Pinging @elastic/fleet (Team:Fleet) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
import { downloadSourceService, agentPolicyService } from '../../services'; | ||
import type { Agent, AgentPolicy } from '../../types'; | ||
|
||
export const getSourceUriForAgent = async (soClient: SavedObjectsClientContract, agent: Agent) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this one is used anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work here!
💚 Build SucceededMetrics [docs]Public APIs missing comments
Page load bundle
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: cc @criamico |
Summary
Part of #133828
download_source
object per agent policy.download_source.host
is then set assource_uri
in the agent policyagent.download.source_uri
. Ifdownload_ source_id
is set on the policy, the agent policy will have a specificsource_uri,
otherwise the default will be usedsource_uri
can now be passed in the Agent upgrade logic (both single agent and bulk upgrade).Tests
Verify that any agent policy has the default value for source_uri
agent.download.source_uri
you should see the default source_uri (if you didn't set one, it should behttps://artifacts.elastic.co
)Create an agent policy with a custom source_uri
Create a new
download_source
object (something different than the defaultartifacts.elastic.co
) and get the id:Create also a new agent policy and get the id (in my case was
1dcaf600-fdf8-11ec-93d1-01bd67999927
)Set
download_source_id
to the id of the previously createddownload_source
object:click on
view policy
on agent policies page and check that theagent.download.source_uri
hashttp://custom-registry-per-policy
Specify
source_uri
when upgrading an agentPOST upgrade
endpoint it should acceptsource_uri
parameter:Specify
source_uri
when bulk upgrading agents: