discovery

package
v0.7.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package discovery finds the cluster's proxies (0004 §4.1): the controllers its IngressClasses and GatewayClasses name, and how far Inkwall wires each, in InkwallConfig.status.proxies.

Index

Constants

View Source
const (
	ReasonConfigured      = "Configured"
	ReasonInvalidSelector = "InvalidSelector"
)

Reasons of the InkwallConfig's IntegrationsConfigured condition.

View Source
const (
	ReasonExporting            = "Exporting"
	ReasonExportFailing        = "ExportFailing"
	ReasonExportConfigInvalid  = "ExportConfigInvalid"
	ReasonExportDropping       = "ExportDropping"
	ReasonExportAddressRefused = "ExportAddressRefused"
	ReasonExportNotReported    = "ExportNotReported"
)

Reasons of the InkwallConfig's EventsExported condition (design 0010 §8). When several apply, the first of ExportConfigInvalid, ExportAddressRefused, ExportFailing, ExportNotReported and ExportDropping wins.

View Source
const DefaultNotReportedAfter = time.Minute

DefaultNotReportedAfter is how long a configured sink may be missing from a live replica's report (it is starting, or picking the sink up) before it counts as not reported: not exporting from there.

Variables

View Source
var GatewayClassGVK = schema.GroupVersionKind{Group: "gateway.networking.k8s.io", Version: "v1", Kind: "GatewayClass"}

GatewayClassGVK is the Gateway API's GatewayClass, whose CRD may be missing.

Functions

func Disable

func Disable(proxies []wafv1alpha1.ProxyStatus, disabled map[string]string) []wafv1alpha1.ProxyStatus

Disable reports the proxies of the disabled integrations (name -> why) Unsupported, with why.

func ExportCondition

func ExportCondition(sinks []string, reports []enginereport.ReplicaSinks, notReported []NotReported, generation int64) *metav1.Condition

ExportCondition folds the replicas' reports of the configured sinks into the EventsExported condition. notReported are the configured sinks missing from the reports past the grace (Missing, held for DefaultNotReportedAfter): not exporting from there. Nil with no sinks, or while nothing is reported nor missing for long.

func Proxies

func Proxies(ingressClasses, gatewayClasses []Class, kinds map[string][]schema.GroupKind) []wafv1alpha1.ProxyStatus

Proxies groups the classes by controller, and says how far Inkwall wires each: an IngressClass's routes are wired when its integration wires Ingresses, a GatewayClass's when it wires HTTPRoutes. kinds are the target kinds each integration wires, by name.

Types

type Class

type Class struct {
	Name, Controller string
}

Class is an IngressClass or a GatewayClass.

type NotReported

type NotReported struct{ Sink, Replica string }

NotReported is a configured sink a live replica doesn't report, or, with Replica "", that no live replica reports at all.

func Missing

func Missing(sinks []string, reports []enginereport.ReplicaSinks) []NotReported

Missing lists the configured sinks the fresh reports don't name: per live replica, or with Replica "" when no replica reports at all.

type Reconciler

type Reconciler struct {
	Client client.Client
	// GatewayClasses watches the GatewayClasses once their CRD is
	// installed; nil: they are only read at each reconcile.
	GatewayClasses *crdwatch.Kind
	// Kinds are the target kinds each integration wires, by name.
	Kinds map[string][]schema.GroupKind
	// Disabled are the integrations the operator may not wire, by name,
	// and why: their proxies are Unsupported.
	Disabled map[string]string
	// Recorder records an Event on the InkwallConfig when its
	// EngineConfigured condition changes, but for the first True; nil:
	// none.
	Recorder events.EventRecorder
	// Reports reads the replicas' engine reports (uncached), in Namespace;
	// those older than ReportStale are from replicas that are gone. Nil:
	// no EventsExported condition.
	Reports     client.Reader
	Namespace   string
	ReportStale time.Duration
	// NotReportedAfter: a configured sink missing this long from a live
	// replica's report, or from every report, is not exporting from there
	// (0: DefaultNotReportedAfter).
	NotReportedAfter time.Duration
	// contains filtered or unexported fields
}

Reconciler writes the discovered proxies into the InkwallConfig, when there is one. It runs on the leader.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (reconcile.Result, error)

Reconcile lists the classes and records their controllers.

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager registers the controller.

Jump to

Keyboard shortcuts

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