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] Changes to bulk upgrade api for allowing rolling upgrades #131947

Merged
merged 13 commits into from
May 16, 2022

Conversation

criamico
Copy link
Contributor

@criamico criamico commented May 10, 2022

Summary

Part of #130259

Change restrictions in the bulk upgrade API:

  • Allow to upgrade to a version <= Kibana version (it was only to the exact same version before)
  • Add a check related to the max fleet server version installed:
    • When no fleet server agents are being upgraded, verify that target version > maximum installed Fleet server version
    • When some fleet server agents are among the agents being upgraded, skip the fleet server version check

I'm having some trouble with the integration tests, however I put the PR up for review since the code is completed.

Testing

Test 1

  • Try to update some installed agents to a version <= Kibana Version. Make sure that the fleet server agents have the same version as Kibana. From dev tools:
    POST kbn:/api/fleet/agents/bulk_upgrade
    {
      "agents": ["agent-id-1"],
      "version": "8.3.0"
    }
    

The endpoint should return 200.

  • If you try with a version > Kibana it should return 400 instead.

Test 2

  • Install a fleet server agent with an older version than Kibana (for example 8.1.0)
  • Try to update to an higher version:
POST kbn:/api/fleet/agents/bulk_upgrade
{
  "agents": ["agent-id-1"],
  "version": "8.3.0"
}

The endpoint should return 400

Test 3

  • Keeping the fleet server agent on an older version than Kibana (for example 8.1.0)
  • Try to update some agents and the fleet server agent itself to an higher version:
POST kbn:/api/fleet/agents/bulk_upgrade
{
  "agents": ["agent-id-1", "fleet-server-agent-id"],
  "version": "8.3.0"
}

The endpoint should return 200

@criamico criamico self-assigned this May 10, 2022
@criamico criamico added v8.3.0 Team:Fleet Team label for Observability Data Collection Fleet team release_note:enhancement labels May 10, 2022
@criamico criamico changed the title Rolling upgrade/bulk upgrade api [Fleet] Changes to bulk upgrade api for allowing rolling upgrades May 11, 2022
@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico criamico added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels May 11, 2022
@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico criamico marked this pull request as ready for review May 12, 2022 14:49
@criamico criamico requested a review from a team as a code owner May 12, 2022 14:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet self-requested a review May 12, 2022 17:13

// Check the installed fleet server versions
// Allow upgrading if the agents to upgrade include fleet server agents
const checkFleetServerVersion = async (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we should move this check inside the upgrade service in the isUpgradable function

@nchaulet
Copy link
Member

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @criamico

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@criamico criamico merged commit 44fb932 into elastic:main May 16, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 16, 2022
@criamico criamico deleted the rolling_upgrade/bulk_upgrade_api branch May 16, 2022 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants