neg

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: Apache-2.0 Imports: 31 Imported by: 5

Documentation

Index

Constants

View Source
const (
	TestZone1     = "zone1"
	TestZone2     = "zone2"
	TestInstance1 = "instance1"
	TestInstance2 = "instance2"
	TestInstance3 = "instance3"
	TestInstance4 = "instance4"
)
View Source
const (
	MAX_NETWORK_ENDPOINTS_PER_BATCH = 500
)

Variables

View Source
var NotFoundError = fmt.Errorf("Not Found")

Functions

func NewFakeNetworkEndpointGroupCloud

func NewFakeNetworkEndpointGroupCloud(subnetwork, network string) networkEndpointGroupCloud

func NewFakeZoneGetter

func NewFakeZoneGetter() *fakeZoneGetter

Types

type Controller

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

Controller is network endpoint group controller. It determines whether NEG for a service port is needed, then signals negSyncerManager to sync it.

func NewController

func NewController(
	cloud networkEndpointGroupCloud,
	ctx *context.ControllerContext,
	zoneGetter zoneGetter,
	namer networkEndpointGroupNamer,
	resyncPeriod time.Duration) *Controller

NewController returns a network endpoint group controller.

func (*Controller) IsHealthy added in v1.2.2

func (c *Controller) IsHealthy() error

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{})

type ErrorList

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

func (*ErrorList) Add

func (e *ErrorList) Add(err error)

func (*ErrorList) List

func (e *ErrorList) List() []error

type FakeNetworkEndpointGroupCloud

type FakeNetworkEndpointGroupCloud struct {
	NetworkEndpointGroups map[string][]*computebeta.NetworkEndpointGroup
	NetworkEndpoints      map[string][]*computebeta.NetworkEndpoint
	Subnetwork            string
	Network               string
	// contains filtered or unexported fields
}

func (*FakeNetworkEndpointGroupCloud) AggregatedListNetworkEndpointGroup

func (f *FakeNetworkEndpointGroupCloud) AggregatedListNetworkEndpointGroup() (map[string][]*computebeta.NetworkEndpointGroup, error)

func (*FakeNetworkEndpointGroupCloud) AttachNetworkEndpoints

func (f *FakeNetworkEndpointGroupCloud) AttachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error

func (*FakeNetworkEndpointGroupCloud) CreateNetworkEndpointGroup

func (f *FakeNetworkEndpointGroupCloud) CreateNetworkEndpointGroup(neg *computebeta.NetworkEndpointGroup, zone string) error

func (*FakeNetworkEndpointGroupCloud) DeleteNetworkEndpointGroup

func (f *FakeNetworkEndpointGroupCloud) DeleteNetworkEndpointGroup(name string, zone string) error

func (*FakeNetworkEndpointGroupCloud) DetachNetworkEndpoints

func (f *FakeNetworkEndpointGroupCloud) DetachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error

func (*FakeNetworkEndpointGroupCloud) GetNetworkEndpointGroup

func (f *FakeNetworkEndpointGroupCloud) GetNetworkEndpointGroup(name string, zone string) (*computebeta.NetworkEndpointGroup, error)

func (*FakeNetworkEndpointGroupCloud) ListNetworkEndpointGroup

func (f *FakeNetworkEndpointGroupCloud) ListNetworkEndpointGroup(zone string) ([]*computebeta.NetworkEndpointGroup, error)

func (*FakeNetworkEndpointGroupCloud) ListNetworkEndpoints

func (f *FakeNetworkEndpointGroupCloud) ListNetworkEndpoints(name, zone string, showHealthStatus bool) ([]*computebeta.NetworkEndpointWithHealthStatus, error)

func (*FakeNetworkEndpointGroupCloud) NetworkURL

func (f *FakeNetworkEndpointGroupCloud) NetworkURL() string

func (*FakeNetworkEndpointGroupCloud) SubnetworkURL

func (f *FakeNetworkEndpointGroupCloud) SubnetworkURL() string

type NegStatus added in v1.2.2

type NegStatus struct {
	// NetworkEndpointGroups returns the mapping between service port and NEG
	// resource. key is service port, value is the name of the NEG resource.
	NetworkEndpointGroups PortNameMap `json:"network_endpoint_groups,omitempty"`
	Zones                 []string    `json:"zones,omitempty"`
}

NegStatus contains name and zone of the Network Endpoint Group resources associated with this service

func GetNegStatus added in v1.2.2

func GetNegStatus(zones []string, portToNegs PortNameMap) NegStatus

GetNegStatus generates a NegStatus denoting the current NEGs associated with the given ports. NetworkEndpointGroups is a mapping between ServicePort and NEG name Zones is a list of zones where the NEGs exist.

type PortNameMap added in v1.2.2

type PortNameMap map[int32]string

PortNameMap is a map of ServicePort:TargetPort.

func NEGServicePorts added in v1.2.2

func NEGServicePorts(ann *annotations.NegAnnotation, knownPorts PortNameMap) (PortNameMap, error)

NEGServicePorts returns the parsed ServicePorts from the annotation. knownPorts represents the known Port:TargetPort attributes of servicePorts that already exist on the service. This function returns an error if any of the parsed ServicePorts from the annotation is not in knownPorts.

func (PortNameMap) Difference added in v1.2.2

func (p1 PortNameMap) Difference(p2 PortNameMap) PortNameMap

Difference returns the set of Port:TargetPorts in p2 that aren't present in p1

func (PortNameMap) Union added in v1.2.2

func (p1 PortNameMap) Union(p2 PortNameMap) PortNameMap

Union returns the union of the Port:TargetPort mappings

Jump to

Keyboard shortcuts

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