-
Notifications
You must be signed in to change notification settings - Fork 148
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
Changes to binary distribution #6542
base: main
Are you sure you want to change the base?
Conversation
Quality Gate failedFailed conditions |
You will need to add integration tests to make sure upgrades respect the flavor or lack of one. For the existing upgrade tests you could probably add a check to ensure every component exists in both versions easily. For flavors you'll need new tests for those case most likely. |
@@ -190,7 +190,7 @@ func TestUpgrader_unpackTarGz(t *testing.T) { | |||
archiveFile, err := tt.args.archiveGenerator(t, tt.args.archiveFiles) | |||
require.NoError(t, err, "creation of test archive file failed") | |||
|
|||
got, err := untar(log, archiveFile, testDataDir) | |||
got, err := untar(log, archiveFile, testDataDir, false, "") |
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.
You should be able to unit test that the logic to respect the flavors when unpacking actually works.
unpackRes, err := u.unpack(version, archivePath, paths.Data()) | ||
// default to extended flavor to avoid breaking behavior | ||
|
||
// no default flavor, keep everything in case flavor is not |
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.
keep everything in case flavor is not
Is not what?
@@ -0,0 +1,13 @@ | |||
basic: |
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.
What value are we getting out of making this a file and having to deal with opening+parsing it vs just embedded this list into the agent as code?
What does this PR do?
This PR changes logic of installation and ugprades in following manner.
Default
install
installs only:additional flag is added that includes components above and:
Upon installation user choice is backed into
.flavor
file.Part of elastic agent package is
.flavors
file defining flavor for this particular version.Upon upgrade or install
.flavors
is read and only components specified in desired flavor (using flag withinstall
or content of.flavor
in case ofupgrade
) are copied.In case of any issues with parsing any of the above files we fall back to previous way and copy everything.
Each components needs to define files in addition to binary, spec and config in a form
in their spec file.
During upgrade target version spec file is parsed. not the current installation.
Why is it important?
Reducing space on disk by omitting not needed components.
Checklist
./changelog/fragments
using the changelog toolHow to test this PR locally
Scenario 1 and 2 (installation)
Build package and install without and with flag
--install-server
check components present
Scenario 3 - upgrade to future version
Prepare same agent but with different commit hash (do small change and commit locally)
Run
upgrade 9.0.0-SNAPSHOT --source-uri="file://....zip" --skip-verify
and check only desired components are presentScenario 4 - upgrade from stale version
Upgrade from previous version to this one and check ALL components are present