Skip to content

Commit ee3c342

Browse files
committed
v1.4.2 partitions special chars
1 parent 0977aa5 commit ee3c342

17 files changed

+4870
-4391
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
2323

2424

2525

26+
---
27+
28+
## [1.4.2] - (02.27.2024)
29+
30+
### Fixed
31+
32+
- bug in tenants/partitions with special chars: .-_
33+
2634
---
2735

2836
## [1.4.1] - (11.03.2023)

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.4.1",
5+
"version": "1.4.2",
66
"license": "Apache-2.0",
77
"homepage": "https://github.com/f5devcentral/f5-corkscrew#readme",
88
"main": "dist/index.js",

src/regex.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ export class RegExTree {
6161
/**
6262
* used for abstracting partition from name
6363
*/
64-
name = /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/;
64+
name = /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/;
6565

6666
ltm = {
6767
virtual: {
68-
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
68+
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
6969
destination: /destination [\w.\-\/]+\/([\d.]+:\d+)/,
7070
description: /\n +description "(?<desc>[\w' .-/]+)"\n/,
7171
pool: /(?<!source-address-translation {\n\s+) pool (.+?)\n/,
@@ -78,7 +78,7 @@ export class RegExTree {
7878
vlans: /vlans {([\s\S]+?)\n }\n/,
7979
},
8080
pool: {
81-
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
81+
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
8282
membersGroup: /members {([\s\S]+?)\n }\n/,
8383
members: /(?<name>[\w\-\/:.]+) {\n +(?<body>[\s\S]+?)\n +}/g,
8484
member: /(?<name>[\w\-\/:.]+) {\n +(?<body>[\s\S]+?)\n +}/,
@@ -112,7 +112,7 @@ export class RegExTree {
112112

113113
gtm = {
114114
wideip: {
115-
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
115+
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
116116
description: /description "(?<desc>[\w' .-/]+)"\n/,
117117
persistence: /persistence (?<bool>\w+)/,
118118
'pool-lb-mode': /pool-lb-mode (?<mode>\w+)/,
@@ -156,7 +156,7 @@ export class RegExTree {
156156
}
157157

158158
apm = {
159-
name: /(?<partition>(\/[\w\d_\-]+\/[\w\d_\-]+\/|\/[\w\d_\-]+\/))(?<name>[\w\d_\-.]+)/,
159+
name: /(?<partition>(\/[\w\d_\-.]+\/[\w\d_\-.]+\/|\/[\w\d_\-.]+\/))(?<name>[\w\d_\-.]+)/,
160160
'accept-languages': /\n +accept-languages { (?<langs>[\w ]+)? }\n/,
161161
'access-policy': /\n +access-policy (?<name>[\w/.]+)\n/,
162162
'log-settings': /\n +log-settings {\n +(?<profiles>[\S\s]+?)\n +}\n/,

src/unPackerStream.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export function fileFilter(name: string): boolean {
194194
// base /config directory
195195
/^config/,
196196
// /partitions directory including /partition name directory
197-
/\/partitions\/[\w-]+?/,
197+
/\/partitions\/[A-Za-z][0-9A-Za-z_.-]+/,
198198
// any bigip*.conf file
199199
/\/bigip(?:[\w-]*).conf$/
200200
], undefined)

tests/037_ltmDetails.tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('LTM parsing/abstraction', async function () {
4343

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

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

4848
});
4949

tests/052_ucs.tests.ts

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ describe('ucs tests', async function () {
7070
"/foo/t1.lab.io_80vs",
7171
"/foo/wiffle_redirect_vs",
7272
"/foo/app8_80vs",
73+
"/foo.a_1-c/barSpec.b-80_vs",
74+
"/foo.a_1-c/barSpec.b-443_vs",
7375
"/hue-infra/hue-up/hue-up.benlab.io_t80_vs",
7476
"/hue-infra/hue-up/hue-up.benlab.io_t443_vs",
7577
]

tests/054_qkview.tests.ts

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ describe('qkview tests', async function () {
7373
"/foo/t1.lab.io_80vs",
7474
"/foo/wiffle_redirect_vs",
7575
"/foo/app8_80vs",
76+
"/foo.a_1-c/barSpec.b-80_vs",
77+
"/foo.a_1-c/barSpec.b-443_vs",
7678
"/hue-infra/hue-up/hue-up.benlab.io_t80_vs",
7779
"/hue-infra/hue-up/hue-up.benlab.io_t443_vs",
7880
]

tests/archive_generator/archive1/config/bigip_base.conf

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ auth partition Common {
66
auth partition foo {
77
description "Updated by AS3 at Tue, 06 Oct 2020 18:27:20 GMT"
88
}
9+
auth partition foo.a_1-c { }
910
auth partition test { }
1011
auth password-policy {
1112
lockout-duration 10
@@ -461,6 +462,13 @@ sys folder /foo {
461462
inherited-traffic-group true
462463
traffic-group /Common/traffic-group-1
463464
}
465+
sys folder /foo.a_1-c {
466+
device-group none
467+
hidden false
468+
inherited-devicegroup true
469+
inherited-traffic-group true
470+
traffic-group /Common/traffic-group-1
471+
}
464472
sys folder /foo/defaultsUDP_5555 {
465473
device-group none
466474
hidden false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#TMSH-VERSION: 15.1.8.2
2+
3+
ltm virtual /foo.a_1-c/barSpec.b-80_vs {
4+
creation-time 2024-02-21:19:56:41
5+
destination /foo.a_1-c/5.40.43.88:80
6+
ip-protocol tcp
7+
last-modified-time 2024-02-21:19:56:41
8+
mask 255.255.255.255
9+
profiles {
10+
/Common/http { }
11+
/Common/tcp { }
12+
}
13+
rules {
14+
/Common/_sys_https_redirect
15+
}
16+
serverssl-use-sni disabled
17+
source 0.0.0.0/0
18+
translate-address enabled
19+
translate-port enabled
20+
}
21+
ltm virtual /foo.a_1-c/barSpec.b-443_vs {
22+
creation-time 2024-02-21:19:57:52
23+
destination /foo.a_1-c/5.40.43.88:443
24+
ip-protocol tcp
25+
last-modified-time 2024-02-21:19:57:52
26+
mask 255.255.255.255
27+
profiles {
28+
/Common/clientssl {
29+
context clientside
30+
}
31+
/Common/http { }
32+
/Common/serverssl {
33+
context serverside
34+
}
35+
/Common/tcp { }
36+
}
37+
serverssl-use-sni disabled
38+
source 0.0.0.0/0
39+
source-address-translation {
40+
type automap
41+
}
42+
translate-address enabled
43+
translate-port enabled
44+
}
45+
ltm virtual-address /foo.a_1-c/5.40.43.88 {
46+
address 5.40.43.88
47+
arp enabled
48+
icmp-echo enabled
49+
mask 255.255.255.255
50+
traffic-group /Common/traffic-group-1
51+
}

0 commit comments

Comments
 (0)