firewallrule

package
v0.0.0-...-97cf01e Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeFirewallRuleSyncer

type FakeFirewallRuleSyncer struct {
	// List of firewall rules that this has been asked to ensure.
	EnsuredFirewallRules []fakeFirewallRule
}

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

func (*FakeFirewallRuleSyncer) DeleteFirewallRules

func (h *FakeFirewallRuleSyncer) DeleteFirewallRules() error

DeleteFirewallRules deletes the firewall rules that EnsureFirewallRule would have created. See the interface for more details.

func (*FakeFirewallRuleSyncer) EnsureFirewallRule

func (h *FakeFirewallRuleSyncer) EnsureFirewallRule(lbName string, ports []ingressbe.ServicePort, igLinks map[string][]string, forceUpdate bool) error

EnsureFirewallRule ensures that the required firewall rules exist. See the interface for more details.

func (*FakeFirewallRuleSyncer) RemoveFromClusters

func (h *FakeFirewallRuleSyncer) RemoveFromClusters(lbName string, removeIGLinks map[string][]string) error

RemoveFromClusters removes the clusters corresponding to the given instance groups from the firewall rule. See the interface for more details.

type Syncer

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

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

func (*Syncer) DeleteFirewallRules

func (s *Syncer) DeleteFirewallRules() error

DeleteFirewallRules deletes the firewall rules that EnsureFirewallRule would have created. See the interface for more details.

func (*Syncer) EnsureFirewallRule

func (s *Syncer) EnsureFirewallRule(lbName string, ports []ingressbe.ServicePort, igLinks map[string][]string, forceUpdate bool) error

EnsureFirewallRule ensures that the required firewall rules exist for the given ports. Does nothing if they exist already, else creates new ones. See the interface for more details.

func (*Syncer) RemoveFromClusters

func (s *Syncer) RemoveFromClusters(lbName string, removeIGLinks map[string][]string) error

RemoveFromClusters removes the clusters corresponding to the given instance groups from the firewall rule. See the interface for more details.

type SyncerInterface

type SyncerInterface interface {
	// EnsureFirewallRule ensures that the required firewall rules exist.
	// If a firewall rule already exists and differs, it will not be updated unless forceUpdate is true.
	EnsureFirewallRule(lbName string, ports []ingressbe.ServicePort, igLinks map[string][]string, forceUpdate bool) error
	// DeleteFirewallRules deletes all firewall rules that would have been created by EnsureFirewallRule.
	DeleteFirewallRules() error
	// RemoveFromClusters removes the clusters corresponding to the given instance groups from the firewall rule.
	RemoveFromClusters(lbName string, removeIGLinks map[string][]string) error
}

SyncerInterface is an interface to manage GCP firewall rules.

func NewFakeFirewallRuleSyncer

func NewFakeFirewallRuleSyncer() SyncerInterface

NewFakeFirewallRuleSyncer returns a new instance of the fake syncer.

func NewFirewallRuleSyncer

NewFirewallRuleSyncer returns a new instance of the syncer.

Jump to

Keyboard shortcuts

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