sync

package
v1.30.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipBackendsSync = errors.New("ingress skip backends sync and beyond")

ErrSkipBackendsSync is an error that can be returned by a Controller to indicate that syncing of backends was skipped and that all other future processes should be skipped as well.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	// SyncBackends syncs the backends for a GCLB given some existing state.
	SyncBackends(state interface{}, ingLogger klog.Logger) error
	// GCBackends garbage collects backends for all ingresses given a list of ingresses to exclude from GC.
	GCBackends(toKeep []*v1.Ingress, ingLogger klog.Logger) error
	// SyncLoadBalancer syncs the front-end load balancer resources for a GCLB given some existing state.
	SyncLoadBalancer(state interface{}, ingLogger klog.Logger) error
	// GCv1LoadBalancers garbage collects front-end load balancer resources for all ingresses
	// given a list of ingresses with v1 naming policy to exclude from GC.
	GCv1LoadBalancers(toKeep []*v1.Ingress) error
	// GCv2LoadBalancer garbage collects front-end load balancer resources for given ingress
	// with v2 naming policy.
	GCv2LoadBalancer(ing *v1.Ingress, scope meta.KeyType) error
	// PostProcess allows for doing some post-processing after an Ingress is synced to a GCLB.
	PostProcess(state interface{}, ingLogger klog.Logger) error
	// EnsureDeleteV1Finalizers ensures that v1 finalizers are removed for given list of ingresses.
	EnsureDeleteV1Finalizers(toCleanup []*v1.Ingress, ingLogger klog.Logger) error
	// EnsureDeleteV2Finalizer ensures that v2 finalizer is removed for given ingress.
	EnsureDeleteV2Finalizer(ing *v1.Ingress, ingLogger klog.Logger) error
}

Controller is an interface for ingress controllers and declares methods on how to sync the various portions of the GCLB for an Ingress.

type IngressSyncer

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

IngressSyncer processes an Ingress spec and produces a load balancer given an implementation of Controller.

func (*IngressSyncer) GC

func (s *IngressSyncer) GC(ings []*v1.Ingress, currIng *v1.Ingress, frontendGCAlgorithm utils.FrontendGCAlgorithm, scope meta.KeyType, ingLogger klog.Logger) error

GC implements Syncer.

func (*IngressSyncer) Sync

func (s *IngressSyncer) Sync(state interface{}, ingLogger klog.Logger) error

Sync implements Syncer.

type Syncer

type Syncer interface {
	// Sync creates a full GCLB given some state related to an Ingress.
	Sync(state interface{}, ingLogger klog.Logger) error
	// GC cleans up GCLB resources for all Ingresses and can optionally
	// use some arbitrary to help with the process.
	// GC workflow performs frontend resource deletion based on given gc algorithm.
	// TODO(rramkumar): Do we need to rethink the strategy of GC'ing
	// all Ingresses at once?
	GC(ings []*v1.Ingress, currIng *v1.Ingress, frontendGCAlgorithm utils.FrontendGCAlgorithm, scope meta.KeyType, ingLogger klog.Logger) error
}

Syncer is an interface to sync GCP resources associated with an Ingress.

func NewIngressSyncer

func NewIngressSyncer(controller Controller, logger klog.Logger) Syncer

Jump to

Keyboard shortcuts

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