traffic

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RevisionTarget

type RevisionTarget struct {
	v1alpha1.TrafficTarget
	Active bool
}

A RevisionTarget adds the Active/Inactive state of a Revision to a flattened TrafficTarget.

type TargetError

type TargetError interface {
	error

	// MarkBadTrafficTarget marks a RouteStatus with Condition corresponding
	// to the error case of the traffic target.
	MarkBadTrafficTarget(rs *v1alpha1.RouteStatus)

	// IsFailure returns whether a TargetError is a true failure, e.g.
	// a Configuration fails to become ready.
	IsFailure() bool
}

TargetError gives details about an invalid traffic target.

type TrafficConfig

type TrafficConfig struct {
	// The traffic targets, flattened to the Revision-level.
	Targets map[string][]RevisionTarget

	// The referred Configurations and Revisions.
	Configurations map[string]*v1alpha1.Configuration
	Revisions      map[string]*v1alpha1.Revision
}

TrafficConfig encapsulates details of our traffic so that we don't need to make API calls, or use details of the route beyond its ObjectMeta to make routing changes.

func BuildTrafficConfiguration

func BuildTrafficConfiguration(configLister listers.ConfigurationLister, revLister listers.RevisionLister,
	u *v1alpha1.Route) (*TrafficConfig, error)

BuildTrafficConfiguration consolidates and flattens the Route.Spec.Traffic to the Revision-level. It also provides a complete lists of Configurations and Revisions referred by the Route, directly or indirectly. These referred targets are keyed by name for easy access.

In the case that some target is missing, an error of type TargetError will be returned.

func (*TrafficConfig) GetTrafficTargets

func (t *TrafficConfig) GetTrafficTargets() []v1alpha1.TrafficTarget

GetTrafficTargets returns a list of TrafficTarget.

Jump to

Keyboard shortcuts

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