urlmap

package
v0.0.0-...-ef552c2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FakeURLSelfLink is a fake self link used for url maps.
	FakeURLSelfLink = "url/map/self/link"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeURLMapSyncer

type FakeURLMapSyncer struct {
	// List of url maps that this has been asked to ensure.
	EnsuredURLMaps []fakeURLMap
}

FakeURLMapSyncer is a fake implementation of SyncerInterface to be used in tests.

func (*FakeURLMapSyncer) AddStatus

func (f *FakeURLMapSyncer) AddStatus(lbName string)

AddStatus adds a status to the url map corresponding to the given load balancer.

func (*FakeURLMapSyncer) DeleteURLMap

func (f *FakeURLMapSyncer) DeleteURLMap() error

DeleteURLMap deletes the url map that EnsureURLMap would have created. See the interface for more details.

func (*FakeURLMapSyncer) EnsureURLMap

func (f *FakeURLMapSyncer) EnsureURLMap(lbName, ipAddress string, clusters []string, ing *v1beta1.Ingress, beMap backendservice.BackendServicesMap, forceUpdate bool) (string, error)

EnsureURLMap ensures that the required url map exists for the given ingress. See the interface for more details.

func (*FakeURLMapSyncer) GetLoadBalancerStatus

func (f *FakeURLMapSyncer) GetLoadBalancerStatus(lbName string) (*status.LoadBalancerStatus, error)

GetLoadBalancerStatus returns the status of the given load balancer. See the interface for more details.

func (*FakeURLMapSyncer) ListLoadBalancerStatuses

func (f *FakeURLMapSyncer) ListLoadBalancerStatuses() ([]status.LoadBalancerStatus, error)

ListLoadBalancerStatuses lists all the load balancers. See the interface for more details.

func (*FakeURLMapSyncer) RemoveClustersFromStatus

func (f *FakeURLMapSyncer) RemoveClustersFromStatus(clusters []string) error

RemoveClustersFromStatus removes the given clusters from the LoadBalancerStatus. See the interface for more details.

func (*FakeURLMapSyncer) RemoveStatus

func (f *FakeURLMapSyncer) RemoveStatus(lbName string)

RemoveStatus removes the status for the given load balancer.

type Syncer

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

Syncer manages GCP url maps for multicluster GCP L7 load balancers.

func (*Syncer) DeleteURLMap

func (s *Syncer) DeleteURLMap() error

DeleteURLMap deletes the url map that EnsureURLMap would have created. See the interface for more details.

func (*Syncer) EnsureURLMap

func (s *Syncer) EnsureURLMap(lbName, ipAddress string, clusters []string, ing *v1beta1.Ingress, beMap backendservice.BackendServicesMap, forceUpdate bool) (string, error)

EnsureURLMap ensures that the required url map exists for the given ingress. See the interface for more details.

func (*Syncer) GetLoadBalancerStatus

func (s *Syncer) GetLoadBalancerStatus(lbName string) (*status.LoadBalancerStatus, error)

GetLoadBalancerStatus returns the status of the given load balancer if it is stored on the url map. See the interface for more details.

func (*Syncer) ListLoadBalancerStatuses

func (s *Syncer) ListLoadBalancerStatuses() ([]status.LoadBalancerStatus, error)

ListLoadBalancerStatuses returns a list of load balancer status from load balancers that have the status stored on their url maps. It ignores the load balancers that dont have status on their url map. Returns an error if listing url maps fails. See the interface for more details.

func (*Syncer) RemoveClustersFromStatus

func (s *Syncer) RemoveClustersFromStatus(clusters []string) error

RemoveClustersFromStatus removes the given clusters from the LoadBalancerStatus. See the interface for more details.

type SyncerInterface

type SyncerInterface interface {
	// EnsureURLMap ensures that the required url map exists for the given ingress.
	// Uses beMap to extract the backend services to link to in the url map.
	// clusters is the list of clusters across which the load balancer is spread.
	// Will only change an existing URL map if forceUpdate=True.
	// Returns the self link for the ensured url map.
	EnsureURLMap(lbName, ipAddress string, clusters []string, ing *v1beta1.Ingress, beMap backendservice.BackendServicesMap, forceUpdate bool) (string, error)
	// DeleteURLMap deletes the url map that EnsureURLMap would have created.
	DeleteURLMap() error

	// GetLoadBalancerStatus returns the status of the given load balancer if it is stored on the url map.
	// Returns an error with http.StatusNotFound if url map does not exist.
	GetLoadBalancerStatus(lbName string) (*status.LoadBalancerStatus, error)
	// ListLoadBalancerStatuses returns status of all MCI ingresses (load balancers) that have statuses stored on url maps.
	ListLoadBalancerStatuses() ([]status.LoadBalancerStatus, error)
	// RemoveClustersFromStatus removes the given clusters from the LoadBalancerStatus.
	RemoveClustersFromStatus(clusters []string) error
}

SyncerInterface is an interface to manage GCP url maps.

func NewFakeURLMapSyncer

func NewFakeURLMapSyncer() SyncerInterface

NewFakeURLMapSyncer returns a new instance of the fake syncer.

func NewURLMapSyncer

func NewURLMapSyncer(namer *utilsnamer.Namer, ump ingresslb.LoadBalancers) SyncerInterface

NewURLMapSyncer returns a new instance of syncer.

Jump to

Keyboard shortcuts

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