-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Allow bundled installs to occur even if EPR is unreachable #125127
Merged
kpollich
merged 40 commits into
elastic:main
from
kpollich:125097-prevent-registry-network-errors-blocking-fleet-bulk-install
Feb 16, 2022
Merged
Changes from 18 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
1d75cc6
Allow bundled installs to occur even if EPR is unreachable
kpollich 68ad69a
Fix type errors in test
kpollich c69c92a
Fix failing test
kpollich c09df4f
fixup! Fix failing test
kpollich 8056bba
Remove unused object in mock
kpollich aba45c7
Make creation of preconfigured agent policy functional
kpollich 928b7ef
Always fall back to bundled packages if available
kpollich 13e218d
Remove unused import
kpollich e2f2fea
Use packageInfo object instead of RegistryPackage where possible
kpollich bac2d46
Fix type error in assets test
kpollich f833166
Fix test timeouts
kpollich bdcc878
Fix promise logic for registry fetch fallback
kpollich e23ddbb
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kpollich af1d13c
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kpollich 49be525
Use archive package as default in create package policy
kpollich f165e5d
Always install from bundled package if it exists - regardless of inst…
kpollich 132b81d
Clean up + refactor a bit
kpollich ecfa6fa
Default to cached package archive for policy updates
kpollich b4d244c
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kibanamachine 8634894
Update mock in get.test.ts
kpollich 80f3e65
Add test for install from bundled package logic
kpollich 1f2dfe3
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kibanamachine 61fa10e
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kibanamachine 670d24c
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kpollich 8f0ad33
Delete timeout call in security solution tests
kpollich 84751f1
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kibanamachine d192922
Fix unused var in endpoint test
kpollich 840c4ec
Fix another unused var in endpoint test
kpollich 513dcc1
[Debug] Add some logging to test installation times in CI
kpollich 21baf09
Revert "[Debug] Add some logging to test installation times in CI"
kpollich d79e967
Update docker images for registry
kpollich cce17e3
Merge branch 'main' into 125097-prevent-registry-network-errors-block…
kpollich 2310ec8
Update docker image digest again
kpollich 53f3b60
Refactor latest package fetching to fix broken logic/tests
kpollich 883e216
Fix a bunch of type errors around renamed fetch latest package versio…
kpollich 3541e4f
Remove unused import
kpollich 3a828d5
Bump docker version to latest snapshot (again)
kpollich 9e7b122
Revert changes to endpoint tests
kpollich 351ce75
Pass experimental flag in synthetics tests
kpollich 7938cd7
Fix endpoint version in fleet api integration test
kpollich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@joshdover - I made this change to push the "fall back to bundled packages" logic down closer to the place we do the actual installation. The challenging part is the abstraction level of the actual
installPackage
function - it accept two signatures: one for registry packages and another for uploads. So, the choice I made here was to simply always try to install a given package from its bundled equivalent if it exists.e.g. if
fleet_server-1.0.1
is provided, and we have that exact version included as a bundled package, we'll install from that source even if the function was called withinstallSource: registry
in its arguments. I think this is a fine implementation choice and the only minor drawback I can think of would be snapshot packages where we have a bundled version downloaded to disk, but the version in the snapshot registry has been updated in-place. I think that's a minor enough edge case to warrant this choice.Let me know if I can clarify anything else here - I'd like to get your thoughts on this approach before merging. Thanks!
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.
Awesome, thanks for exploring this. I like this implementation much more. I'm ok with this drawback as well. One other minor drawback is that API requests to install a package at
latest
will not work, but I don't think we support this today anyways so it should be considered separately.Could we add a test to
install.test.ts
for this case?