Skip to content

Commit 35529ac

Browse files
authored
fix: handle missing conditions for helm release (#190)
* fix: handle missing conditions for helm release * chore: add json tags for status * chore: revert old status map update
1 parent cab74f8 commit 35529ac

File tree

2 files changed

+80
-2
lines changed

2 files changed

+80
-2
lines changed

pkg/health/status.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ func init() {
2525

2626
type status struct {
2727
Status struct {
28-
Conditions []metav1.Condition
29-
}
28+
Conditions []metav1.Condition `json:"conditions"`
29+
} `json:"status"`
3030
}
3131

3232
type GenericStatus struct {
@@ -245,6 +245,7 @@ func GetHealthFromStatus(k GenericStatus, statusMap StatusMap) (*HealthStatus, e
245245
health := &HealthStatus{
246246
Health: HealthUnknown,
247247
}
248+
248249
if len(statusMap.Conditions) == 0 {
249250
return health, nil
250251
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
apiVersion: helm.toolkit.fluxcd.io/v2
2+
kind: HelmRelease
3+
metadata:
4+
annotations:
5+
kustomize/patched: "true"
6+
expected-status: InstallSucceeded
7+
expected-health: healthy
8+
expected-ready: "true"
9+
creationTimestamp: "2025-11-03T05:08:53Z"
10+
finalizers:
11+
- finalizers.fluxcd.io
12+
generation: 1
13+
labels:
14+
canaries.flanksource.com/canary-id: ""
15+
canaries.flanksource.com/check-id: ""
16+
name: postgresql
17+
namespace: default
18+
resourceVersion: "6306"
19+
uid: 108e19b3-7180-46f5-858a-0bc7da4afa65
20+
spec:
21+
chart:
22+
spec:
23+
chart: postgresql
24+
reconcileStrategy: ChartVersion
25+
sourceRef:
26+
kind: HelmRepository
27+
name: bitnami-postgres
28+
namespace: flux-system
29+
version: 18.x
30+
install:
31+
createNamespace: true
32+
interval: 5m
33+
values:
34+
auth:
35+
database: exampledb
36+
password: qwerty123
37+
postgresPassword: qwerty123
38+
username: admin
39+
primary:
40+
persistence:
41+
enabled: false
42+
status:
43+
conditions:
44+
- lastTransitionTime: "2025-11-03T05:09:18Z"
45+
message: Helm install succeeded for release default/postgresql.v1 with chart
46+
47+
observedGeneration: 1
48+
reason: InstallSucceeded
49+
status: "True"
50+
type: Ready
51+
- lastTransitionTime: "2025-11-03T05:09:18Z"
52+
message: Helm install succeeded for release default/postgresql.v1 with chart
53+
54+
observedGeneration: 1
55+
reason: InstallSucceeded
56+
status: "True"
57+
type: Released
58+
helmChart: flux-system/default-postgresql
59+
history:
60+
- appVersion: 18.0.0
61+
chartName: postgresql
62+
chartVersion: 18.1.3
63+
configDigest: sha256:22ee20aec85ec029ac57660ee91f9057303d0021d0ff666bd9e75c77a7591fbe
64+
digest: sha256:af5d32477fea7f8972783ff68b61775412c8380dd518e3d55eeaeee2a0b5558d
65+
firstDeployed: "2025-11-03T05:09:02Z"
66+
lastDeployed: "2025-11-03T05:09:02Z"
67+
name: postgresql
68+
namespace: default
69+
status: deployed
70+
version: 1
71+
lastAttemptedConfigDigest: sha256:22ee20aec85ec029ac57660ee91f9057303d0021d0ff666bd9e75c77a7591fbe
72+
lastAttemptedGeneration: 1
73+
lastAttemptedReleaseAction: install
74+
lastAttemptedReleaseActionDuration: 16.793627689s
75+
lastAttemptedRevision: 18.1.3
76+
observedGeneration: 1
77+
storageNamespace: default

0 commit comments

Comments
 (0)