crossplane-contrib / provider-alibaba

Crossplane provider for Alibaba Cloud
Apache License 2.0
50 stars 18 forks source link

[Just a tiny advice] Is it possible to raise lower layer error messages in `PostgreSQLInstance` resource? #29

Closed zzxwill closed 3 years ago

zzxwill commented 4 years ago

What happened?

Followed README.md to make a PoC, I accidentally export Alibaba Cloud ACCESS_KEY_ID with wrong value, it hit the issue Managed resource is not yet bindable, which doesn't sounds useful to me, and it took me a while to locate the root cause. It would be better if it could raise error message from Cloud provider provisioning Cloud resource, like Specified access key is not valid

➜  /Users/zhouzhengxi/Programming/golang/src/github.com/zzxwill/provider-alibaba git:(oss) ✗ k describe PostgreSQLInstance app-postgresql
Name:         app-postgresql
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  database.crossplane.io/v1alpha1
Kind:         PostgreSQLInstance
Metadata:
  Creation Timestamp:  2020-06-16T09:34:05Z
  Finalizers:
    finalizer.resourceclaim.crossplane.io
  Generation:  3
  Owner References:
    API Version:           core.oam.dev/v1alpha2
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  ApplicationConfiguration
    Name:                  service-tracker-managed
    UID:                   1332979b-1575-485c-8e2c-9f439691b5ee
  Resource Version:        1141943400
  Self Link:               /apis/database.crossplane.io/v1alpha1/namespaces/default/postgresqlinstances/app-postgresql
  UID:                     8c7f0fc8-e138-44b9-a6ef-a9dcca56aabf
Spec:
  Class Ref:
    API Version:  database.alibaba.crossplane.io/v1alpha1
    Kind:         RDSInstanceClass
    Name:         rdspostgresql-standard
    UID:          914d6bed-aab3-4260-a108-a920a822ecda
  Class Selector:
    Match Labels:
      Engine:      postgresql
      Example:     true
  Engine Version:  9.4
  Resource Ref:
    API Version:  database.alibaba.crossplane.io/v1alpha1
    Kind:         RDSInstance
    Name:         default-app-postgresql-jqkvb
    UID:          74c36f49-7cb5-4341-a7d1-deb6b8fe7bfa
  Write Connection Secret To Ref:
    Name:  trackerdbconn
Status:
  Conditions:
    Last Transition Time:  2020-06-16T09:34:05Z
    Reason:                Managed claim is waiting for managed resource to become bindable
    Status:                False
    Type:                  Ready
    Last Transition Time:  2020-06-16T09:34:05Z
    Reason:                Successfully reconciled resource
    Status:                True
    Type:                  Synced
Events:
  Type    Reason                  Age                    From                                                       Message
  ----    ------                  ----                   ----                                                       -------
  Normal  SelectedResourceClass   12m                    claimscheduling/postgresqlinstance.database.crossplane.io  Selected matching resource class
  Normal  CreatedManagedResource  12m                    claimbinding/postgresqlinstance.database.crossplane.io     Successfully created managed resource
  Normal  WaitingToBind           2m3s (x1972 over 12m)  claimbinding/postgresqlinstance.database.crossplane.io     Managed resource is not yet bindable

How can we reproduce it?

Followed provider-alibaba README and export wrong access-key information.

What environment did it happen in?

Crossplane version:

negz commented 3 years ago

I think this issue is asking for errors pertaining to a managed resource to be surfaced to its resource claim. The resource class based style of resource claim this relates to was deprecated before Crossplane v1.0. Arguably this issue is still relevant to composite resources and composite resource claims, which do not currently aggregate every error that a composed resource surfaces. I'm going to close this issue and encourage you to raise a similar one for composite resources and composite resource claims under crossplane/crossplane if you feel it's still relevant.