Skip to content
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

Refactor: Use the capabilities to defined if an Agent is upgradable or not #290

Open
ph opened this issue Apr 1, 2021 · 4 comments
Open
Labels
Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@ph
Copy link
Contributor

ph commented Apr 1, 2021

Today we can use https://github.com/elastic/beats/blob/64f70785c0911eeb6f3f6ce5264f61544844ca0f/x-pack/elastic-agent/pkg/agent/application/upgrade/upgrade.go#L78 to define if a release is upgradable or not. We have added the concept of capabilties in elastic/beats#23848

We should if to the capabitilies files, it could look like this:

capabilities:
-  upgrade: false

@ruflin @mostlyjason WDYT if make it generic on the action that we support https://github.com/elastic/beats/tree/1f1fae56057dce0604f72f2cf0099f9a6f2b75aa/x-pack/elastic-agent/pkg/agent/application/pipeline/actions/handlers?

capabilities:
- rule: deny
  action: Upgrade
@ph ph added the Team:Elastic-Agent Label for the Agent team label Apr 1, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/agent (Team:Agent)

@ruflin
Copy link
Member

ruflin commented Apr 6, 2021

++ on adding it to capabilities.

@ph Can you elaborate on the action approach? You mean it would cover multiple cases at once directly? If yes, kind of like the idea.

We will need to make sure independent of the implementation, that an Agent reports its capabilities so Fleet can disable certain UI components / API calls.

@ph
Copy link
Contributor Author

ph commented Apr 6, 2021

@ruflin Yeah, This is my point, we could cover multiple cases with a single strategy. Every command send from Fleet is an action, including upgrade so if we add something to control which kind of action we can executed on the agent we actually support the current use case of an upgrade and any potential action we would like to restrict in the future.

And by doing so we only need to figure out "how capabilities" are surfaced back in the UI.

@faec faec transferred this issue from elastic/beats Apr 4, 2022
@blakerouse
Copy link
Contributor

I think we should scope the action based on the input type and for elastic-agent use that for its type, so requiring all actions to have a prefix of {input-type}/{action-name}. So for the Elastic Agent it would look like?

capabilities:
- rule: deny
  action: elastic-agent/upgrade

That would allow actions targeting specific inputs to also be denied. Thoughts?

@jlind23 jlind23 added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

5 participants