sync

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package sync provides synchronization between Kubernetes CAPI and Nstance* resources and each nstance-server's groups/instances.

Index

Constants

View Source
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.

View Source
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

func (m *Manager) GetShardGroups() []string

GetShardGroups returns all shard names the manager knows about.

func (*Manager) GetShards

func (m *Manager) GetShards() []string

GetShards returns all configured shard names.

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) Start

func (m *Manager) Start(ctx context.Context, connections map[string]*grpc.ClientConn) error

Start begins syncing. It blocks until ctx is cancelled.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL