crossplane-contrib / provider-upjet-gcp

Official GCP Provider for Crossplane by Upbound.
Apache License 2.0
64 stars 71 forks source link

event arc cannot refer the v2 version of cloud run #313

Closed bhismnarayan closed 5 months ago

bhismnarayan commented 1 year ago

When using event arc to refer to v2 version of cloud run the provider by default tries to find v1 version of cloud run Here is the composition used

- name: eventarc-trigger
      base:
        apiVersion: eventarc.gcp.upbound.io/v1beta1
        kind: Trigger
        metadata:
          name: #patch-me
        spec:
          forProvider:
            serviceAccount: #patch-me
            destination:
              - cloudRunService:
                  - region: #patch-me
                    serviceRef:
                      name: #patchme
            location: #patch-me
            matchingCriteria:
              - attribute: type
                value: google.cloud.pubsub.topic.v1.messagePublished
          providerConfigRef:
            name: default      
      patches:
        - fromFieldPath: spec.claimRef.name
          toFieldPath: metadata.name
        - fromFieldPath: spec.region
          toFieldPath: spec.forProvider.destination[0].cloudRunService[0].region
        - fromFieldPath: spec.claimRef.name
          toFieldPath: spec.forProvider.destination[0].cloudRunService[0].serviceRef.name
          policy:
            fromFieldPath: Required
        - fromFieldPath: spec.region
          toFieldPath: spec.forProvider.location
        - fromFieldPath: status.eventarcTrigger.serviceAccount
          toFieldPath: spec.forProvider.template[0].spec[0].serviceAccountName
          policy:
            fromFieldPath: Required

Below is the error

Status:
  At Provider:
  Conditions:
    Last Transition Time:  2023-06-01T10:16:05Z
    Message:               cannot resolve references: mg.Spec.ForProvider.Destination[i3].CloudRunService[i4].Service: cannot get referenced resource: Service.cloudrun.gcp.upbound.io "example-cloudrun09" not found
    Reason:                ReconcileError
    Status:                False
    Type:                  Synced
Events:
  Type     Reason                           Age               From                                                   Message
  ----     ------                           ----              ----                                                   -------
  Warning  CannotResolveResourceReferences  1s (x7 over 62s)  managed/eventarc.gcp.upbound.io/v1beta1, kind=trigger  cannot resolve references: mg.Spec.ForProvider.Destination[i3].CloudRunService[i4].Service: cannot get referenced resource: Service.cloudrun.gcp.upbound.io "example-cloudrun09" not found

I think we need a way where we refer to v2 version of cloud run as well

turkenf commented 1 year ago

Hi @bhismnarayan,

Thank you for raising this issue, it seems difficult to reproduce the issue with the information you provided. Could you please share the MRs you used with us?

github-actions[bot] commented 5 months ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 5 months ago

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!