* Fmt fixes
* Implement custom resource comparison logic
Introduces a `ResourceDiff` trait and implements it for various Fleet API resources. This allows controllers to perform more granular comparisons between the desired state and the current state of resources, avoiding unnecessary updates and reconciliations.
* Improve readability of the wait conditions individually
---------
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
Co-authored-by: Danil Grigorev <danil.grigorev@suse.com>
Introduce a `tokio::sync::Barrier` to the shared controller state.
Each main controller waits on this barrier after completing its initial setup, including dynamic watch registration and initial reconciliation.
This allows external components or health checks to synchronize and wait for all core controllers to be ready before proceeding.
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Drop finalizer on ClusterGroup
- Move BundleNamespaceMapping cleanup into Class reconciler
- Remove finalizer from ClusterGroup, causing issues
- Refactor controllers to use stable API (duplicate cache for
ClusterGroup)
- Fix hot loop on Helm install due to chart version compare issue
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Simplify dynamic watch setup version separation
Current setup allows to use functionality available for k/k 1.32+
already with streaming_list() option by piggybacking type_meta
population on serialization as a typed object first with k/k below 1.32.
`TypeMeta` for core types in this scenario is always populated by
`k8s_openapi` implementation, even though list response does omit
type_meta for the inner set of objects.
Main differentiator here, is that streaming_list uses only `watch`,
which never omits type_meta of the resource, while regular watch setup
issues `list` request to collect initial events.
For the `Cluster` object defined as a `CRD`, `to_dynamic_event` performs
necessary conversion with type_meta population in-place.
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Implement default handling as trait extension
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
---------
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Add bundleNamespaceMapping generation
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Update the docs on cluster group and bundle namespace mapping
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Refactor to use ref mut when possible
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
---------
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
- Enroll into unstable-runtime to control and reuse object streams from
watches.
- Reduce cache size by removing managed_fields
- Set the finalizer on the ClusterGroup object to ensure deletion events
are not missed, and object is recreated
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Use development branch for the time being
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Add support for namespace and cluster label selectors
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Rework FleetAgentConfig and include selectors
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
* Add e2e including FleetAddonConfig
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
---------
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
- matching all Clusters referencing a ClusterClass
- fleet cluster gets a label with ClusterClass name
- emit an event on cluster/group create and delete
- add common tracing fields
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>