crossplane-contrib / provider-upjet-gcp

GCP Provider for Crossplane.
https://marketplace.upbound.io/providers/upbound/provider-family-gcp/
Apache License 2.0
68 stars 75 forks source link

[Bug]: Cloud Function creation fails with `SetNew only operates on computed keys - region is not one` #575

Closed trampfox closed 1 month ago

trampfox commented 4 months ago

Is there an existing issue for this?

Affected Resource(s)

Resource MRs required to reproduce the bug

apiVersion: cloudfunctions.gcp.upbound.io/v1beta1
kind: Function
metadata:
  labels:
    testing.upbound.io/example-name: pubsub-cf
  name: pubsub-cf
spec:
  forProvider:
    availableMemoryMb: 128
    description: Crossplane Cloud Function
    entryPoint: helloPubSub
    region: europe-west1
    runtime: nodejs22
    sourceArchiveBucket: ***-cloud-function-sources
    sourceArchiveObject: ***_event-trigger.zip
  providerConfigRef:
    name: ***

I managed to reproduce the same issue using the cloudfunctions example manifest.

Steps to Reproduce

Apply the provided manifest by changing the sourceArchiveBucket and sourceArchiveObject values to a valid test bucket/object.

What happened?

The external Cloud Function has not been created and I see the following error in the resource status

    Status:
      At Provider:
      Conditions:
        Last Transition Time: 2024-07-16T13:53:30Z
        Message:
          observe failed:
            cannot compute the instance diff:
              failed to get *terraform.InstanceDiff: SetNew only operates on computed keys - region is not one
        Reason: ReconcileError
        Status: False
        Type: Synced

Relevant Error Output Snippet

No response

Crossplane Version

1.15.0

Provider Version

provider-gcp-cloudfunctions:v1.5.0

Kubernetes Version

v1.28.10

Kubernetes Distribution

GKE

Additional Info

The issue is similar to the one reported in #472 and solved by #490, but the switch to the new API was not done for the Cloud Functions resources

Iapachonp commented 2 months ago

hello i am having the same issue, i thought that the new 1.7.0 version will fix it but no, is there any work around for this i am blocked by this and the only solution i see it is to rollback to a stable version.