Skip to content

Commit

Permalink
revert attempt apply all change (#363)
Browse files Browse the repository at this point in the history
Co-authored-by: Katie Dai <kdai7@ibm.com>
  • Loading branch information
kdai7 and Katie Dai authored Nov 30, 2022
1 parent 9c153b3 commit 1ee5a45
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/BaseDownloadController.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ module.exports = class BaseDownloadController extends CompositeController {

// when failure to download optional resource occurs, should continue to download other requests, but shouldnt reconcile children
let optionalResourceFailure = 0;
// when failure to download mandatory resource occurs, should attempt to download other requests, but shouldn't patch self or reconcile children
// for cases where one resource requires another in order to be applied
let mandatoryResourceFailure = 0;
let errMsgs = '';
let lastModifiedArray = objectPath.get(this.data, ['object', 'status', 'last-modified'], []);
let newLastModifiedArray = [];

Expand Down Expand Up @@ -136,20 +132,13 @@ module.exports = class BaseDownloadController extends CompositeController {
this.log.warn(msg);
this.updateRazeeLogs('warn', { controller: 'BaseDownload', warn: `Error applying file to kubernetes, see logs for details. StatusCode: ${e.statusCode}`, url: url });
} else {
// attempt to apply all files rather than aborting on encountering the first error
++mandatoryResourceFailure;
errMsgs += '\n'+msg;
return Promise.reject(msg);
}
}

}
this.log.info(`requests processed: ${requests.length}`);

if( mandatoryResourceFailure > 0 ) {
this.log.error(`${mandatoryResourceFailure} mandatory resource(s) failed to process: ${errMsgs}`);
return Promise.reject(`${mandatoryResourceFailure} errors occurred: ${errMsgs}`);
}

// update the last-modified array
let res = await this.patchSelf({
status: {
Expand Down

0 comments on commit 1ee5a45

Please # to comment.