cozystack/internal/controller
Andrei Kvapil 1a210a2907
feat(application): add WorkloadsReady condition and Events tab (#2356)
## What this PR does

Adds two features to improve application observability in the dashboard,
plus a bug fix:

### 1. WorkloadsReady condition on Application status
- Queries WorkloadMonitor resources to determine if all application pods
are running
- Exposes `WorkloadsReady` as a separate condition alongside `Ready`
- `Ready` continues to reflect HelmRelease state only — no override — to
preserve backward compatibility with existing tooling (kubectl wait,
GitOps health checks) and avoid false-negative Ready=False during normal
startup windows
- Handles three states: operational, not operational, unknown (pending
reconciliation)
- Fails open on WorkloadMonitor query errors (prefers availability)
- Integrates with Application Watch to emit MODIFIED events on
WorkloadMonitor changes
- Registers cozystack.io/v1alpha1 types in API server scheme with
informer cache

### 2. Events tab in dashboard
- Shows Kubernetes Events scoped to the application's namespace
- Uses status.namespace for Tenant applications (consistent with
Resource Quotas tab)
- Includes both lastTimestamp and eventTime columns for Kubernetes
version compatibility

### 3. Bug fix: WorkloadMonitor Operational status persistence
- Operational field was written to stale `monitor` variable instead of
`fresh` inside RetryOnConflict, so it was never persisted to the cluster

Closes #2359
Closes #2360

### Release note

```release-note
[dashboard] Added Events tab to application detail pages showing namespace-scoped Kubernetes Events
[application] Added WorkloadsReady condition exposing aggregated WorkloadMonitor status
[workloadmonitor] Fixed bug where Operational status was never persisted to the cluster
```
2026-04-16 10:18:55 +02:00
..
dashboard feat(application): add WorkloadsReady condition and Events tab (#2356) 2026-04-16 10:18:55 +02:00
fluxplunger feat(platform): add flux-plunger controller 2026-01-19 13:20:08 +01:00
kubeovnplunger [kubeovn] Implement the KubeOVN plunger 2025-09-11 02:11:58 +03:00
applicationdefinition_controller.go [platform] Make cozystack-api reconciliation always use Deployment 2026-02-14 01:59:40 +01:00
applicationdefinition_helmreconciler.go refactor(labels): remove cozystack.io/ui label 2026-01-19 13:59:29 +01:00
suite_test.go Move project from aenix-io to cozystack repository 2025-03-10 21:16:58 +01:00
workload_controller.go [cozystack-controller] Refactor errors 2025-07-21 18:46:48 +02:00
workload_controller_test.go fix(controller): update workload test to use current label name 2026-02-18 00:49:57 +03:00
workloadmonitor_controller.go fix(workload-monitor): use fresh spec for MinReplicas check on retry 2026-04-15 17:20:45 +03:00
workloadmonitor_controller_test.go feat(application): add WorkloadsReady condition and Events tab 2026-04-15 17:20:45 +03:00