webhook

package
v0.0.0-...-7ca00ca Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IstioExpectedWeight = int(100)

Istio destination weights are percentage based and must sum to 100% https://istio.io/docs/concepts/traffic-management/

View Source
const MeshInternalGateway = "mesh"

"mesh" is a special reserved word on Istio VirtualServices https://istio.io/docs/reference/config/networking/v1alpha3/virtual-service/#VirtualService

Variables

View Source
var UninitializedError = errors.New("uninitialized: have not yet synchronized with cloud controller")

Functions

func VirtualServiceName

func VirtualServiceName(fqdn string) string

virtual service names cannot contain special characters

Types

type BulkSync

type BulkSync struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`
	Spec              BulkSyncSpec `json:"spec"`
}

BulkSync is an operator-facing configuration for syncing routes from CC into K8s

type BulkSyncSpec

type BulkSyncSpec struct {
	Selector Selector `json:"selector"`
	Template Template `json:"template"`
}

type HTTPMatchRequest

type HTTPMatchRequest struct {
	Uri HTTPPrefixMatch `json:"uri"`
}

type HTTPPrefixMatch

type HTTPPrefixMatch struct {
	Prefix string `json:"prefix"`
}

type HTTPRoute

type HTTPRoute struct {
	Match []HTTPMatchRequest     `json:"match,omitempty"`
	Route []HTTPRouteDestination `json:"route,omitempty"`
}

type HTTPRouteDestination

type HTTPRouteDestination struct {
	Destination VirtualServiceDestination `json:"destination"`
	Headers     VirtualServiceHeaders     `json:"headers,omitempty"`
	Weight      *int                      `json:"weight,omitempty"`
}

type K8sResource

type K8sResource interface{}

type K8sResourceBuilder

type K8sResourceBuilder interface {
	Build([]models.Route, Template) []K8sResource
}

type Lineage

type Lineage struct {
	RouteSnapshotRepo   snapshotRepo
	K8sResourceBuilders []K8sResourceBuilder
}

func (*Lineage) Sync

func (m *Lineage) Sync(syncRequest SyncRequest) (*SyncResponse, error)

Sync generates child resources for a metacontroller /sync request

type Selector

type Selector struct {
	MatchLabels map[string]string `json:"matchLabels"`
}

type Service

type Service struct {
	ApiVersion        string `json:"apiVersion"`
	Kind              string `json:"kind"`
	metav1.ObjectMeta `json:"metadata"`
	Spec              ServiceSpec `json:"spec"`
}

type ServiceBuilder

type ServiceBuilder struct{}

func (*ServiceBuilder) Build

func (b *ServiceBuilder) Build(routes []models.Route, template Template) []K8sResource

type ServicePort

type ServicePort struct {
	Port int    `json:"port"`
	Name string `json:"name"`
}

type ServiceSpec

type ServiceSpec struct {
	Selector map[string]string `json:"selector"`
	Ports    []ServicePort     `json:"ports"`
}

type SyncHandler

type SyncHandler struct {
	Marshaler   marshal.Marshaler
	Unmarshaler marshal.Unmarshaler
	Syncer      syncer
}

func (*SyncHandler) ServeHTTP

func (r *SyncHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP serves the /sync webhook to metacontroller

type SyncRequest

type SyncRequest struct {
	Parent BulkSync `json:"parent"`
}

type SyncResponse

type SyncResponse struct {
	Children []K8sResource `json:"children"`
}

type Template

type Template struct {
	metav1.ObjectMeta `json:"metadata"`
}

type VirtualService

type VirtualService struct {
	ApiVersion        string `json:"apiVersion"`
	Kind              string `json:"kind"`
	metav1.ObjectMeta `json:"metadata"`
	Spec              VirtualServiceSpec `json:"spec"`
}

type VirtualServiceBuilder

type VirtualServiceBuilder struct {
	IstioGateways []string
}

func (*VirtualServiceBuilder) Build

func (b *VirtualServiceBuilder) Build(routes []models.Route, template Template) []K8sResource

type VirtualServiceDestination

type VirtualServiceDestination struct {
	Host string `json:"host"`
}

type VirtualServiceHeaderOperations

type VirtualServiceHeaderOperations struct {
	Set    map[string]string `json:"set,omitempty"`
	Add    map[string]string `json:"add,omitempty"`
	Remove []string          `json:"remove,omitempty"`
}

type VirtualServiceHeaders

type VirtualServiceHeaders struct {
	Request  VirtualServiceHeaderOperations `json:"request,omitempty"`
	Response VirtualServiceHeaderOperations `json:"response,omitempty"`
}

type VirtualServiceSpec

type VirtualServiceSpec struct {
	Hosts    []string    `json:"hosts"`
	Gateways []string    `json:"gateways"`
	Http     []HTTPRoute `json:"http"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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