Skip to content

Commit

Permalink
Merge pull request #47 from f5devcentral/v1.4.2
Browse files Browse the repository at this point in the history
v1.4.2 partitions special chars
  • Loading branch information
DumpySquare authored Feb 27, 2024
2 parents 0977aa5 + ee3c342 commit bfddaf1
Show file tree
Hide file tree
Showing 17 changed files with 4,870 additions and 4,391 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.2] - (02.27.2024)

### Fixed

- bug in tenants/partitions with special chars: .-_

---

## [1.4.1] - (11.03.2023)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.1",
"version": "1.4.2",
"license": "Apache-2.0",
"homepage": "https://github.com/f5devcentral/f5-corkscrew#readme",
"main": "dist/index.js",
Expand Down
10 changes: 5 additions & 5 deletions src/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ export class RegExTree {
/**
* used for abstracting partition from name
*/
name = /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/;
name = /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/;

ltm = {
virtual: {
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
destination: /destination [\w.\-\/]+\/([\d.]+:\d+)/,
description: /\n +description "(?<desc>[\w' .-/]+)"\n/,
pool: /(?<!source-address-translation {\n\s+) pool (.+?)\n/,
Expand All @@ -78,7 +78,7 @@ export class RegExTree {
vlans: /vlans {([\s\S]+?)\n }\n/,
},
pool: {
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
membersGroup: /members {([\s\S]+?)\n }\n/,
members: /(?<name>[\w\-\/:.]+) {\n +(?<body>[\s\S]+?)\n +}/g,
member: /(?<name>[\w\-\/:.]+) {\n +(?<body>[\s\S]+?)\n +}/,
Expand Down Expand Up @@ -112,7 +112,7 @@ export class RegExTree {

gtm = {
wideip: {
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
description: /description "(?<desc>[\w' .-/]+)"\n/,
persistence: /persistence (?<bool>\w+)/,
'pool-lb-mode': /pool-lb-mode (?<mode>\w+)/,
Expand Down Expand Up @@ -156,7 +156,7 @@ export class RegExTree {
}

apm = {
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
'accept-languages': /\n +accept-languages { (?<langs>[\w ]+)? }\n/,
'access-policy': /\n +access-policy (?<name>[\w/.]+)\n/,
'log-settings': /\n +log-settings {\n +(?<profiles>[\S\s]+?)\n +}\n/,
Expand Down
2 changes: 1 addition & 1 deletion src/unPackerStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export function fileFilter(name: string): boolean {
// base /config directory
/^config/,
// /partitions directory including /partition name directory
/\/partitions\/[\w-]+?/,
/\/partitions\/[A-Za-z][0-9A-Za-z_.-]+/,
// any bigip*.conf file
/\/bigip(?:[\w-]*).conf$/
], undefined)
Expand Down
2 changes: 1 addition & 1 deletion tests/037_ltmDetails.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('LTM parsing/abstraction', async function () {

const keys = Object.keys(device.configObject.ltm?.virtual!);

assert.ok(keys.length === 15, 'should find 15 virtual servers');
assert.ok(keys.length === 17, 'should find 15 virtual servers');

});

Expand Down
2 changes: 2 additions & 0 deletions tests/052_ucs.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ describe('ucs tests', async function () {
"/foo/t1.lab.io_80vs",
"/foo/wiffle_redirect_vs",
"/foo/app8_80vs",
"/foo.a_1-c/barSpec.b-80_vs",
"/foo.a_1-c/barSpec.b-443_vs",
"/hue-infra/hue-up/hue-up.benlab.io_t80_vs",
"/hue-infra/hue-up/hue-up.benlab.io_t443_vs",
]
Expand Down
2 changes: 2 additions & 0 deletions tests/054_qkview.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ describe('qkview tests', async function () {
"/foo/t1.lab.io_80vs",
"/foo/wiffle_redirect_vs",
"/foo/app8_80vs",
"/foo.a_1-c/barSpec.b-80_vs",
"/foo.a_1-c/barSpec.b-443_vs",
"/hue-infra/hue-up/hue-up.benlab.io_t80_vs",
"/hue-infra/hue-up/hue-up.benlab.io_t443_vs",
]
Expand Down
8 changes: 8 additions & 0 deletions tests/archive_generator/archive1/config/bigip_base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ auth partition Common {
auth partition foo {
description "Updated by AS3 at Tue, 06 Oct 2020 18:27:20 GMT"
}
auth partition foo.a_1-c { }
auth partition test { }
auth password-policy {
lockout-duration 10
Expand Down Expand Up @@ -461,6 +462,13 @@ sys folder /foo {
inherited-traffic-group true
traffic-group /Common/traffic-group-1
}
sys folder /foo.a_1-c {
device-group none
hidden false
inherited-devicegroup true
inherited-traffic-group true
traffic-group /Common/traffic-group-1
}
sys folder /foo/defaultsUDP_5555 {
device-group none
hidden false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#TMSH-VERSION: 15.1.8.2

ltm virtual /foo.a_1-c/barSpec.b-80_vs {
creation-time 2024-02-21:19:56:41
destination /foo.a_1-c/5.40.43.88:80
ip-protocol tcp
last-modified-time 2024-02-21:19:56:41
mask 255.255.255.255
profiles {
/Common/http { }
/Common/tcp { }
}
rules {
/Common/_sys_https_redirect
}
serverssl-use-sni disabled
source 0.0.0.0/0
translate-address enabled
translate-port enabled
}
ltm virtual /foo.a_1-c/barSpec.b-443_vs {
creation-time 2024-02-21:19:57:52
destination /foo.a_1-c/5.40.43.88:443
ip-protocol tcp
last-modified-time 2024-02-21:19:57:52
mask 255.255.255.255
profiles {
/Common/clientssl {
context clientside
}
/Common/http { }
/Common/serverssl {
context serverside
}
/Common/tcp { }
}
serverssl-use-sni disabled
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-address enabled
translate-port enabled
}
ltm virtual-address /foo.a_1-c/5.40.43.88 {
address 5.40.43.88
arp enabled
icmp-echo enabled
mask 255.255.255.255
traffic-group /Common/traffic-group-1
}
Loading

0 comments on commit bfddaf1

Please sign in to comment.