mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[8.15] [Fleet] Always use a SNAPSHOT version when running elastic-agent docker image (#187777) (#187852)
# Backport This will backport the following commits from `main` to `8.15`: - [[Fleet] Always use a SNAPSHOT version when running elastic-agent docker image (#187777)](https://github.com/elastic/kibana/pull/187777) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2024-07-09T11:27:20Z","message":"[Fleet] Always use a SNAPSHOT version when running elastic-agent docker image (#187777)","sha":"834f8fdb375d0c7eef0de974ae5c0f0c0f19b60a","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","Team:Elastic-Agent-Control-Plane","backport:prev-minor","v8.16.0"],"title":"[Fleet] Always use a SNAPSHOT version when running elastic-agent docker image","number":187777,"url":"https://github.com/elastic/kibana/pull/187777","mergeCommit":{"message":"[Fleet] Always use a SNAPSHOT version when running elastic-agent docker image (#187777)","sha":"834f8fdb375d0c7eef0de974ae5c0f0c0f19b60a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187777","number":187777,"mergeCommit":{"message":"[Fleet] Always use a SNAPSHOT version when running elastic-agent docker image (#187777)","sha":"834f8fdb375d0c7eef0de974ae5c0f0c0f19b60a"}}]}] BACKPORT--> Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
This commit is contained in:
parent
a269eb2783
commit
f6c1ad83b4
1 changed files with 5 additions and 1 deletions
|
@ -15,6 +15,10 @@ export async function getLatestVersion(): Promise<string> {
|
|||
return pRetry(() => axios('https://artifacts-api.elastic.co/v1/versions'), {
|
||||
maxRetryTime: 60 * 1000, // 1 minute
|
||||
})
|
||||
.then((response) => last(response.data.versions as string[]) || DEFAULT_VERSION)
|
||||
.then(
|
||||
(response) =>
|
||||
last((response.data.versions as string[]).filter((v) => v.includes('-SNAPSHOT'))) ||
|
||||
DEFAULT_VERSION
|
||||
)
|
||||
.catch(() => DEFAULT_VERSION);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue