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] Add latest package flag and remove force flag #97289

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Apr 15, 2021

Summary

Closes #97138

Preconfiguration can now install a latest version of a package with the latest keyword:

xpack.fleet.packages:
  - name: package_name
    version: latest

This also removes the force flag for installing outdated versions of packages. Instead, if you specify a particular package version, that version will always be installed unless a later version of the package is already installed.

Testing

  1. Set your kibana.dev.yml to:
xpack.fleet.packages:
  - name: nginx
    version: latest
  - name: apache
    version: 0.3.4

Ensure that the latest version of nginx is installed, and that version 0.3.4 of apache is installed.

  1. Go to Apache > Settings and click the Update Package button. Then refresh the page so that plugin setup runs again. Ensure that the latest version of apache is still installed, and that version 0.3.4 has not been reinstalled.
  2. Install Azure. Then modify your kibana.dev.yml to read:
xpack.fleet.packages:
  - name: nginx
    version: latest
  - name: apache
    version: 0.3.4
  - name: azure
    version: 0.2.0

Wait for the server to restart, and refresh the page. Ensure that the latest version of Azure remains installed, and that 0.2.0 has not been forced to install.

@Zacqary Zacqary added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Fleet Fleet team's agent central management project Team:Fleet Team label for Observability Data Collection Fleet team NeededFor:Cloud v7.13.0 labels Apr 15, 2021
@Zacqary Zacqary requested a review from a team as a code owner April 15, 2021 16:59
@Zacqary Zacqary self-assigned this Apr 15, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Feature:Fleet)

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Code changes look good but I'm not sure that latest is working as expected if an older package version is already installed. I did a local test like this:

  • Start kibana with yaml
xpack.fleet.packages:
  - name: nginx
    version: latest
  - name: apache
    version: 0.3.4
  • Verified that nginx latest and apache 0.3.4 are installed
  • Updated kibana yaml to
xpack.fleet.packages:
  - name: nginx
    version: latest
  - name: apache
    version: latest
  • Observed that apache 0.3.4 is still installed, instead of being upgraded to the latest version. UI shows that an upgrade is available

@Zacqary
Copy link
Contributor Author

Zacqary commented Apr 15, 2021

@jen-huang Updated the ensureInstalledPackage function to behave as expected.

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Tested again locally by specifying apache 0.3.4 -> latest -> back to 0.3.4. Confirmed that the behavior is correct now and the latest version remains installed even when specifying an older version. 🚀

@Zacqary Zacqary enabled auto-merge (squash) April 15, 2021 21:27
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 345.8KB 346.2KB +317.0B

History

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

cc @Zacqary

@Zacqary Zacqary merged commit 6faf07d into elastic:master Apr 15, 2021
Zacqary added a commit to Zacqary/kibana that referenced this pull request Apr 15, 2021
* [Fleet] Add latest package flag and remove force flag

* Fix installing latest package when old package is still installed
Zacqary added a commit that referenced this pull request Apr 16, 2021
* [Fleet] Add latest package flag and remove force flag

* Fix installing latest package when old package is still installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Fleet Fleet team's agent central management project NeededFor:Cloud release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Allow preconfiguration to install latest package instead of a specific version
4 participants