crossplane-contrib / provider-equinix-metal

DEPRECATED: Use provider-jet-equinix :warning:
https://github.com/crossplane-contrib/provider-jet-equinix
Apache License 2.0
16 stars 8 forks source link

VLAN Assignments do not handle 422 when already assigned #61

Closed displague closed 3 years ago

displague commented 3 years ago

What happened?

A VLAN assignment failed to reach ready/sync after successfully configured the external resource. The provider returns a 422 on subsequent requests to create the VLAN assignment.

$ kubectl describe assignments.ports.metal.equinix.com 
...
Events:
  Type     Reason                        Age                From                                        Message
  ----     ------                        ----               ----                                        -------
  Warning  CannotCreateExternalResource  17m (x9 over 83m)  managed/assignment.ports.metal.equinix.com  cannot create Assignment: POST https://api.equinix.com/metal/v1/ports/64369d8b-fbb8-410b-b38b-aab054f7ff2c/assign: 422 Virtual network 1182 already assigned

These 422 errors should be handled (or the provider or packngo should handle this condition differently https://github.com/packethost/packngo/issues/187.

How can we reproduce it?

Deploy the Device + VLAN + Attachment examples (#60) and kill the provider pod before ready state is reached.

What environment did it happen in?

Crossplane version: XP 1.2 / EM v0.7.0

displague commented 3 years ago

Fixed in v0.0.8