crossplane / docs

Repo for Crossplane documentation.
https://docs.crossplane.io
Other
47 stars 105 forks source link

fix: Objects with .status: {} should return Healthy #746

Closed illrill closed 3 months ago

illrill commented 3 months ago

This fixes the health status for ProviderConfig objects, that kept being reported as Progressing in ArgoCD.

The reason is that the script was only checking for nil values in the status and conditions fields. In Lua, an empty table is not the same as nil. In the ProviderConfig object, the status field is an empty object status: {}.

apiVersion: azure.upbound.io/v1beta1
  kind: ProviderConfig
  metadata:
    annotations:
      argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
      argocd.argoproj.io/tracking-id: [REDACTED]:azure.upbound.io/ProviderConfig:crossplane-system/azure-workload-identity
    creationTimestamp: "2024-04-09T13:33:11Z"
    finalizers:
    - in-use.crossplane.io
    generation: 1
    name: azure-workload-identity
    resourceVersion: "19576"
    uid: f2414d9f-df3a-4378-b760-0a4301da82ff
  spec:
    clientID: [REDACTED]
    credentials:
      source: OIDCTokenFile
    oidcTokenFilePath: /var/run/secrets/azure/tokens/azure-identity-token
    subscriptionID: [REDACTED]
    tenantID: [REDACTED]
  status: {}

This fix extends the conditions to also catch when the field field exists but is empty, by using the next function to return nil if the table is empty. The ProviderConfig is now showing healthy!

image

netlify[bot] commented 3 months ago

Deploy Preview for crossplane ready!

Name Link
Latest commit fceac5f5f9cc64e5ba71649d16c6e0daa9ba52ea
Latest deploy log https://app.netlify.com/sites/crossplane/deploys/66155d5ddb04ca00088d32df
Deploy Preview https://deploy-preview-746--crossplane.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 89 (🟢 up 1 from production)
Accessibility: 88 (🔴 down 3 from production)
Best Practices: 83 (no change from production)
SEO: 93 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.