reconcile

package
v0.12.21 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is a singleton registry that holds and routes reconcile requests to appropriate Reconcilers.

func GetManager

func GetManager() *Manager

GetManager returns the singleton instance of the Manager.

func (*Manager) RegisterReconciler

func (m *Manager) RegisterReconciler(resourceType string, reconciler Reconciler)

RegisterReconciler registers a specific Reconciler for a given resourceType.

func (*Manager) RunReconcile

func (m *Manager) RunReconcile(ctx context.Context, nsId string, resourceType string, resourceId string, optPreloadedStatus *model.CspResourceStatusResponse) (any, error)

RunReconcile routes the reconcile request to the registered Reconciler based on resourceType.

func (*Manager) RunReconcileAll

func (m *Manager) RunReconcileAll(ctx context.Context, nsId string, resourceType string, maxConcurrent int) (model.ResourceReconcileResults, error)

RunReconcileAll routes the namespace-level batch reconcile request to the registered Reconciler.

type Reconciler

type Reconciler interface {
	Reconcile(ctx context.Context, nsId string, resourceId string, optPreloadedStatus *model.CspResourceStatusResponse) (any, error)
	ReconcileAll(ctx context.Context, nsId string, maxConcurrent int) (model.ResourceReconcileResults, error)
}

Reconciler is an interface that every resource-specific reconciler must implement.

type VNetReconciler

type VNetReconciler struct{}

VNetReconciler implements the Reconciler interface for VNet resources.

func (*VNetReconciler) Reconcile

func (r *VNetReconciler) Reconcile(ctx context.Context, nsId string, resourceId string, optPreloadedVNetStatus *model.CspResourceStatusResponse) (any, error)

Reconcile performs the state machine logic for VNet and delegates the actual sync to SyncVNetState.

func (*VNetReconciler) ReconcileAll

func (r *VNetReconciler) ReconcileAll(ctx context.Context, nsId string, maxConcurrent int) (model.ResourceReconcileResults, error)

ReconcileAll reconciles all VNets in the namespace by comparing TB metadata with CSP state. This method batches reconciliation with optimized API calls (pre-fetch status per connection).

Jump to

Keyboard shortcuts

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