octodns / octodns-constellix

Constellix DNS provider for octoDNS
MIT License
1 stars 4 forks source link

dynamic: constellix provider implicit fallback leads to change for every run #8

Closed istr closed 2 years ago

istr commented 2 years ago

The optional fallback for the global value(s) in a dynamic setup seems to be set implicitly in the constellix provider. Expected behavior for the failing test-case: no fallback will be set / existing fallback entries will be removed. Observed behavior for the failing test-case: fallback "eu" is set implicitly, so there is always a difference between config.yml (fallback: None) and constellix provider (fallback: eu) that leads to an update on every run.

My suspicion is, that the implementation uses the fallback mechanism to construct the necessary "World filter", instead of using the given values for the record. A test case that provides only pools with geo (no catch-all pool) fails as well.

My expectation would be that a setup without a catch-all pool constructs the "world" filter from the values and does not set fallback values on each pool.

As per documentation the "global" fallback constructed from the values is handled differently (unmonitored) than a catch-all pool used as a fallback. From that I conclude that these cases should be handled differently. I would expect all following test cases to work and to construct the "world" fallback from the values in any case. When not configured, implicit fallback entries should not be generated.

Working test-case (all pools set a fallback, the fallback pool is a catch-all pool):

cdn:
  dynamic:
    pools:
      apac:
        fallback: eu
        values:
          - status: up
            value: 199.254.199.55
      eu:
        values:
          - status: up
            value: 185.172.148.128
          - status: up
            value: 185.172.148.132
      eu_E:
        fallback: eu
        values:
          - status: up
            value: 137.74.0.47
      eu_SW:
        fallback: eu
        values:
          - status: up
            value: 185.172.150.128
      eu_ch:
        fallback: eu
        values:
          - status: up
            value: 94.126.16.223
      eu_fr:
        fallback: eu
        values:
          - status: up
            value: 89.44.9.58
      eu_nl:
        fallback: eu
        values:
          - status: up
            value: 185.172.149.128
          - status: up
            value: 185.172.149.132
      eu_uk:
        fallback: eu
        values:
          - status: up
            value: 68.70.192.128
      me:
        fallback: eu
        values:
          - status: up
            value: 185.191.204.234
      na:
        fallback: eu
        values:
          - status: up
            value: 51.222.8.159
      ocean:
        fallback: eu
        values:
          - status: up
            value: 103.231.91.78
    rules:
      - geos:
        - AS
        pool: apac
      - pool: eu
      - geos:
        - EU-UA
        - EU-PL
        - EU-RU
        - EU-LT
        - EU-LV
        - EU-EE
        pool: eu_E
      - geos:
        - EU-AD
        - EU-ES
        - EU-PT
        pool: eu_SW
      - geos:
        - EU-CH
        pool: eu_ch
      - geos:
        - EU-FR
        - EU-MC
        pool: eu_fr
      - geos:
        - EU-NL
        pool: eu_nl
      - geos:
        - EU-GB
        pool: eu_uk
      - geos:
        - AF
        - AS-IL
        - AS-TR
        pool: me
      - geos:
        - NA
        - SA
        pool: na
      - geos:
        - OC
        pool: ocean
  ttl: 60
  type: A
  values:
    - 185.172.148.128
    - 185.172.148.132

Failing test-case (a catch-all pool is given, an implicit fallback is constructed for all other pools and leads to a mismatch between constellix and config):

cdn:
  dynamic:
    pools:
      apac:
        values:
          - status: up
            value: 199.254.199.55
      eu:
        values:
          - status: up
            value: 185.172.148.128
          - status: up
            value: 185.172.148.132
      eu_E:
        values:
          - status: up
            value: 137.74.0.47
      eu_SW:
        values:
          - status: up
            value: 185.172.150.128
      eu_ch:
        values:
          - status: up
            value: 94.126.16.223
      eu_fr:
        values:
          - status: up
            value: 89.44.9.58
      eu_nl:
        values:
          - status: up
            value: 185.172.149.128
          - status: up
            value: 185.172.149.132
      eu_uk:
        values:
          - status: up
            value: 68.70.192.128
      me:
        values:
          - status: up
            value: 185.191.204.234
      na:
        values:
          - status: up
            value: 51.222.8.159
      ocean:
        values:
          - status: up
            value: 103.231.91.78
    rules:
      - geos:
        - AS
        pool: apac
      - pool: eu
      - geos:
        - EU-UA
        - EU-PL
        - EU-RU
        - EU-LT
        - EU-LV
        - EU-EE
        pool: eu_E
      - geos:
        - EU-AD
        - EU-ES
        - EU-PT
        pool: eu_SW
      - geos:
        - EU-CH
        pool: eu_ch
      - geos:
        - EU-FR
        - EU-MC
        pool: eu_fr
      - geos:
        - EU-NL
        pool: eu_nl
      - geos:
        - EU-GB
        pool: eu_uk
      - geos:
        - AF
        - AS-IL
        - AS-TR
        pool: me
      - geos:
        - NA
        - SA
        pool: na
      - geos:
        - OC
        pool: ocean
  ttl: 60
  type: A
  values:
    - 185.172.148.128
    - 185.172.148.132

Failing test-case (no catch-all pool is given, the API request fails, because no "World" record is constructed at all):

cdn:
  dynamic:
    pools:
      apac:
        values:
          - status: up
            value: 199.254.199.55
      eu_E:
        values:
          - status: up
            value: 137.74.0.47
      eu_SW:
        values:
          - status: up
            value: 185.172.150.128
      eu_ch:
        values:
          - status: up
            value: 94.126.16.223
      eu_fr:
        values:
          - status: up
            value: 89.44.9.58
      eu_nl:
        values:
          - status: up
            value: 185.172.149.128
          - status: up
            value: 185.172.149.132
      eu_uk:
        values:
          - status: up
            value: 68.70.192.128
      me:
        values:
          - status: up
            value: 185.191.204.234
      na:
        values:
          - status: up
            value: 51.222.8.159
      ocean:
        values:
          - status: up
            value: 103.231.91.78
    rules:
      - geos:
        - AS
        pool: apac
      - geos:
        - EU-UA
        - EU-PL
        - EU-RU
        - EU-LT
        - EU-LV
        - EU-EE
        pool: eu_E
      - geos:
        - EU-AD
        - EU-ES
        - EU-PT
        pool: eu_SW
      - geos:
        - EU-CH
        pool: eu_ch
      - geos:
        - EU-FR
        - EU-MC
        pool: eu_fr
      - geos:
        - EU-NL
        pool: eu_nl
      - geos:
        - EU-GB
        pool: eu_uk
      - geos:
        - AF
        - AS-IL
        - AS-TR
        pool: me
      - geos:
        - NA
        - SA
        pool: na
      - geos:
        - OC
        pool: ocean
  ttl: 60
  type: A
  values:
    - 185.172.148.128
    - 185.172.148.132

Error message for this test-case:

octodns.provider.constellix.ConstellixClientBadRequest:
  - Please create a World (Default) IP Filter for the record “cdn” first, before you attempt to apply the desired IP Filter. The World (Default) record will only be used if no corresponding Filter or Proximity records are matched.
istr commented 2 years ago

@ross This issue should be transferred to https://github.com/octodns/octodns-constellix now.

ross commented 2 years ago

@ross This issue should be transferred to https://github.com/octodns/octodns-constellix now.

👍. I have a TODO on my list to go through after all the extractions and move all the issues that now belong in module-specific repos.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.