Import of `v1beta2` resources takes 10m / poll-interval
What happened?
Initially observed during the implementation of https://github.com/upbound/function-azresourcegraph/pull/18
If you follow the https://docs.crossplane.io/latest/guides/import-existing-resources/ procedure and try to import any resource that has the v1beta2 version, the import will get stuck for default poll-interval - 10 minutes by default.
The imported resource will be immediately in the Synced=True state but reach the Ready=True state only in 10 minutes.
$ k get managed
NAME SYNCED READY EXTERNAL-NAME AGE
virtualnetwork.network.azure.upbound.io/platform-ref-azure-vnet True platform-ref-azure-vnet 8m37s
$ k get managed
NAME SYNCED READY EXTERNAL-NAME AGE
virtualnetwork.network.azure.upbound.io/platform-ref-azure-vnet True True platform-ref-azure-vnet 10m
Excerpt from provider log at the moment of import event
2025-01-15T22:08:31Z DEBUG provider-azure Diff detected {"uid": "2f20efea-a281-45be-9a0e-f37b90a501e0", "name": "platform-ref-azure-vnet", "gvk": "network.azure.upbound.io/v1beta1, Kind=VirtualNetwork", "instanceDiff": "*terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{\"tags.%\":*terraform.ResourceAttrDiff{Old:\"1\", New:\"0\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, \"tags.import\":*terraform.ResourceAttrDiff{Old:\"me\", New:\"\", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, RawConfig:cty.NilVal, RawState:cty.NilVal, RawPlan:cty.NilVal, Meta:map[string]interface {}(nil)}"}
2025-01-15T22:08:31Z DEBUG provider-azure Skipping update due to managementPolicies. Reconciliation succeeded {"controller": "managed/network.azure.upbound.io/v1beta1, kind=virtualnetwork", "request": {"name":"platform-ref-azure-vnet"}, "uid": "2f20efea-a281-45be-9a0e-f37b90a501e0", "version": "32022", "external-name": "platform-ref-azure-vnet", "requeue-after": "2025-01-15T22:18:12Z"}
How can we reproduce it?
In additional to VirtualNetwork from the implementation example, I was able to reproduce the issue with azure and aws providers using the following manifests:
apiVersion: network.azure.upbound.io/v1beta2 <-- notice v1beta2 here, in this case import is getting stuck for 10 minutes
kind: Subnet
metadata:
name: service2
annotations:
crossplane.io/external-name: platform-ref-azure-sn
spec:
managementPolicies: ["Observe"]
forProvider:
resourceGroupName: platform-ref-azure-4b29m-2jvwc
virtualNetworkName: platform-ref-azure-vnet
apiVersion: s3.aws.upbound.io/v1beta2
kind: Bucket
metadata:
name: mybucket-random-beta2
annotations:
crossplane.io/external-name: awgs-test-bukkit
spec:
managementPolicies: ["Observe"]
forProvider:
region: us-east-2
At the same time, the v1beta1 derivatives are getting imported immediately.
apiVersion: network.azure.upbound.io/v1beta1 <--- notice v1beta1 here, in this case it works as expected
kind: Subnet
metadata:
name: service
annotations:
crossplane.io/external-name: platform-ref-azure-sn
spec:
managementPolicies: ["Observe"]
forProvider:
resourceGroupName: platform-ref-azure-4b29m-2jvwc
virtualNetworkName: platform-ref-azure-vnet
apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
name: mybucket-random
annotations:
crossplane.io/external-name: awgs-test-bukkit
spec:
managementPolicies: ["Observe"]
forProvider:
region: us-east-2
Hey, just for visibility, I have the exact same issue, described here. However, I'm using the v1beta1 version, so I don't know if the root cause is the same or not. The consequence is definitely the same.
This is most probably casued by this: https://github.com/crossplane/crossplane-runtime/issues/791 I have a PR pending for that, but not sure if it will be merged as-is.