crossplane / upjet

A code generation framework and runtime for Crossplane providers
Apache License 2.0
319 stars 89 forks source link

Fix the issue of hiding errors #435

Closed turkenf closed 2 months ago

turkenf commented 2 months ago

Description of your changes

We encountered an issue where error messages were hidden/not visible in recent provider releases. When we try to create a resource with incorrect or incomplete configuration, it gets stuck at creating false. See the discussion here.

Since recoverIfPanic is executed first, we pass ph.err as nil to the finishing operations, which causes the error to be hidden.

This PR removes ph.err = nil from the recoverIfPanic func.

I have:

How has this code been tested

After running make run in the main branch of crossplane-contrib/provider-upjet-gcp apply the following resource below:

apiVersion: cloudplatform.gcp.upbound.io/v1beta1
kind: ProjectIAMMember
metadata:
  name: project-iam-member2
spec:
  forProvider:
    member: <redacted>
    role: "roles/viewer"
    project: xxx