Spec changes for Cluster and Resources are stored by clusterID in the state. The Operator picks a new spec to process sequentially by clusterID. If the spec is a Resource, a resource reconcile function is applied and the task is finished. If the spec is a Cluster, an Evaluation is triggered which starts the cluster reconcile functions. Then, multiple evaluations (i.e. node created, node running...) might happen until the cluster task is done.
It is strange to handle two reconcile functions in different ways, one with Evaluations and the other without. Besides, it makes it harder to introduce other primitives like Events. This issues proposes using Evaluations to handle Resource reconciles as well. Lets introduce a new interface:
type Reconcile interface {
Process(eval *proto.Evaluation)
}
There will be two implementations, one for the Cluster and the other one for the Resource spec. It will also streamline the implementation of #40
This change requires:
Add a Type in the Evaluation struct (Cluster or Resource) so that we can choose which reconciler to use.
Search Components by ID.
Add the Component ID that starts the reconcile to the Evaluation.
Spec changes for Cluster and Resources are stored by clusterID in the state. The Operator picks a new spec to process sequentially by clusterID. If the spec is a Resource, a resource reconcile function is applied and the task is finished. If the spec is a Cluster, an Evaluation is triggered which starts the cluster reconcile functions. Then, multiple evaluations (i.e. node created, node running...) might happen until the cluster task is done.
It is strange to handle two reconcile functions in different ways, one with Evaluations and the other without. Besides, it makes it harder to introduce other primitives like Events. This issues proposes using Evaluations to handle Resource reconciles as well. Lets introduce a new interface:
There will be two implementations, one for the Cluster and the other one for the Resource spec. It will also streamline the implementation of #40
This change requires: