Skip to content

Commit

Permalink
main v1.1.3 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DumpySquare committed May 24, 2023
1 parent 0122d0a commit 144c480
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

---

## [1.1.3] - (05.25.2023)

### Changed

- [BUG] more snatpool abstraction bug/tweaks
- log error when app abstraction encounters error

## [1.1.2] - (05.25.2023)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "f5-corkscrew",
"description": "extracting tmos config",
"author": "F5DevCentral",
"version": "1.1.2",
"version": "1.1.3",
"license": "Apache-2.0",
"homepage": "https://github.com/f5devcentral/f5-corkscrew#readme",
"main": "dist/index.js",
Expand Down
6 changes: 3 additions & 3 deletions src/digConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export async function digVsConfig(vsName: string, vsConfig: BigipConfObj["ltm"][
if (appObj.pool) {
// dig pool details
// just reassign the parsed pool details into the vs
const body = configTree.ltm.pool[vsConfig.pool];
const body = configTree.ltm?.pool?.[vsConfig.pool];
appObj.lines.push(`ltm pool ${appObj.pool} {${body.line}}`);
// raw copy the pool config
appObj.pool = JSON.parse(JSON.stringify(configTree.ltm.pool[vsConfig.pool]));
appObj.pool = JSON.parse(JSON.stringify(configTree.ltm?.pool?.[vsConfig.pool]));
delete appObj.pool.line;

if(appObj.pool?.members) {
Expand Down Expand Up @@ -103,7 +103,7 @@ export async function digVsConfig(vsName: string, vsConfig: BigipConfObj["ltm"][

// if this snat string is the name of a snat pool, then replace with snatpool details
// if not, then its 'automap' or 'none' => nothing to add here
if (configTree.ltm.snatpool[vsConfig.snat]) {
if (configTree.ltm?.snatpool?.[vsConfig.snat]) {
const c = JSON.parse(JSON.stringify(configTree.ltm.snatpool[vsConfig.snat]));
appObj.lines.push(`ltm snatpool ${vsConfig.snat} { ${c.line} }`)
delete c.line;
Expand Down
3 changes: 2 additions & 1 deletion src/ltm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ export default class BigipConfig extends EventEmitter {
apps.push(vsApp);
})
.catch(err => {
apps.push({ name: key, lines: err, });
// apps.push({ name: key, lines: err, });
logger.error(`corkscrew: problem abstracting app/vs ${key}`, err);
})
}

Expand Down
10 changes: 10 additions & 0 deletions tests/037_ltmDetails.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ describe('LTM parsing/abstraction', async function () {

});

it(`no snat pools`, async function () {

delete device.configObject.ltm?.snatpool;

const localExpld = await device.explode();

assert.ok(localExpld, 'should not error while abstracting apps with missing configs');

});




Expand Down

0 comments on commit 144c480

Please sign in to comment.