crossplane-contrib / provider-sql

An SQL provider for @crossplane
https://crossplane.io
Apache License 2.0
104 stars 59 forks source link

Add readiness condition when unable to connect #107

Open chlunde opened 1 year ago

chlunde commented 1 year ago

What problem are you facing?

When running kubectl tree on a composite resource that has provider-sql resources that are not ready, it's not possible to see that the resources are not ready and what the reason is.

                   ├─Grant/test-pg-s2l6k-p2h57                                   -                 45m
                   │ └─ProviderConfigUsage/a26cfa6c-78c4-494f-8404-2541b0e8c49b  -                 45m
                   ├─Grant/test-pg-s2l6k-tdrfk                                   -                 45m
                   │ └─ProviderConfigUsage/02f9c06a-47e9-4a05-9f2c-fe6441742ec4  -                 45m
                   ├─LogGroup/test-pg-s2l6k-8npbk                                True   Available  45m
                   │ └─ProviderConfigUsage/f604aab2-e708-49bb-b0b6-89e37bf35cfb  -                 45m
                   ├─Policy/test-pg-s2l6k-7kpbk                                  True   Available  45m
                   │ └─ProviderConfigUsage/cb6e35e9-b9c1-4bd3-bb8e-cbaaf93b5492  -                 45m

If we run kubectl describe we can see a reason:

Status:
  Conditions:
    Last Transition Time:  2022-10-24T11:36:26Z
    Message:               observe failed: cannot select database: pq: Could not detect default username. Please provide one explicitly
    Reason:                ReconcileError
    Status:                False
    Type:                  Synced

How could Crossplane help solve your problem?

Would it be a good idea to have this error more visible in standard tooling like kubectl tree, or should we create a crossplane version of this tool with support for the synced column?