terraform-routeros / terraform-provider-routeros

Terraform Provider for Mikrotik RouterOS
Mozilla Public License 2.0
191 stars 55 forks source link

Field 'dynamic' not found in the schema for routeros_interfaces datasource #550

Closed dsbibby closed 1 month ago

dsbibby commented 1 month ago

Describe the bug routeros_interfaces datasource logs a warning when there are dynamic interfaces present (such as when using CAPsMAN).

for example with this datasource:

data "routeros_interfaces" "wlan_dynamic" {}

And dynamic interfaces present, a plan/apply includes this warning at the end of the run:

│ Warning: Field 'dynamic' not found in the schema
│ 
│   with module.rb_lounge.data.routeros_interfaces.wlan_dynamic,
│   on modules/routerboard/data.tf line 1, in data "routeros_interfaces" "wlan_dynamic":
│    1: data "routeros_interfaces" "wlan_dynamic" {
│ 
│ [MikrotikResourceDataToTerraformDatasource] the field was lost during the Schema development: ▷ 'dynamic': 'true' ◁

To Reproduce

Expected behavior No warnings should be thrown

Debug Information I suspect the reason for this is that the dynamic property only exists on dynamic interfaces in the rest API. static intefaces do not have dynamic = "false" in the REST response. Example (with the tx/rx metrics removed for brevity) below:

 {
    ".about": "channel: 5220/20-Ce/ac/P(14dBm), SSID: Home, CAPsMAN forwarding",
    ".id": "*14",
    "actual-mtu": "1500",
    "default-name": "wlan2",
    "disabled": "true",
    "l2mtu": "1600",
    "link-downs": "0",
    "mac-address": "18:FD:74:87:F3:E7",
    "max-l2mtu": "2290",
    "mtu": "1500",
    "name": "wlan2",
    "running": "false",
    "type": "wlan"
  },
  {
    ".about": "SSID: Guest, CAPsMAN forwarding",
    ".id": "*1B",
    "actual-mtu": "1500",
    "disabled": "true",
    "dynamic": "true",
    "l2mtu": "1600",
    "link-downs": "0",
    "mac-address": "00:00:00:00:00:00",
    "mtu": "1500",
    "name": "wlan3",
    "running": "false",
    "type": "wlan"
  },

Stack Trace N/A

Additional context N/A

vaerh commented 1 month ago

Thanks a lot, fixed!

dsbibby commented 1 month ago

Brilliant, thank you!

vaerh commented 1 month ago

:tada: This issue has been resolved in version 1.61.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: