Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

illrill
Copy link
Contributor

@illrill illrill commented Apr 9, 2024

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

Signed-off-by: Richard Johansson <richard.jimmy.johansson@gmail.com>
Copy link

netlify bot commented Apr 9, 2024

Deploy Preview for crossplane ready!

Name Link
🔨 Latest commit fceac5f
🔍 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
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.

Copy link
Collaborator

@plumbis plumbis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@plumbis plumbis merged commit c347076 into crossplane:master Apr 9, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants