MCPcopy Index your code
hub / github.com/scality/cloudserver / applyConfigurationOverlay

Function applyConfigurationOverlay

lib/management/poll.js:44–67  ·  view source on GitHub ↗
(
    managementEndpoint, instanceId, remoteToken, log)

Source from the content-addressed store, hash-verified

42
43// TODO save only after successful patch
44function applyConfigurationOverlay(
45 managementEndpoint, instanceId, remoteToken, log) {
46 async.waterfall([
47 wcb => loadCachedOverlay(log, wcb),
48 (cachedOverlay, wcb) => patchConfiguration(cachedOverlay,
49 log, wcb),
50 (cachedOverlay, wcb) =>
51 loadRemoteOverlay(managementEndpoint, instanceId, remoteToken,
52 cachedOverlay, log, wcb),
53 (cachedOverlay, remoteOverlay, wcb) =>
54 saveConfigurationVersion(cachedOverlay, remoteOverlay, log, wcb),
55 (remoteOverlay, wcb) => patchConfiguration(remoteOverlay,
56 log, wcb),
57 ], error => {
58 if (error) {
59 log.error('could not apply managed configuration',
60 { error: reshapeExceptionError(error),
61 method: 'applyConfigurationOverlay' });
62 }
63 setTimeout(applyConfigurationOverlay, pullConfigurationOverlayDelay,
64 managementEndpoint, instanceId, remoteToken,
65 logger.newRequestLogger());
66 });
67}
68
69function postStats(managementEndpoint, instanceId, remoteToken, report, next) {
70 const toURL = `${managementEndpoint}/${instanceId}/stats`;

Callers 1

Calls 5

loadCachedOverlayFunction · 0.85
patchConfigurationFunction · 0.85
loadRemoteOverlayFunction · 0.85
saveConfigurationVersionFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected