forwardingrule

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeForwardingRuleSyncer

type FakeForwardingRuleSyncer struct {
	// List of forwarding rules that this has been asked to ensure.
	EnsuredForwardingRules []fakeForwardingRule
}

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

func (*FakeForwardingRuleSyncer) AddStatus

func (f *FakeForwardingRuleSyncer) AddStatus(lbName string, status *status.LoadBalancerStatus)

AddStatus adds the given status to forwarding rule for the given load balancer.

func (*FakeForwardingRuleSyncer) DeleteForwardingRules

func (f *FakeForwardingRuleSyncer) DeleteForwardingRules() error

DeleteForwardingRules deletes the forwarding rules that EnsureHTTPForwardingRule and EnsureHTTPSForwardingRule would have created. See interface for more details.

func (*FakeForwardingRuleSyncer) EnsureHTTPForwardingRule

func (f *FakeForwardingRuleSyncer) EnsureHTTPForwardingRule(lbName, ipAddress, targetProxyLink string, forceUpdate bool) error

EnsureHTTPForwardingRule ensures that a http forwarding rule exists for the given load balancer. See interface for more details.

func (*FakeForwardingRuleSyncer) EnsureHTTPSForwardingRule

func (f *FakeForwardingRuleSyncer) EnsureHTTPSForwardingRule(lbName, ipAddress, targetProxyLink string, forceUpdate bool) error

EnsureHTTPSForwardingRule ensures that a https forwarding rule exists for the given load balancer. See interface for more details.

func (*FakeForwardingRuleSyncer) GetLoadBalancerStatus

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

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

func (*FakeForwardingRuleSyncer) ListLoadBalancerStatuses

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

ListLoadBalancerStatuses returns the list of load balancer statuses. See interface for more details.

func (*FakeForwardingRuleSyncer) RemoveClustersFromStatus

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

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

func (*FakeForwardingRuleSyncer) RemoveStatus

func (f *FakeForwardingRuleSyncer) RemoveStatus(lbName string)

RemoveStatus removes status of the given load balancer.

type Syncer

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

Syncer manages GCP forwarding rules for multicluster GCP L7 load balancers.

func (*Syncer) DeleteForwardingRules

func (s *Syncer) DeleteForwardingRules() error

DeleteForwardingRules deletes the forwarding rules that EnsureHTTPSForwardingRule and EnsureHTTPForwardingRule would have created. See interface for more details.

func (*Syncer) EnsureHTTPForwardingRule

func (s *Syncer) EnsureHTTPForwardingRule(lbName, ipAddress, targetProxyLink string, forceUpdate bool) error

EnsureHTTPForwardingRule ensures that the required http forwarding rule exists. Does nothing if it exists already, else creates a new one. See interface for more details.

func (*Syncer) EnsureHTTPSForwardingRule

func (s *Syncer) EnsureHTTPSForwardingRule(lbName, ipAddress, targetProxyLink string, forceUpdate bool) error

EnsureHTTPSForwardingRule ensures that the required https forwarding rule exists. Does nothing if it exists already, else creates a new one. See interface for more details.

func (*Syncer) GetLoadBalancerStatus

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

GetLoadBalancerStatus returns the status for the given load balancer. See 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 forwarding rules. It ignores the load balancers that dont have status on their forwarding rule. Returns an error if listing forwarding rules fails.

func (*Syncer) RemoveClustersFromStatus

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

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

type SyncerInterface

type SyncerInterface interface {
	// EnsureHTTPForwardingRule ensures that the required http forwarding rule exists.
	// Will only change an existing rule if forceUpdate = True.
	EnsureHTTPForwardingRule(lbName, ipAddress, targetProxyLink string, forceUpdate bool) error
	// EnsureHTTPSForwardingRule ensures that the required https forwarding rule exists.
	// Will only change an existing rule if forceUpdate = True.
	EnsureHTTPSForwardingRule(lbName, ipAddress, targetProxyLink string, forceUpdate bool) error
	// DeleteForwardingRules deletes the forwarding rules that
	// EnsureHTTPForwardingRule and EnsureHTTPSForwardingRule would have created.
	DeleteForwardingRules() error

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

SyncerInterface is an interface to manage GCP forwarding rules.

func NewFakeForwardingRuleSyncer

func NewFakeForwardingRuleSyncer() SyncerInterface

NewFakeForwardingRuleSyncer returns a new instance of fake syncer.

func NewForwardingRuleSyncer

func NewForwardingRuleSyncer(namer *utilsnamer.Namer, frp ingresslb.LoadBalancers) SyncerInterface

NewForwardingRuleSyncer returns a new instance of syncer.

Jump to

Keyboard shortcuts

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