Skip to content

Commit 144c480

Browse files
committed
main v1.1.3 fix
1 parent 0122d0a commit 144c480

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
2020

2121
---
2222

23+
## [1.1.3] - (05.25.2023)
24+
25+
### Changed
26+
27+
- [BUG] more snatpool abstraction bug/tweaks
28+
- log error when app abstraction encounters error
29+
2330
## [1.1.2] - (05.25.2023)
2431

2532
### Changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "f5-corkscrew",
33
"description": "extracting tmos config",
44
"author": "F5DevCentral",
5-
"version": "1.1.2",
5+
"version": "1.1.3",
66
"license": "Apache-2.0",
77
"homepage": "https://github.com/f5devcentral/f5-corkscrew#readme",
88
"main": "dist/index.js",

src/digConfigs.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export async function digVsConfig(vsName: string, vsConfig: BigipConfObj["ltm"][
3939
if (appObj.pool) {
4040
// dig pool details
4141
// just reassign the parsed pool details into the vs
42-
const body = configTree.ltm.pool[vsConfig.pool];
42+
const body = configTree.ltm?.pool?.[vsConfig.pool];
4343
appObj.lines.push(`ltm pool ${appObj.pool} {${body.line}}`);
4444
// raw copy the pool config
45-
appObj.pool = JSON.parse(JSON.stringify(configTree.ltm.pool[vsConfig.pool]));
45+
appObj.pool = JSON.parse(JSON.stringify(configTree.ltm?.pool?.[vsConfig.pool]));
4646
delete appObj.pool.line;
4747

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

104104
// if this snat string is the name of a snat pool, then replace with snatpool details
105105
// if not, then its 'automap' or 'none' => nothing to add here
106-
if (configTree.ltm.snatpool[vsConfig.snat]) {
106+
if (configTree.ltm?.snatpool?.[vsConfig.snat]) {
107107
const c = JSON.parse(JSON.stringify(configTree.ltm.snatpool[vsConfig.snat]));
108108
appObj.lines.push(`ltm snatpool ${vsConfig.snat} { ${c.line} }`)
109109
delete c.line;

src/ltm.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ export default class BigipConfig extends EventEmitter {
456456
apps.push(vsApp);
457457
})
458458
.catch(err => {
459-
apps.push({ name: key, lines: err, });
459+
// apps.push({ name: key, lines: err, });
460+
logger.error(`corkscrew: problem abstracting app/vs ${key}`, err);
460461
})
461462
}
462463

tests/037_ltmDetails.tests.ts

+10
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ describe('LTM parsing/abstraction', async function () {
9191

9292
});
9393

94+
it(`no snat pools`, async function () {
95+
96+
delete device.configObject.ltm?.snatpool;
97+
98+
const localExpld = await device.explode();
99+
100+
assert.ok(localExpld, 'should not error while abstracting apps with missing configs');
101+
102+
});
103+
94104

95105

96106

0 commit comments

Comments
 (0)