Skip to content

Commit

Permalink
Merge from 1.24.0 to main (squashed)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaloney committed Sep 30, 2022
1 parent 3619ca1 commit e6f9fce
Show file tree
Hide file tree
Showing 49 changed files with 3,891 additions and 1,863 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ create_docs:
tags: [cm-official-docker-executor]

build_image:
image: $ATG_IMG_REGISTRY_URL/docker:20
image: $ATG_IMG_REGISTRY_URL/node:14-buster
stage: build
needs: [fetch_dependencies]
script:
Expand Down Expand Up @@ -125,7 +125,7 @@ docker_test:
- if [ $DO_WC -eq 0 ] ; then exit 1; fi;
- if [ $ACC_WC -eq 0 ] ; then exit 1; fi;
needs: ["build_image"]
tags: [acc-test-docker-executor]
tags: [automation-toolchain-docker-executor]

# Coverage reports
pages:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog
Changes to this project are documented in this file.

## 1.24.0

## Added

## Fixed
- CHARON-758: Don't delete redirect http lonely service
- CHARON-759: 'ERROR undefined' for ACC if one of the system default iRules is attached to the Virtual Server

## Changed
- CHARON-648: Remove profiles of service objects that are default profiles of the service
- CHARON-730: ([GitHub Issue 91](https://github.com/f5devcentral/f5-automation-config-converter/issues/91)):
When converting TMOS to AS3, servers in the pool do not show their server names

## Removed

## 1.23.0

## Added
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ WORKDIR /app

COPY . .
RUN npm ci --omit=dev
RUN rm -r dependencies
RUN --mount=type=secret,id=TEEM_KEY cp /run/secrets/TEEM_KEY .
RUN chown -R node:node .

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

# F5 Automation Config Converter (ACC)
# F5 BIG-IP Automation Config Converter (BIG-IP ACC)

<a href="https://clouddocs.f5.com/products/extensions/f5-automation-config-converter/latest/">
<img src="docs/_static/ACC_Robot.svg" alt="F5 ACC" width="200">
Expand All @@ -23,7 +23,7 @@

## Introduction

F5 Automation Config Converter (ACC) is an app written in Node.js that converts a BIG-IP configuration into an AS3 declaration, distributed as an easy-to-use docker image.
F5 BIG-IP Automation Config Converter (BIG-IP ACC) is an app written in Node.js that converts a BIG-IP configuration into an AS3 declaration, distributed as an easy-to-use docker image.



Expand Down
10 changes: 5 additions & 5 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
## Support Information

F5 Automation Config Converter (ACC) is community-supported.
F5 Automation Config Converter (BIG-IP ACC) is community-supported.

**ACC Software Lifecycle:**
**BIG-IP ACC Software Lifecycle:**

ACC releases are regularly delivered on a 6-week basis. We will keep the latest three releases available. Deprecated releases are available upon request.
BIG-IP ACC releases are regularly delivered on a 6-week basis. We will keep the latest three releases available. Deprecated releases are available upon request.


Recent Releases

| Software Version | Release Date |
| ---------------- | ------------------- |
| 1.24.0 | 04-Oct-2022 |
| 1.23.0 | 23-Aug-2022 |
| 1.22.0 | 15-Jul-2022 |
| 1.21.0 | 31-May-2022 |




Expand All @@ -23,6 +22,7 @@ Deprecated Releases

| Software Version | Release Date |
| ---------------- | ------------------- |
| 1.21.0 | 31-May-2022 |
| 1.20.0 | 19-Apr-2022 |
| 1.19.2 | 25-Mar-2022 |
| 1.19.1 | 21-Mar-2022 |
Expand Down
8 changes: 0 additions & 8 deletions autotoolDeps/AS3/src/lib/adcParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const parserFormats = require('./adcParserFormats');
const parserKeywords = require('./adcParserKeywords');
const myValidator = require('./validator');
const util = require('./util/util');
const components = require('./adcParserComponents');
const PostProcessor = require('./postProcessor');
const PostValidator = require('./postValidator');
const Config = require('./config');
Expand Down Expand Up @@ -183,7 +182,6 @@ class As3Parser {
previousDeclaration: {}
};
this.options = Object.assign(this.options, defaultOpts, options);
this.components = [];
this.fetches = [];

if (typeof this.validator === 'undefined') {
Expand Down Expand Up @@ -366,12 +364,6 @@ function as3Digest(declaration) {
copySecrets(declaration, this.options.baseDeclaration);
}
})
.then(() => {
if (this.deviceType === DEVICE_TYPES.BIG_IQ) {
return Promise.resolve();
}
return components.handleComponents(this.context, this.components);
})
.then(() => results)
.catch((e) => {
if (e instanceof AJV.ValidationError) {
Expand Down
238 changes: 0 additions & 238 deletions autotoolDeps/AS3/src/lib/adcParserKeywords.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

'use strict';

const util = require('./util/util');
const extractUtil = require('./util/extractUtil');
const expandUtil = require('./util/expandUtil');

const DEVICE_TYPES = require('./constants').DEVICE_TYPES;

const keywords = [
{
name: 'f5PostProcess',
Expand Down Expand Up @@ -67,238 +61,6 @@ const keywords = [
}
})
},
{
// custom keyword 'f5bigComponent' tests whether
// a named BIG-IP configuration component such as
// "/Common/fubar" of the required type such as
// "ltm pool" actually exists. "Type" in this
// case refers to TMOS module. In TMSH and TMGUI
// the module is always specified separately from
// the component name, so different components
// may have identical names. That means we have
// to pair up the module from the schema with the
// component name from the declaration before we
// can check whether the desired component really
// exists on the target BIG-IP. Worse, in some
// cases (like monitors) we are supposed to know
// the sub-module before we can list a component,
// despite the component name being unique across
// sub-modules. However, the customer does not
// specify sub-component and it would be very slow
// to probe all the sub-modules looking for some
// component. We use a sneaky tactic to avoid
// that drudgery: we attempt to create a component
// rather than trying to list an existing one, and
// then look for the "already exists" error
//
// If special property "scratch" exists in the root
// of the document this function becomes a no-op
//
name: 'f5bigComponent',
definition: (that) => ({
type: 'object',
errors: true,
modifying: true,
metaSchema: {
type: 'string',
pattern: '^(asm policy|((query|probe) ([^\\x20]+\\x20)*[^\\x20]+))?$'
},
validate(schema, data, parentSchema, dataPath, parentData, pptyName, rootData) {
if (typeof rootData.scratch !== 'undefined'
|| util.getDeepValue(that.context, 'target.deviceType') === DEVICE_TYPES.BIG_IQ) {
// don't want to check components right now
// e.g. running on BIG-IQ or expanding defaults in old decl on BIG-IP
return true;
}

// here 'mySchema' is like "query ltm pool" or
// "probe ltm monitor icmp" or "asm policy"
// and 'data' is component name like
// "/Common/fubar" or "http-tunnel" or even
// route-domain number. Most component names
// should be absolute and that is enforced in
// the schema using format=f5bigip, but some
// components like tunnels lack pathnames

if ((schema === '') || ((typeof data === 'object') && ((data === null)
|| !Object.prototype.hasOwnProperty.call(data, 'bigip')))) {
return true; // well this is easy
}

// component name
const testName = ((typeof data === 'object') ? data.bigip.replace(/["]+/g, '') : data).toString();

/** ***
log.debug("will check if " + test_name + " exists in " +
mySchema + " for " + data_path);
**** */

const elems = schema.split('\x20');

const tactic = elems.shift();

const method = (tactic === 'probe') ? 'POST' : 'GET';

const isAsm = (elems[0] === 'asm');

let testUrl = '/mgmt/tm/';

// Reminder to change logic if ASM support is expanded
if (isAsm && elems[1] !== 'policy') {
throw new Error(`asm ${elems[1]} is not currently supported`);
}

if (isAsm) {
testUrl = testUrl.concat('asm/policies');
} else {
testUrl = testUrl.concat(elems.join('/'));
}

let payload;

if (method === 'GET') {
if (!isAsm) {
testUrl = `${testUrl}/${testName.replace(/\x2f/g, '~')}`;
}
} else {
payload = JSON.stringify({ name: testName });
}

if (typeof data.bigip === 'string' && data.bigip.includes(' ')
&& !data.bigip.includes('"')) {
data.bigip = `"${data.bigip}"`;
}

const component = that.components.find((comp) => comp.testOptions.path === testUrl);
if (!component) {
that.components.push({
data,
dataPaths: [dataPath],
isAsm,
testName,
testOptions: {
path: testUrl,
method,
send: payload,
crude: true
}
});
} else {
component.dataPaths.push(dataPath);
}

return true;
}
})
},
{
// custom keyword 'f5expand' replaces backquote
// escapes in strings in declarations
//
// If special property "scratch" exists in the root
// of the document this function becomes a no-op.
//
name: 'f5expand',
definition: (that) => ({
// type: "string", -- we will manage within
errors: true,
modifying: true,
metaSchema: {
type: ['boolean', 'object'],
properties: {
when: {
type: 'string',
minLength: 1
},
to: {
type: 'string',
minLength: 1
}
}
},
compile(schema) {
const mySchema = schema;

return function f5expand(data, dataPath, parentData, pptyName, rootData) {
if (typeof rootData.scratch !== 'undefined') {
// don't want to expand escapes right now
// (probably just expanding defaults in old decl)
return true;
}

if (typeof data !== 'string') {
// shucks, we can only expand a string! (We
// check here instead of using 'type' option
// with addKeyword because ajv looks at
// object-type only once, so if f5PostProcess(fetch) gets
// us a string from an F5string url or wherever,
// thus replacing 'data' object with string,
// ajv won't know about that, so it wouldn't
// call us if options contained type:"string"
return true;
}

// The BIG-IQ should skip this keyword as it should NOT modify the declaration
if (util.getDeepValue(that.context, 'target.deviceType') === DEVICE_TYPES.BIG_IQ) {
return true;
}

f5expand.errors = [];
const myerror = {
keyword: 'f5expand',
params: {}
};

// schema property "when" (if any) is AS3 pointer to
// boolean value in declaration that says whether
// or not target should be expanded
const rv = { now: mySchema.toString() };
if (Object.prototype.hasOwnProperty.call(mySchema, 'when') && (mySchema.when !== '')) {
try {
extractUtil.getAs3Object(
mySchema.when,
dataPath,
parentData,
rootData,
false,
parentData,
pptyName,
'string',
rv,
'now'
);
} catch (e) {
myerror.message = `${mySchema.when} ${e.message}`;
f5expand.errors.push(myerror);
return false;
}
}

// rv.now is string, not boolean
if (rv.now !== 'true') {
return true; // success (no expansion wanted)
}

// mySchema property "to" (if any) names another
// property of 'parent_data' we should put expansion
// into, rather than default 'ppty_name'
if (Object.prototype.hasOwnProperty.call(mySchema, 'to') && (mySchema.to !== '')) {
pptyName = mySchema.to;
}

try {
expandUtil.backquoteExpand(data, dataPath, parentData, rootData, parentData, pptyName);
} catch (e) {
myerror.message = e.message;
f5expand.errors.push(myerror);
return false;
}

return true;
};
}
})
},
/*
* Prioritizes aliased keyword if exists, otherwise maps the original property value to
* the missing alias key. The original property is deleted in either case.
Expand Down
Loading

0 comments on commit e6f9fce

Please sign in to comment.