Commit Graph

5 Commits

Author SHA1 Message Date
Andrei Kvapil
ee5a724374 [cozystack-controller] ignore NotFound errors in Workload reconciler
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2025-07-21 18:03:36 +02:00
Andrei Kvapil
315c36db3e [cozystack-controller] Fix deleting workloads
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2025-07-21 17:56:18 +02:00
Timofei Larkin
38f76f6ad0 [platform] Fix stale workloads not being deleted
Workloads tracking an object undergoing deletion can be reconciled when
the object is marked for deletion, but is not yet removed. After the
object is deleted, there is no event to trigger another reconciliation
of the workload and it might never get deleted until a global reconcile
happens or the controller is restarted. This patch ensures they are
requeued in the reconciliation loop.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-07-16 23:51:40 +03:00
Timofei Larkin
ec9e26c054 Fix virtual machine resource tracking
* Count Workload resources for pods by requests, not limits
* Do not count init container requests
* Prefix Workloads for pods with `pod-`, just like the other types to
  prevent possible name collisions (closes #787)

The previous version of the WorkloadMonitor controller incorrectly
summed resource limits on pods, rather than requests. This prevented it
from tracking the resource allocation for pods, which only had requests
specified, which is particularly the case for kubevirt's virtual machine
pods. Additionally, it counted the limits for all containers, including
init containers, which are short-lived and do not contribute much to the
total resource usage.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-04-29 15:22:46 +03:00
Timofei Larkin
fea142774a Delete a Workload if the related object is absent
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-04-09 18:36:11 +03:00