parser

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultServiceTimeout indicates the amount of time (by default) for
	// connections, reads and writes to a service over a network should
	// be given before timing out by default.
	DefaultServiceTimeout = 60000

	// DefaultRetries indicates the number of times a connection should be
	// retried by default.
	DefaultRetries = 5

	// DefaultHTTPPort is the network port that should be assumed by default
	// for HTTP traffic to services.
	DefaultHTTPPort = 80
)
View Source
const (
	KindGateway = gatewayv1beta1.Kind("Gateway")
)

Variables

View Source
var LegacyRegexPathExpression = regexp.MustCompile(`^[a-zA-Z0-9\.\-_~/%]*$`)

LegacyRegexPathExpression is the regular expression used by Kong <3.0 to determine if a path is not a regex.

Functions

func PortDefFromIntStr

func PortDefFromIntStr(is intstr.IntOrString) kongstate.PortDef

func PortDefFromServiceBackendPort

func PortDefFromServiceBackendPort(sbp *netv1.ServiceBackendPort) kongstate.PortDef

Types

type Parser added in v2.3.0

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

Parser parses Kubernetes objects and configurations into their equivalent Kong objects and configurations, producing a complete state configuration for the Kong Admin API.

func NewParser added in v2.3.0

func NewParser(
	logger logrus.FieldLogger,
	storer store.Storer,
) (*Parser, error)

NewParser produces a new Parser object provided a logging mechanism and a Kubernetes object store.

func (*Parser) Build added in v2.3.0

Build creates a Kong configuration from Ingress and Custom resources defined in Kubernetes. It returns a slice of ResourceFailures which should be used to provide users with feedback on Kubernetes objects validity.

func (*Parser) EnableCombinedServiceRoutes added in v2.4.0

func (p *Parser) EnableCombinedServiceRoutes()

EnableCombinedServiceRoutes changes the translation logic from the legacy mode which would create a kong.Route object per each individual path on an Ingress object to a mode that can combine routes for paths where the service name, host and port match for those paths.

func (*Parser) EnableKubernetesObjectReports added in v2.3.0

func (p *Parser) EnableKubernetesObjectReports()

EnableKubernetesObjectReports turns on object reporting for this parser: each subsequent call to Build() will track the Kubernetes objects which were successfully parsed. Objects tracked this way can be retrieved by calling GenerateKubernetesObjectReport().

func (*Parser) EnableRegexPathPrefix added in v2.6.0

func (p *Parser) EnableRegexPathPrefix()

EnableRegexPathPrefix enables adding the Kong 3.x+ regex path prefix on regex paths generated by the controller (to satisfy the Ingress Prefix and Exact path types) or indicated by a resource (e.g. when an HTTPRoute uses a RegularExpression Match). It does _not_ enable heuristic regex path detection for Ingress ImplementationSpecific paths, which require an IngressClass setting.

func (*Parser) GenerateKubernetesObjectReport added in v2.3.0

func (p *Parser) GenerateKubernetesObjectReport() []client.Object

GenerateKubernetesObjectReport provides a list of all the Kubernetes objects that have been successfully parsed as part of Build() calls so far. The objects are consumed: the parser's internal list will be emptied once this method is called, until more builds are run.

func (*Parser) ReportKubernetesObjectUpdate added in v2.3.0

func (p *Parser) ReportKubernetesObjectUpdate(obj client.Object)

ReportKubernetesObjectUpdate reports an update to a Kubernetes object if updates have been requested. If the parser has not been configured to report Kubernetes object updates this is a no-op.

type SNIs added in v2.8.0

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

func (SNIs) Hosts added in v2.8.0

func (s SNIs) Hosts() []string

func (SNIs) Parents added in v2.8.0

func (s SNIs) Parents() []client.Object

type SecretNameToSNIs

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

func (SecretNameToSNIs) Hosts added in v2.8.0

func (m SecretNameToSNIs) Hosts(secretKey string) []string

func (SecretNameToSNIs) Parents added in v2.8.0

func (m SecretNameToSNIs) Parents(secretKey string) []client.Object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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