(
managementEndpoint, instanceId, remoteToken, cachedOverlay, log, cb)
| 16 | const pullConfigurationOverlayDelay = 60000; |
| 17 | |
| 18 | function loadRemoteOverlay( |
| 19 | managementEndpoint, instanceId, remoteToken, cachedOverlay, log, cb) { |
| 20 | log.debug('loading remote overlay'); |
| 21 | const opts = { |
| 22 | headers: { |
| 23 | 'x-instance-authentication-token': remoteToken, |
| 24 | 'x-scal-request-id': log.getSerializedUids(), |
| 25 | }, |
| 26 | json: true, |
| 27 | }; |
| 28 | request.get(`${managementEndpoint}/${instanceId}/config/overlay`, opts, |
| 29 | (error, response, body) => { |
| 30 | if (error) { |
| 31 | return cb(error); |
| 32 | } |
| 33 | if (response.statusCode === 200) { |
| 34 | return cb(null, cachedOverlay, body); |
| 35 | } |
| 36 | if (response.statusCode === 404) { |
| 37 | return cb(null, cachedOverlay, {}); |
| 38 | } |
| 39 | return cb(arsenal.errors.AccessForbidden, cachedOverlay, {}); |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | // TODO save only after successful patch |
| 44 | function applyConfigurationOverlay( |
no test coverage detected