cozystack/pkg/registry/apps/application
Aleksei Sviridkin d369b64d71
fix(application): address review feedback for WorkloadMonitor integration
Tenant applications live in a child namespace computed from the Tenant
name, not in the HelmRelease's namespace. Scope the WorkloadMonitor
watch cluster-wide when kindName is Tenant and reverse-map WM events
back to the owning HelmRelease via computeTenantNamespace. The
condition-enrichment path now looks up monitors in the computed child
namespace too, so WorkloadsReady is populated for Tenants.

Buffer WorkloadMonitor events that arrive before the initial-events-end
bookmark and replay them once the bookmark is emitted, to preserve the
watch-list contract while not dropping workload-state transitions that
happen during the snapshot window.

Pass the fresh WorkloadMonitor object from the watch event into the
conversion path so WorkloadsReady reflects the state that triggered
the event, even when the cache client is lagging behind the watch
client.

Derive WorkloadsReady.LastTransitionTime from a stable source
(max of HelmRelease creation and condition timestamps, plus monitor
timestamps) instead of metav1.Now(), so repeated conversions of the
same underlying state produce identical timestamps.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-04-15 17:22:15 +03:00
..
rest.go fix(application): address review feedback for WorkloadMonitor integration 2026-04-15 17:22:15 +03:00
rest_conditions_test.go fix(application): address review feedback for WorkloadMonitor integration 2026-04-15 17:22:15 +03:00
rest_defaulting.go [registry] Fix linter errors 2025-12-26 12:52:49 +03:00
rest_defaulting_test.go [cozystack-api] Implement Kubernetes-like defaulting 2025-09-18 02:32:16 +02:00
rest_sorting_test.go [registry] Add alphabetical sorting to resource lists 2025-12-26 12:48:25 +03:00
rest_validation_test.go fix(application): address review feedback for WorkloadMonitor integration 2026-04-15 17:22:15 +03:00
rest_watch_test.go fix(application): address review feedback for WorkloadMonitor integration 2026-04-15 17:22:15 +03:00
rest_workloads_test.go fix(application): address review feedback for WorkloadMonitor integration 2026-04-15 17:22:15 +03:00