config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Route controller depends.

Index

Constants

View Source
const (
	DomainConfigName = "config-domain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	// Domains map from domain to label selector.  If a route has
	// labels matching a particular selector, it will use the
	// corresponding domain.  If multiple selectors match, we choose
	// the most specific selector.
	Domains map[string]*LabelSelector
}

Domain maps domains to routes by matching the domain's label selectors to the route's labels.

func NewDomainFromConfigMap

func NewDomainFromConfigMap(configMap *corev1.ConfigMap) (*Domain, error)

NewDomainFromConfigMap creates a Domain from the supplied ConfigMap

func (*Domain) LookupDomainForLabels

func (c *Domain) LookupDomainForLabels(labels map[string]string) string

LookupDomainForLabels returns a domain given a set of labels. Since we reject configuration without a default domain, this should always return a value.

type LabelSelector

type LabelSelector struct {
	Selector map[string]string `json:"selector,omitempty"`
}

LabelSelector represents map of {key,value} pairs. A single {key,value} in the map is equivalent to a requirement key == value. The requirements are ANDed.

func (*LabelSelector) Matches

func (s *LabelSelector) Matches(labels map[string]string) bool

Matches returns whether the given labels meet the requirement of the selector.

Jump to

Keyboard shortcuts

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