ddelnano / terraform-provider-mikrotik

MIT License
126 stars 28 forks source link

wireguard endpoint port and keepalives don't work #221

Open czirakim opened 4 months ago

czirakim commented 4 months ago

System version 7.13.4 provider version = "0.15.0" ╷ │ Error: Provider produced inconsistent result after apply │ │ When applying changes to mikrotik_interface_wireguard_peer.default, provider "provider[\"registry.terraform.io/ddelnano/mikrotik\"]" produced an unexpected new │ value: .endpoint_port: was cty.NumberIntVal(13251), but now cty.NumberIntVal(0). │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker. ╵ ╷ │ Error: Provider produced inconsistent result after apply │ │ When applying changes to mikrotik_interface_wireguard_peer.default, provider "provider[\"registry.terraform.io/ddelnano/mikrotik\"]" produced an unexpected new │ value: .persistent_keepalive: was cty.NumberIntVal(20), but now cty.NumberIntVal(0). │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker.

maksym-nazarenko commented 4 months ago

@czirakim thank you for reporting this issue.

@ddelnano It looks like the client marshaling function does not handle all types we are using in client structs - in this case it's int64. I'll create separate issue for the generic problem, but for now just add only int64.

ermyril commented 6 days ago

Hi, @maksym-nazarenko, It seems like persistent_keepalive still doesn't work for some reason The version of a provider is from the current master branch (5dc204ed0)

  # module.wireguard.mikrotik_interface_wireguard_peer.wg_iceland_peers[0] will be updated in-place
  ~ resource "mikrotik_interface_wireguard_peer" "wg_iceland_peers" {
        id                   = "*4"
      ~ persistent_keepalive = 0 -> 25
        # (8 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.wireguard.mikrotik_interface_wireguard_peer.wg_iceland_peers[0]: Modifying... [id=*4]
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.wireguard.mikrotik_interface_wireguard_peer.wg_iceland_peers[0], provider
│ "module.wireguard.provider[\"registry.terraform.io/ddelnano/mikrotik\"]" produced an unexpected new value: .persistent_keepalive: was cty.NumberIntVal(25),
│ but now cty.NumberIntVal(0).
maksym-nazarenko commented 6 days ago

hi @ermyril thank you for bringing this the Duration handling in RouterOS is not always clear to me (in documentation it is Integer in seconds but in fact it is very similar to Go's Duration with suffixes)