fix(health): update crossplane healthchecks (#25386)

Signed-off-by: Jonasz Lasut-Balcerzak <jonasz.lasut@gmail.com>
Signed-off-by: Jonasz Łasut-Balcerzak <jonasz.lasut@gmail.com>
This commit is contained in:
Jonasz Łasut-Balcerzak
2025-12-04 18:07:14 +01:00
committed by github-actions[bot]
parent 11e7758ca9
commit c56aae03d4
6 changed files with 90 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
-- Health check copied from here: https://github.com/crossplane/docs/blob/709889c5dbe6e5a2ea3dffd66fe276cf465b47b5/content/master/guides/crossplane-with-argo-cd.md
-- Health check copied from here: https://github.com/crossplane/docs/blob/9fe744889fc150ca71e5298d90b4133f79ea20f2/content/master/guides/crossplane-with-argo-cd.md
health_status = {
status = "Progressing",
@@ -59,7 +59,6 @@ for i, condition in ipairs(obj.status.conditions) do
if condition.status == "True" then
health_status.status = "Healthy"
health_status.message = "Resource is up-to-date."
return health_status
end
end
end

View File

@@ -6,4 +6,8 @@ tests:
- healthStatus:
status: Healthy
message: "Resource is up-to-date."
inputPath: testdata/configurationrevision_healthy.yaml
inputPath: testdata/configurationrevision_healthy.yaml
- healthStatus:
status: Degraded
message: "ActivePackageRevision UnhealthyPackageRevision"
inputPath: testdata/provider_degraded.yaml

View File

@@ -0,0 +1,33 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: upbound-provider-family-azure
spec:
ignoreCrossplaneConstraints: false
package: xpkg.upbound.io/upbound/provider-family-azure:v2.2.0
packagePullPolicy: IfNotPresent
revisionActivationPolicy: Automatic
revisionHistoryLimit: 1
runtimeConfigRef:
apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
name: default
skipDependencyResolution: false
status:
conditions:
- lastTransitionTime: "2025-11-22T08:47:52Z"
message: 'Package runtime health is "False" with message: post establish xppkgruntime
hook failed for package: provider package deployment is unavailable with message:
Deployment does not have minimum availability.'
observedGeneration: 3
reason: UnhealthyPackageRevision
status: "False"
type: Healthy
- lastTransitionTime: "2025-11-22T08:45:44Z"
observedGeneration: 3
reason: ActivePackageRevision
status: "True"
type: Installed
currentIdentifier: xpkg.upbound.io/upbound/provider-family-azure:v2.2.0
currentRevision: upbound-provider-family-azure-04ba5ac3fc37
resolvedPackage: xpkg.upbound.io/upbound/provider-family-azure:v2.2.0

View File

@@ -1,4 +1,4 @@
-- Health check copied from here: https://github.com/crossplane/docs/blob/709889c5dbe6e5a2ea3dffd66fe276cf465b47b5/content/master/guides/crossplane-with-argo-cd.md
-- Health check copied from here: https://github.com/crossplane/docs/blob/9fe744889fc150ca71e5298d90b4133f79ea20f2/content/master/guides/crossplane-with-argo-cd.md
health_status = {
status = "Progressing",
@@ -56,7 +56,6 @@ for i, condition in ipairs(obj.status.conditions) do
if condition.status == "True" then
health_status.status = "Healthy"
health_status.message = "Resource is up-to-date."
return health_status
end
end
end

View File

@@ -3,3 +3,7 @@ tests:
status: Healthy
message: "Resource is up-to-date."
inputPath: testdata/providerconfig_healthy.yaml
- healthStatus:
status: Degraded
message: "update failed: async update failed: refuse to update the external resource because the following update requires replacing it: cannot change the value of the argument \"location\" from \"westeurope\" to \"switzerlandnorth\""
inputPath: testdata/managedresource_failedupdate_degraded.yaml

View File

@@ -0,0 +1,46 @@
apiVersion: azure.m.upbound.io/v1beta1
kind: ResourceGroup
metadata:
annotations:
crossplane.io/external-create-pending: '2025-11-22T08:33:27Z'
crossplane.io/external-create-succeeded: '2025-11-22T08:33:27Z'
crossplane.io/external-name: example-resources
name: example-resources
spec:
forProvider:
location: Switzerland North
initProvider: {}
managementPolicies:
- '*'
providerConfigRef:
kind: ClusterProviderConfig
name: default
status:
atProvider:
id: >-
/subscriptions/uuid/resourceGroups/example-resources
location: westeurope
managedBy: ''
conditions:
- lastTransitionTime: '2025-11-22T08:33:40Z'
reason: Available
status: 'True'
type: Ready
- lastTransitionTime: '2025-11-22T08:36:12Z'
message: >-
update failed: async update failed: refuse to update the external
resource because the following update requires replacing it: cannot
change the value of the argument "location" from "westeurope" to
"switzerlandnorth"
observedGeneration: 3
reason: ReconcileError
status: 'False'
type: Synced
- lastTransitionTime: '2025-11-22T08:36:11Z'
message: >-
async update failed: refuse to update the external resource because the
following update requires replacing it: cannot change the value of the
argument "location" from "westeurope" to "switzerlandnorth"
reason: AsyncUpdateFailure
status: 'False'
type: LastAsyncOperation