bcesync

package
v0.0.0-...-686bfca Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENIReadyTimeToAttach = 5 * time.Second
	ENIMaxCreateDuration = 5 * time.Minute

	FinalizerENI = "eni-syncer"
)

Variables

This section is empty.

Functions

func ElectENIIPv6PrimaryIP

func ElectENIIPv6PrimaryIP(newObj *ccev2.ENI)

ElectENIIPv6PrimaryIP elect a ipv6 primary ip for eni set primary ip for IPv6 if not set by default, all IPv6 IPs are secondary IPs

func EnsureSubnet

func EnsureSubnet(vpcID, sbnID string) (*ccev1.Subnet, error)

func SearchSubnetID

func SearchSubnetID(vpcID, defaultSbnID, privateIPStr string) string

Search the subnet ID of the IP address

Types

type SyncManager

type SyncManager[T eni.Eni | vpc.RouteRule | vpc.Subnet | bbc.GetInstanceEniResult] struct {
	sync.Mutex

	Name string
	// contains filtered or unexported fields
}

SyncManager synchronize data between k8s and VPC, run in operator

func NewSyncManager

func NewSyncManager[T eni.Eni | vpc.RouteRule | vpc.Subnet | bbc.GetInstanceEniResult](name string, resyncPeriod time.Duration, resync func(ctx context.Context) ([]T, error)) *SyncManager[T]

func (*SyncManager[T]) AddItems

func (s *SyncManager[T]) AddItems(dataList []T)

func (*SyncManager[T]) Get

func (s *SyncManager[T]) Get(key string) *T

func (*SyncManager[T]) Run

func (s *SyncManager[T]) Run()

func (*SyncManager[T]) RunImmediately

func (s *SyncManager[T]) RunImmediately()

type VPCENISyncer

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

VPCENISyncer only work with single vpc cluster

func (*VPCENISyncer) Create

func (es *VPCENISyncer) Create(resource *ccev2.ENI) error

Create implements syncer.ENIEventHandler

func (*VPCENISyncer) Delete

func (es *VPCENISyncer) Delete(name string) error

Delete implements syncer.ENIEventHandler

func (*VPCENISyncer) Init

func (es *VPCENISyncer) Init(ctx context.Context) error

NewVPCENISyncer create a new VPCENISyncer

func (*VPCENISyncer) ResyncENI

func (es *VPCENISyncer) ResyncENI(ctx context.Context) time.Duration

ResyncENI implements syncer.ENIEventHandler

func (*VPCENISyncer) StartENISyncer

func (es *VPCENISyncer) StartENISyncer(ctx context.Context, updater syncer.ENIUpdater) syncer.ENIEventHandler

StartENISyncer implements syncer.ENISyncher

func (*VPCENISyncer) Update

func (es *VPCENISyncer) Update(resource *ccev2.ENI) error

Update implements syncer.ENIEventHandler

type VPCSubnetSyncher

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

func (VPCSubnetSyncher) Create

func (ss VPCSubnetSyncher) Create(resource *ccev1.Subnet) error

Create Process synchronization of new subnets For a new subnet, we should generally query the details of the subnet directly and synchronously

func (VPCSubnetSyncher) Delete

func (ss VPCSubnetSyncher) Delete(name string) error

func (*VPCSubnetSyncher) Init

func (ss *VPCSubnetSyncher) Init(ctx context.Context) error

func (VPCSubnetSyncher) ResyncSubnet

func (ss VPCSubnetSyncher) ResyncSubnet(context.Context) time.Duration

func (VPCSubnetSyncher) StartSubnetSyncher

func (ss VPCSubnetSyncher) StartSubnetSyncher(ctx context.Context, updater syncer.SubnetUpdater) syncer.SubnetEventHandler

func (VPCSubnetSyncher) Update

func (ss VPCSubnetSyncher) Update(resource *ccev1.Subnet) error

Jump to

Keyboard shortcuts

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