Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitScheme ¶
Types ¶
type ResourceSummaryReconciler ¶
type ResourceSummaryReconciler struct { client.Client Config *rest.Config Scheme *runtime.Scheme RunMode Mode ClusterNamespace string ClusterName string ClusterType libsveltosv1beta1.ClusterType // Used to update internal maps and sets Mux sync.RWMutex // key: ResourceSummary; value: set of resources referenced by ResourceSummary // This map is used efficiently stop tracking resources not referenced anynmore // by ResourceSummary. ResourceSummaryMap map[corev1.ObjectReference]*libsveltosset.Set // key: ResourceSummary; value: set of resources referenced by ResourceSummary // This map is used efficiently stop tracking resources not referenced anynmore // by ResourceSummary. HelmResourceSummaryMap map[corev1.ObjectReference]*libsveltosset.Set // key: ResourceSummary; value: set of resources referenced by ResourceSummary // This map is used efficiently stop tracking resources not referenced anynmore // by ResourceSummary. KustomizeResourceSummaryMap map[corev1.ObjectReference]*libsveltosset.Set MapperLock sync.Mutex // contains filtered or unexported fields }
ResourceSummaryReconciler reconciles a ResourceSummary object. The goal of this controller is to make sure none of the resources deployed by Sveltos are locally modified in the cluster. Logic to achieve such goal is following: - When a ClusterSummary deploys resources in a cluster, it creates a ResourceSummary instance containing all the resources deployed by the ClusterSummary.; - The resourceSummary controller watches for ResourceSummary instances and creates internal maps containing the list of resources deployed by Sveltos (various resource maps below) and the list of GVKs to watch (GVKClusterSummaries map below); - For any GVK a watcher is started. When an instance of the GVK is modified, if the resource is contained in the Resources/HelmResources map, ResourceSummary status is updated indicating resource modification (that is signal for sveltos to redeploy again to make sure there is no configuration drift)
func (*ResourceSummaryReconciler) SetupWithManager ¶
SetupWithManager sets up the controller with the Manager.