Skip to content

Commit

Permalink
Merge pull request #46 from f5devcentral/v1.4.1
Browse files Browse the repository at this point in the history
1.4.1 objCounter bug Nov 2023
  • Loading branch information
DumpySquare authored Nov 3, 2023
2 parents 8313344 + b81952b commit 0977aa5
Show file tree
Hide file tree
Showing 10 changed files with 4,388 additions and 4,380 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how



---

## [1.4.1] - (11.03.2023)

### Fixed

- bug in objCounter when missing properties/objects

---

## [1.4.0] - (07.11.2023)
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.4.0",
"version": "1.4.1",
"license": "Apache-2.0",
"homepage": "https://github.com/f5devcentral/f5-corkscrew#readme",
"main": "dist/index.js",
Expand Down
20 changes: 10 additions & 10 deletions src/objCounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ export async function countObjects (obj: BigipConfObj): Promise<ObjStats> {


// GTM stats
if(obj.gtm) {
if(obj?.gtm) {
// here we return/assign the value
stats.gtm = await countGSLB(obj);
}

if(obj.apm) {
if(obj?.apm) {
// here we pass in the main stats object and add stats in the function
await countAPM(obj, stats)
}

// asm policies are refenced by local traffic policies on each vs
if(obj.asm?.policy) {
if(obj?.asm?.policy) {
stats.asmPolicies = Object.keys(obj.asm.policy).length;
}

if(obj.security['bot-defense']) {
if(obj?.security?.['bot-defense']) {
stats.botProfiles = Object.keys(obj.security['bot-defense']).length;
}

if(obj.security.dos) {
if(obj?.security?.dos) {
stats.dosProfiles = Object.keys(obj.security.dos).length;
}

Expand All @@ -82,13 +82,13 @@ export async function countAPM(obj: BigipConfObj, stats: ObjStats): Promise<void

// count access policies
// apm policy access-policy <name> <details>
if(obj.apm.policy?.['access-policy']) {
if(obj?.apm?.policy?.['access-policy']) {
stats.apmPolicies = Object.keys(obj.apm.policy['access-policy']).length;
}

// count access profiles
// apm profile access <name> <details
if(obj.apm.profile?.access) {
if(obj?.apm?.profile?.access) {
stats.apmProfiles = Object.keys(obj.apm.profile.access).length;
}

Expand All @@ -112,7 +112,7 @@ export async function countGSLB(obj: BigipConfObj): Promise<GslbStats> {
parents.forEach( p => {

// if parent found in obj.gtm object
if(obj.gtm[p]) {
if(obj?.gtm?.[p]) {
// count the keys
gtmStats[`${p}s`] = Object.keys(obj.gtm[p]).length;
}
Expand All @@ -122,7 +122,7 @@ export async function countGSLB(obj: BigipConfObj): Promise<GslbStats> {
// pools and wideips have named children object for the different record types
// so we need to dig a bit deeper into each one

if(obj.gtm.pool) {
if(obj?.gtm?.pool) {

// we have some gslb pools so, create the param and set the initial value
gtmStats.pools = 0
Expand All @@ -142,7 +142,7 @@ export async function countGSLB(obj: BigipConfObj): Promise<GslbStats> {
})
}

if(obj.gtm.wideip) {
if(obj?.gtm?.wideip) {

gtmStats.wideips = 0;

Expand Down
1,208 changes: 604 additions & 604 deletions tests/artifacts/f5_corkscrew_test.conf.log

Large diffs are not rendered by default.

1,206 changes: 603 additions & 603 deletions tests/artifacts/f5_corkscrew_test.conf.log.json

Large diffs are not rendered by default.

1,652 changes: 826 additions & 826 deletions tests/artifacts/f5_corkscrew_test.qkview.log

Large diffs are not rendered by default.

1,650 changes: 825 additions & 825 deletions tests/artifacts/f5_corkscrew_test.qkview.log.json

Large diffs are not rendered by default.

Binary file modified tests/artifacts/f5_corkscrew_test.tar.gz
Binary file not shown.
1,512 changes: 756 additions & 756 deletions tests/artifacts/f5_corkscrew_test.ucs.log

Large diffs are not rendered by default.

1,510 changes: 755 additions & 755 deletions tests/artifacts/f5_corkscrew_test.ucs.log.json

Large diffs are not rendered by default.

0 comments on commit 0977aa5

Please sign in to comment.