Documentation
¶
Overview ¶
Package sync provides synchronization between Kubernetes CAPI and Nstance* resources and each nstance-server's groups/instances.
Index ¶
- Constants
- type Manager
- func (m *Manager) GetShardGroups() []string
- func (m *Manager) GetShards() []string
- func (m *Manager) PauseReconciliation()
- func (m *Manager) ResumeReconciliation()
- func (m *Manager) Start(ctx context.Context, connections map[string]*grpc.ClientConn) error
- func (m *Manager) UpdateShardGroup(shard, groupKey string, status *proto.GroupStatus)
Constants ¶
const AnnotationManagedBy = "nstance.dev/managed-by"
AnnotationManagedBy is the annotation key used to mark resources created by the sync manager. Resources with this annotation can be garbage collected when they become orphaned. User-created resources without this annotation are never deleted by the sync manager.
const AnnotationManagedByOperator = "nstance-operator"
AnnotationManagedByOperator is the value indicating the operator manages this resource.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles periodic config sync and group discovery.
func NewManager ¶
func NewManager(c client.Client, logger logr.Logger, recorder record.EventRecorder, interval time.Duration, namespace, clusterName string) *Manager
NewManager creates a new sync manager.
func (*Manager) GetShardGroups ¶
GetShardGroups returns all shard names the manager knows about.
func (*Manager) PauseReconciliation ¶
func (m *Manager) PauseReconciliation()
PauseReconciliation pauses MachinePool reconciliation. Use this while the controller is pushing changes to shards to avoid reconciling with incomplete aggregate data.
func (*Manager) ResumeReconciliation ¶
func (m *Manager) ResumeReconciliation()
ResumeReconciliation resumes MachinePool reconciliation and triggers an immediate reconcile with the current cached state.
func (*Manager) UpdateShardGroup ¶
func (m *Manager) UpdateShardGroup(shard, groupKey string, status *proto.GroupStatus)
UpdateShardGroup updates the cached group status for a shard. Called by the controller after successful UpsertGroup to keep the cache consistent.