Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of v1beta2 resources takes 10m / poll-interval #460

Open
ytsarev opened this issue Jan 16, 2025 · 0 comments
Open

Import of v1beta2 resources takes 10m / poll-interval #460

ytsarev opened this issue Jan 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ytsarev
Copy link
Member

ytsarev commented Jan 16, 2025

What happened?

Initially observed during the implementation of upbound/function-azresourcegraph#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
@ytsarev ytsarev added the bug Something isn't working label Jan 16, 2025
ytsarev added a commit to ytsarev/function-azresourcegraph that referenced this issue Jan 16, 2025
Avoid crossplane/upjet#460

Signed-off-by: Yury Tsarev <yury@upbound.io>
ytsarev added a commit to upbound/function-azresourcegraph that referenced this issue Jan 16, 2025
Avoid crossplane/upjet#460

Signed-off-by: Yury Tsarev <yury@upbound.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant