Skip to content

Commit 6edf74b

Browse files
authored
Merge pull request #32 from f5devcentral/v1.8.0
4/10 work on v1.8.0
2 parents 090d3c0 + cccd7bc commit 6edf74b

24 files changed

+520
-155
lines changed

.github/workflows/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ jobs:
103103

104104
- name: publish to open-vsix
105105
run: ovsx publish ${{ env.VSIX_PATH }} -p ${{ secrets.OPEN_VSX_TOKEN }}
106+
# Apr2024: open-vsix has been going through changes recently and things seem to be unstable
107+
# so this step is not critical
108+
continue-on-error: true
106109

107110

108111

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ dist
66
tmp
77
out
88
cache
9-
project-flipper-*.tgz
9+
vscode-f5-flipper-*.tgz
1010
*.vsix
1111
private*.conf

.vscodeignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ tests
3737
# *.tgz
3838
*.vsix
3939
dist
40-
private
40+
private*

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1818
### Fixed
1919

2020

21+
---
22+
23+
## [1.8.0] - (04-10-2024)
24+
25+
### Fixed
26+
27+
- [BUG] report output blending with previous config #24
28+
29+
### Added
30+
31+
- [RFE] provide easy button for feedback/issues #4
32+
- specify hostname or address with server references
33+
- Added multiple fast templates for different general apps (tcp/udp/http/https)
34+
- this includes being able to select this fast template to convert with in the ns app json view
35+
- added diagnostic rule to identify when a vserver is pointing to another vserver as a -backupVServer
36+
- this should be converted to f5 priority group activation, not multiple vs
37+
2138
---
2239

2340
## [1.7.0] - (04-08-2024)

diagnostics.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
{
9494
"code": "5617",
9595
"severity": "Information",
96-
"title": "",
97-
"message": "",
98-
"regex": ""
96+
"title": "vs references backupVServer",
97+
"message": "In NS points to a backup VS if current pool resources are down, F5 priority group activation is the equivilant",
98+
"regex": " -backupVServer (?<name>(\"[\\S ]+\"|[\\S]+))"
9999
},
100100
{
101101
"code": "4818",

f5_flipper_test.tgz

348 Bytes
Binary file not shown.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "F5 Flipper",
44
"description": "Breaking down Citrix NetScaler ADC configs",
55
"publisher": "F5DevCentral",
6-
"version": "1.7.0",
6+
"version": "1.8.0",
77
"keywords": [
88
"F5",
99
"F5Networks",
@@ -77,7 +77,7 @@
7777
"viewsWelcome": [
7878
{
7979
"view": "nsConfigView",
80-
"contents": "Welome to project-flipper!\nThis project aims to explore the process of breaking down, analyzing and abstracting applications from a Citrix NetScaler config/archive (.conf/.tgz)\n- Phase 1: Unpack config\n- Phase 2: Abstract Applications (current)\n- Phase 3: Diagnostics (pending)\n- Phase 4: Conversion Outputs (tmos/xc?/nginx?)\nImport a Citrix ADC/NS config/archive to continue.\n[Import .conf/.tgz from local file](command:f5-flipper.cfgExplore)\n[Load Example/Test NS Config](command:f5-flipper.cfgExploreTest)\n[Repo](https://github.com/f5devcentral/vscode-f5-flipper)"
80+
"contents": "Welome to project-flipper!\nThis project aims to explore the process of breaking down, analyzing and abstracting applications from a Citrix NetScaler config/archive (.conf/.tgz)\n- Phase 1: Unpack config\n- Phase 2: Abstract Applications\n- Phase 3: Diagnostics\n- Phase 4: Conversion Outputs (tmos/as3)\nImport a Citrix ADC/NS config/archive to continue.\n[Import .conf/.tgz from local file](command:f5-flipper.cfgExplore)\n[Load Example/Test NS Config](command:f5-flipper.cfgExploreTest)\n[Repo](https://github.com/f5devcentral/vscode-f5-flipper)\n\nThank you for checking out this tool. Please provide feedback through github issues\n[Open Issue/Bug](https://github.com/f5devcentral/vscode-f5-flipper/issues/new/choose)"
8181
}
8282
],
8383
"commands": [

src/CitrixADC.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ export default class ADC extends EventEmitter {
246246
.catch(err => {
247247
logger.error(err)
248248
});
249-
250-
// dig each 'add lb vserver', but check for existing?
251-
await digLbVserver(this.configObjectArry, this.rx)
249+
250+
// dig each 'add lb vserver', but check for existing?
251+
await digLbVserver(this.configObjectArry, this.rx)
252252
.then(lbApps => {
253253
// add the lb apps to the main app array
254254
apps.push(...lbApps as AdcApp[])

src/codeLens.ts

+23-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
workspace
1313
} from "vscode";
1414
import { ext } from "./extensionVariables";
15+
import { globSync } from 'glob';
1516

1617

1718

@@ -82,7 +83,7 @@ export class NsCodeLensProvider implements CodeLensProvider {
8283
command: 'f5-flipper.convert2AS3',
8384
title: 'Convert to AS3',
8485
tooltip: 'click to convert to AS3',
85-
arguments: [document]
86+
arguments: [{document, template: 'ns/http'}]
8687
}
8788
)
8889
);
@@ -99,6 +100,27 @@ export class NsCodeLensProvider implements CodeLensProvider {
99100
)
100101
);
101102

103+
// get template directory /templates/as3
104+
// list file names *.yaml
105+
// push a codeLens per file as3/tcp, as3/http, as3/https
106+
const baseDir = path.join(__dirname, '..', 'templates', 'as3');
107+
let filesPaths: string[] = globSync('*.yaml', { cwd: baseDir })
108+
109+
filesPaths.forEach((template) => {
110+
template = template.split('.')[0]
111+
const title = path.join('as3', template);
112+
const thirdLine = new Range(2, 0, 2, 0);
113+
codeLens.push(
114+
new CodeLens(
115+
secondLine,
116+
{
117+
command: 'f5-flipper.convert2AS3',
118+
title,
119+
arguments: [{document, template: title}]
120+
}
121+
)
122+
);
123+
})
102124
}
103125

104126

src/digCsVserver.ts

+22-12
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function digCsVservers(coa: AdcConfObj, rx: AdcRegExTree) {
2020
const apps: AdcApp[] = [];
2121

2222
// if there are no cs vservers, then return the empty array
23-
if(!coa.add?.cs?.vserver) return apps;
23+
if (!coa.add?.cs?.vserver) return apps;
2424

2525
await Promise.all(coa.add?.cs?.vserver?.map(async vServ => {
2626

@@ -51,8 +51,10 @@ export async function digCsVservers(coa: AdcConfObj, rx: AdcRegExTree) {
5151
}
5252

5353
// dig 'bind cs vservers'
54-
coa.bind?.cs?.vserver?.filter(el => el.startsWith(app.name))
55-
.forEach(x => {
54+
const csVservers = coa.bind?.cs?.vserver?.filter(el => el.startsWith(app.name))
55+
if (csVservers?.length > 0) {
56+
57+
for await (const x of csVservers) {
5658

5759
const parent = 'bind cs vserver';
5860
const originalString = parent + ' ' + x;
@@ -74,7 +76,8 @@ export async function digCsVservers(coa: AdcConfObj, rx: AdcRegExTree) {
7476
app.bindings["-lbvserver"].push(opts['-lbvserver'])
7577

7678
}
77-
})
79+
}
80+
}
7881

7982
await digAddCsPolicys(app, coa, rx);
8083
digSslBinding(app, coa, rx);
@@ -87,11 +90,14 @@ export async function digCsVservers(coa: AdcConfObj, rx: AdcRegExTree) {
8790
export async function digAddCsPolicys(app: AdcApp, obj: AdcConfObj, rx: AdcRegExTree) {
8891

8992
// loop through each policy attached to this app
90-
app.bindings["-policyName"].forEach(policy => {
93+
for await (const policy of app.bindings["-policyName"]) {
9194

9295
// filter out all the policies with this name
93-
obj.add?.cs?.policy?.filter(x => x.startsWith(policy['-policyName']))
94-
.forEach(x => {
96+
const csPolicies = obj.add?.cs?.policy?.filter(x => x.startsWith(policy['-policyName']))
97+
98+
if (csPolicies?.length > 0) {
99+
100+
for await (const x of csPolicies) {
95101
const parent = 'add cs policy';
96102
const originalString = parent + ' ' + x;
97103
app.lines.push(originalString);
@@ -112,8 +118,10 @@ export async function digAddCsPolicys(app: AdcApp, obj: AdcConfObj, rx: AdcRegEx
112118
if (opts['-action']) {
113119
// 'add cs action <name> '
114120
// get the action config
115-
obj.add.cs.action.filter(el => el.startsWith(opts['-action']))
116-
.forEach(x => {
121+
const csAction = obj.add?.cs?.action?.filter(el => el.startsWith(opts['-action']))
122+
if (csAction?.length > 0) {
123+
124+
for await (const x of csAction) {
117125
const parent = 'add cs action';
118126
const originalString = parent + ' ' + x;
119127
app.lines.push(originalString)
@@ -128,9 +136,11 @@ export async function digAddCsPolicys(app: AdcApp, obj: AdcConfObj, rx: AdcRegEx
128136
app.csPolicyActions = [];
129137
}
130138
app.csPolicyActions.push(opts)
131-
})
139+
}
140+
}
132141
}
133-
})
142+
}
143+
}
134144

135145
//todo: dig appflow referenced by -policyName
136146
// 'add appflow policy <name>' -> 'add appflow action <name>' -> 'add appflow collector <name>'
@@ -197,7 +207,7 @@ export async function digAddCsPolicys(app: AdcApp, obj: AdcConfObj, rx: AdcRegEx
197207
})
198208
}
199209
})
200-
})
210+
}
201211

202212
return;
203213
}

0 commit comments

Comments
 (0)