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 13 forks source link

andle wildcards in monitor destinations #73

Closed lukaszbrzosko closed 2 years ago

lukaszbrzosko commented 2 years ago

Environment

Summary

If there is no Ip address given in alias for tcp ( and maybe others) monitor but port is defined there is a problem with convertions.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config:
    ltm monitor tcp /Common/test_target {
    adaptive disabled
    defaults-from /Common/tcp
    destination *.514
    interval 5
    ip-dscp 0
    recv none
    recv-disable none
    send none
    time-until-up 0
    timeout 3
    }

    Converted to:

    {
    "class": "ADC",
    "schemaVersion": "3.31.0",
    "id": "urn:uuid:52857963-00c9-4a7b-b198-5e616808e7fe",
    "label": "Converted Declaration",
    "remark": "Auto-generated by AS3 Config Converter",
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "test_target": {
                "adaptive": false,
                "dscp": 0,
                "receive": "",
                "receiveDown": "",
                "send": "",
                "timeout": 3,
                "class": "Monitor",
                "monitorType": "tcp",
                "targetAddress": "*.514",
                "transparent": false,
                "reverse": false
            }
        }
    }
    }              

//////////////////OR :

ltm monitor tcp /Common/test_target {
    adaptive disabled
    defaults-from /Common/tcp
    destination *:514
    interval 5
    ip-dscp 0
    recv none
    recv-disable none
    send none
    time-until-up 0
    timeout 3
}

Converted to:

{
    "class": "ADC",
    "schemaVersion": "3.31.0",
    "id": "urn:uuid:bcc33d69-c4b2-49ef-b1cd-b604ceb2f6fa",
    "label": "Converted Declaration",
    "remark": "Auto-generated by AS3 Config Converter",
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "test_target": {
                "adaptive": false,
                "dscp": 0,
                "receive": "",
                "receiveDown": "",
                "send": "",
                "timeout": 3,
                "class": "Monitor",
                "monitorType": "tcp",
                "targetPort": 0,
                "transparent": false,
                "reverse": false
            }
        }
    }
}%
  1. Observe the following error message once try to deploy first covnersion:
    {
    "code": 422,
    "errors": [
    "/Common/Shared/test_target/targetAddress: should match format \"f5ip\""
    ],
    "declarationFullId": "",
    "message": "declaration is invalid"
    }

    Second one result in port 0 (in fact all ports) instead of desired one.

Expected Behavior

Properly convert to target address and target port.

Actual Behavior

Wrong logic in conversion for wildcard IP and specific port given.

sschadwick commented 2 years ago

Issue forwarded to AS3 team: https://github.com/F5Networks/f5-appsvcs-extension/issues/528