f5devcentral / f5-automation-config-converter

Convert BIG-IP configs to AS3 and DO declarations
https://clouddocs.f5.com/products/extensions/f5-automation-config-converter/latest/
Apache License 2.0
35 stars 14 forks source link

AS3 Conversion Bug Declaration shortened to Dec #83

Closed mwardbopp closed 2 years ago

mwardbopp commented 2 years ago

Environment

Summary

When converting TMOS config w/ ACC I get this:

"$schema": "https://raw.githubusercontent.com/F5Networks/f5-appsvcs-extension/master/schema/latest/as3-schema.json",
"class": "AS3",
"dec": {

instead of

"$schema": "https://raw.githubusercontent.com/F5Networks/f5-appsvcs-extension/master/schema/latest/as3-schema.json",
"class": "AS3",
"declaration": {

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config: ltm virtual /Common/test-vs { creation-time 2022-02-14:05:39:44 destination /Common/10.10.10.10:80 ip-protocol tcp last-modified-time 2022-02-14:05:39:44 mask 255.255.255.255 pool /Common/test-pool profiles { /Common/serverssl-insecure-compatible { 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 pool /Common/test-pool { members { /Common/f5.com:443 { address 107.162.162.40 } } monitor /Common/gateway_icmp } ltm node /Common/f5.com { address 107.162.162.40 }
  2. Conversion: { "$schema": "https://raw.githubusercontent.com/F5Networks/f5-appsvcs-extension/master/schema/latest/as3-schema.json", "class": "AS3", "dec": { "class": "ADC", "schemaVersion": "3.34.0", "id": "urn:uuid:534d5b96-bf64-480d-b747-059d02c8b28a", "label": "Converted Declaration", "remark": "Generated by Automation Config Converter", "Common": { "class": "Tenant", "Shared": { "class": "Application", "template": "shared", "test-vs": { "layer4": "tcp", "pool": "test-pool", "translateServerAddress": true, "translateServerPort": true, "class": "Service_TCP", "clientTLS": { "bigip": "/Common/serverssl-insecure-compatible" }, "profileTCP": { "bigip": "/Common/tcp" }, "virtualAddresses": [ "10.10.10.10" ], "virtualPort": 80, "persistenceMethods": [], "snat": "auto" }, "test-pool": { "members": [ { "addressDiscovery": "static", "servicePort": 443, "serverAddresses": [ "107.162.162.40" ], "shareNodes": true } ], "monitors": [ { "bigip": "/Common/gateway_icmp" } ], "class": "Pool" } } } } }
DumpySquare commented 2 years ago

this bug affects the vscode extension, which looks for the "declaration" object to inject the atc agent and does successfully process with AS3. AS3 post error below;

{
    "id": "22db6901-ed06-4ebf-aeef-397b94dc479b",
    "results": [
        {
            "message": "for action \"deploy\", a declaration is required.",
            "code": 400
        }
    ],
    "declaration": {}
}
DumpySquare commented 2 years ago

With the help of @p-semenov-f5, we found that this is happening in vscode. I will have a fix out shortly.

Tracked here: https://github.com/f5devcentral/f5-conx-core/issues/20

Will close everything once fixed

DumpySquare commented 2 years ago

fixed in vscode-f5 pending v3.6.1 release. please close