state

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeProcessor

type ChangeProcessor interface {
	// CaptureUpsertChange captures an upsert change to a resource.
	// It panics if the resource is of unsupported type or if the passed Gateway is different from the one this
	// ChangeProcessor was created for.
	CaptureUpsertChange(obj client.Object)
	// CaptureDeleteChange captures a delete change to a resource.
	// The method panics if the resource is of unsupported type or if the passed Gateway is different from the one
	// this ChangeProcessor was created for.
	CaptureDeleteChange(resourceType client.Object, nsname types.NamespacedName)
	// Process produces a graph-like representation of GatewayAPI resources.
	// If no changes were captured, the changed return argument will be false and graph will be empty.
	Process() (changed bool, graphCfg *graph.Graph)
}

ChangeProcessor processes the changes to resources and produces a graph-like representation of the Gateway configuration. It only supports one GatewayClass resource.

type ChangeProcessorConfig

type ChangeProcessorConfig struct {
	// RelationshipCapturer captures relationships between Kubernetes API resources and Gateway API resources.
	RelationshipCapturer relationship.Capturer
	// Validators validate resources according to data-plane specific rules.
	Validators validation.Validators
	// EventRecorder records events for Kubernetes resources.
	EventRecorder record.EventRecorder
	// Scheme is the Kubernetes scheme.
	Scheme *runtime.Scheme
	// ProtectedPorts are the ports that may not be configured by a listener with a descriptive name of the ports.
	ProtectedPorts graph.ProtectedPorts
	// Logger is the logger for this Change Processor.
	Logger logr.Logger
	// GatewayCtlrName is the name of the Gateway controller.
	GatewayCtlrName string
	// GatewayClassName is the name of the GatewayClass resource.
	GatewayClassName string
}

ChangeProcessorConfig holds configuration parameters for ChangeProcessorImpl.

type ChangeProcessorImpl

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

ChangeProcessorImpl is an implementation of ChangeProcessor.

func NewChangeProcessorImpl

func NewChangeProcessorImpl(cfg ChangeProcessorConfig) *ChangeProcessorImpl

NewChangeProcessorImpl creates a new ChangeProcessorImpl for the Gateway resource with the configured namespace name.

func (*ChangeProcessorImpl) CaptureDeleteChange

func (c *ChangeProcessorImpl) CaptureDeleteChange(resourceType client.Object, nsname types.NamespacedName)

func (*ChangeProcessorImpl) CaptureUpsertChange

func (c *ChangeProcessorImpl) CaptureUpsertChange(obj client.Object)

func (*ChangeProcessorImpl) Process

func (c *ChangeProcessorImpl) Process() (bool, *graph.Graph)

type Updater

type Updater interface {
	Upsert(obj client.Object)
	Delete(objType client.Object, nsname types.NamespacedName)
}

Updater updates the cluster state.

Directories

Path Synopsis
Package dataplane translates Graph representation of the cluster state into an intermediate representation of data plane configuration.
Package dataplane translates Graph representation of the cluster state into an intermediate representation of data plane configuration.
Package graph translates the cluster state (Gateway API and Kubernetes resources) into a graph-like representation, for which: - Resources are validated.
Package graph translates the cluster state (Gateway API and Kubernetes resources) into a graph-like representation, for which: - Resources are validated.
relationshipfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
resolverfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
validationfakes
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