Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Ignore all DO errors during onboarding #373

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions app/waf/src/services/do.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,17 +470,9 @@ export class OnboardingManager {
return resObj[0]['result']['code'] === 200;
},
reason => {
// Wait for iControl LX restarting, ignore 404, 502 and 503
if (reason.statusCode === 404 || reason.statusCode > 500) {
return false;
}

// if onboarding fails.
let mesg =
'Failed to query onboarding status: ' + JSON.stringify(reason);
this.logger.error(mesg);
// quit immediately
return Promise.reject(mesg);
// Ignore all errors, because iControl LX is restarting
this.logger.warn(`DO error: ${reason}`);
return false;
},
);
}
Expand Down
6 changes: 2 additions & 4 deletions app/waf/test/acceptance/adc.controller.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1825,13 +1825,11 @@ describe('AdcController test', () => {

await checkAndWait(checkStatus, 200, [], 5).then(() => {});
expect(response.body.adc.status).eql('ONBOARDERROR');
expect(response.body.adc.lastErr).startWith(
'ONBOARDERROR: Failed to query onboarding status:',
);
expect(response.body.adc.lastErr).startWith('ONBOARDERROR: timeout');
expect(response.body.adc.management.connection.rootPass).not.eql('default');

restoreConsoleLog();
});
}).timeout(5000);

it('post ' + prefix + '/adcs: onboard timeout', async () => {
let adc = createAdcObject({
Expand Down
3 changes: 1 addition & 2 deletions app/waf/test/unit/service.OnboardingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ describe('test OnboardingManager', async () => {

try {
await doMgr.isDone(ExpectedData.doTaskId);
expect('call').eql('should not happen.');
} catch (error) {
expect(error).startWith('Failed to query onboarding status: ');
expect('call').eql('should not happen.');
}
});
});