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

[Fleet] [UI] Agent upgrade UI should not use current kibana version if there is not an available agent version to match #167387

Closed
hop-dev opened this issue Sep 27, 2023 · 4 comments · Fixed by #167410
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@hop-dev
Copy link
Contributor

hop-dev commented Sep 27, 2023

When checking if an agent has an upgrade available here , we are using the current kibana version, e.g if agent version is less than the current kibana version then an upgrade is available, this is not true in serverless since #165978.

We need to change the behaviour to check against the latest available agent version not the current kibana version.

We should also not display the kibana version as an option, for example, in serverless 8.11.0 when agent 8.11.0 has not been released, here is the error state, we show 8.11.0 which doesnt exist:

image

here is the offending code.

@hop-dev hop-dev added bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team labels Sep 27, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@juliaElastic juliaElastic self-assigned this Sep 27, 2023
@juliaElastic
Copy link
Contributor

juliaElastic commented Sep 27, 2023

@hop-dev We mean to fix this only for serverless or also stateful? Stateful still includes kibana version in the agent version list, I think.

@hop-dev
Copy link
Contributor Author

hop-dev commented Sep 28, 2023

I think in the stateful case the matching agent version will be in the available agent versions list we have, so we could make the behaviour the same for both?

@juliaElastic
Copy link
Contributor

juliaElastic commented Sep 28, 2023

I think the only exception is for prerelease versions like 8.11-SNAPSHOT, where we show now 8.11 as latest agent version.
I can change the logic to offer the latest agent version in stateful as well, I think it makes sense.

criamico pushed a commit that referenced this issue Sep 29, 2023
)

## Summary

Closes #167387

Replaced using kibana version when deciding if agent upgrade is
available (only in serverless, in stateful kibana version is still
returned as an available version).

To verify locally:
- [to test stateless] add this to `kibana.dev.yml`:
`xpack.fleet.internal.onlyAllowAgentUpgradeToKnownVersions: true`
- extract the `agent_versions_list.json` to local kibana folder
`~/kibana/x-pack/plugins/fleet/target`

[agent_versions_list.json.zip](https://github.com/elastic/kibana/files/12739519/agent_versions_list.json.zip)
- verify that upgrade available warnings still work if agent is < latest
agent version (8.10.2)
- when trying to upgrade agent, verify that the default version is the
latest agent version, and 8.11 is not in the list

Agent list:
<img width="1475" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/f06b7bc8-97e6-4ff9-b872-736ede5e969a">

Upgrade available filter - 1 agent on latest version, 9 upgradeable:
<img width="1314" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/4ff5ac02-903b-493b-94df-68b1b7ad6846">

Agent details:
<img width="1512" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/3ff6e1d5-2ccc-4814-83e5-c4760ad63722">

Agent on latest version has disable `Upgrade agent` action:
<img width="1322" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/f461dbf5-04e5-4bcc-8801-48c2b1a90225">

Bulk action with one agent that is not upgradeable (already on latest
version), expected error:
<img width="1597" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/8bfa46ae-6684-4748-9fca-e908c142b642">




### Checklist

- [x] [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants