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

port does not exist when delete attachment #63

Closed displague closed 3 years ago

displague commented 3 years ago

What happened?

A metal device was deleted before the VLAN Attachment resource was deleted. This resulted in 404s when looking up the device port. If this is ever encountered, it means that the port is no longer in use. We can treat this as a successful port/vlan unassignment.

Here's an example snippet of how the 404 case is handled today:

Status:
  Conditions:
    Last Transition Time:  2021-06-14T19:47:45Z
    Message:               observe failed: port does not exist
    Reason:                ReconcileError
    Status:                False
    Type:                  Synced
    Last Transition Time:  2021-06-14T19:16:30Z
    Reason:                Deleting
    Status:                False
    Type:                  Ready
Events:
  Type     Reason                           Age                 From                                        Message
  ----     ------                           ----                ----                                        -------
  Warning  CannotObserveExternalResource    7s (x15 over 90s)   managed/assignment.ports.metal.equinix.com  port does not exist

A similar situation may be encountered if the port has been reassigned to a different user, in which case a 403 may be returned.

How can we reproduce it?

What environment did it happen in?

Crossplane version: 1.22 EM Provider: 0.0.8

displague commented 3 years ago

What should happen if the attachment is being created (not deleted) and the observation shows that the device / port has been deleted?

hasheddan commented 3 years ago

What should happen if the attachment is being created (not deleted) and the observation shows that the device / port has been deleted?

If I understand this scenario correctly, it should block and report error. If instead of creating in the device in the UI, it was created in Crossplane, we would fail to resolve references.