syncmgr

package
v0.0.0-...-1d80bfb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Skip   = "skip"
	Create = "create"
	Update = "update"
	Delete = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Gc

type Gc struct {
	client.Client
	// contains filtered or unexported fields
}

func NewGc

func NewGc(cfg *rest.Config, client client.Client) *Gc

func (*Gc) GcWork

func (g *Gc) GcWork()

GcWork gc work If a resource exists on the current cluster but not on the control cluster, the resource is a residual resource and needs to be deleted

type GenericObjFunc

type GenericObjFunc func(obj client.Object) (client.Object, error)

type SyncManager

type SyncManager struct {
	ctrl.Manager
	LocalClient            client.Client
	PivotClusterKubeConfig string
	PivotKubeHost          string
}

SyncManager watch and sync resource from cluster master to cluster member

func (*SyncManager) Initialize

func (s *SyncManager) Initialize() error

func (*SyncManager) Run

func (s *SyncManager) Run(stop <-chan struct{})

func (*SyncManager) SetupCtrlWithManager

func (s *SyncManager) SetupCtrlWithManager(resource client.Object, objFunc GenericObjFunc) error

1. native resource should not be affected? 2. what if sync resource changed manually in member cluster? use webhook? 3. update operation is valid? 4. how to record log? 5. use reflect of not to copy interface value?

setupCtrlWithManager add reconcile func for each sync resource resync reference to https://github.com/cloudnativeto/sig-kubernetes/issues/11

Jump to

Keyboard shortcuts

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