-
Notifications
You must be signed in to change notification settings - Fork 149
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
Use only fs.NewDownloader for file://. #3682
Use only fs.NewDownloader for file://. #3682
Conversation
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
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.
looks good
|
||
// set specific downloader, local file just uses the fs.NewDownloader | ||
// no fallback is allowed because it was requested that this specific source be used | ||
factory = func(ver *agtversion.ParsedSemVer, l *logger.Logger, config *artifact.Config, d *details.Details) (download.Downloader, error) { |
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 can even move this to fs and have factory = fs.NewDownloaderFactory
to make it a bit more readable
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.
i didn't do that as the factory interface is private, takes arguments that the download module doesn't really need to import as its not used
buildkite test this |
Buildkite failure is only in the merge coverage reports step, force merging. |
@blakerouse would you mind backporting this PR to |
* Use only fs.NewDownloader for file://. * Add changelog entry. * Don't retry download with its file://. (cherry picked from commit dba2166) # Conflicts: # internal/pkg/agent/application/upgrade/step_download.go
This is a manual backport of elastic/elastic-agent#3682 Only the essentials have been backported ignoring features like parsed agent version or download retries which are part of other PRs that have not been backported onto elastic-agent 7.17
This is a manual backport of elastic/elastic-agent#3682 Only the essentials have been backported ignoring features like parsed agent version or download retries which are part of other PRs that have not been backported onto elastic-agent 7.17
What does this PR do?
Changes the upgrade artifacts fetcher to only use the
fs.NewDownloader
when a--source-uri
is passed withfile://
prefix.Why is it important?
Ensures that when a
file://
source URI is provided that a file will never be downloaded from the artifacts API. Upgrade requested to use a local file it should only look there.Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files./changelog/fragments
using the changelog toolHow to test this PR locally