mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
chore(NA): add no cache headers for axios requests when downloading cloud dependencies (#158032)
There are times when our DRA artifact jobs bundle a previous version of the dependencies (for example beats) even though a new one is already available. I'm not 100% this will fix the problem but I think we should try to use no cache headers on the requests that get the manifest contents for the latest versions. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
a9b13c0d96
commit
731aaa4045
1 changed files with 9 additions and 2 deletions
|
@ -58,11 +58,18 @@ export const DownloadCloudDependencies: Task = {
|
|||
let manifestUrl = '';
|
||||
let manifestJSON = null;
|
||||
const buildUrl = `https://${subdomain}.elastic.co/beats/latest/${config.getBuildVersion()}.json`;
|
||||
const axiosConfigWithNoCacheHeaders = {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
Pragma: 'no-cache',
|
||||
Expires: '0',
|
||||
},
|
||||
};
|
||||
try {
|
||||
const latest = await Axios.get(buildUrl);
|
||||
const latest = await Axios.get(buildUrl, axiosConfigWithNoCacheHeaders);
|
||||
buildId = latest.data.build_id;
|
||||
manifestUrl = latest.data.manifest_url;
|
||||
manifestJSON = (await Axios.get(manifestUrl)).data;
|
||||
manifestJSON = (await Axios.get(manifestUrl, axiosConfigWithNoCacheHeaders)).data;
|
||||
if (!(manifestUrl && manifestJSON)) throw new Error('Missing manifest.');
|
||||
} catch (e) {
|
||||
log.error(`Unable to find Beats artifacts for ${config.getBuildVersion()} at ${buildUrl}.`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue