sanitizer

package
v1.18.0-beta6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouteReplacingSanitizer

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

func (*RouteReplacingSanitizer) SanitizeSnapshot

func (s *RouteReplacingSanitizer) SanitizeSnapshot(
	ctx context.Context,
	glooSnapshot *v1snap.ApiSnapshot,
	xdsSnapshot envoycache.Snapshot,
	reports reporter.ResourceReports,
) envoycache.Snapshot

type UpstreamRemovingSanitizer

type UpstreamRemovingSanitizer struct {
}

func NewUpstreamRemovingSanitizer

func NewUpstreamRemovingSanitizer() *UpstreamRemovingSanitizer

func (*UpstreamRemovingSanitizer) SanitizeSnapshot

func (s *UpstreamRemovingSanitizer) SanitizeSnapshot(
	ctx context.Context,
	glooSnapshot *v1snap.ApiSnapshot,
	xdsSnapshot envoycache.Snapshot,
	reports reporter.ResourceReports,
) envoycache.Snapshot

If there are any errors on upstreams, this function tries to remove the correspondent clusters and endpoints from the xDS snapshot. If the snapshot is still consistent after these mutations and there are no errors related to other resources, we are good to send it to Envoy.

type XdsSanitizer

type XdsSanitizer interface {
	SanitizeSnapshot(
		ctx context.Context,
		glooSnapshot *v1snap.ApiSnapshot,
		xdsSnapshot envoycache.Snapshot,
		reports reporter.ResourceReports,
	) envoycache.Snapshot
}

XdsSanitizer modifies a provided xds snapshot before it is stored in the xds cache, with the goal of cleaning up a potentially invalid xds snapshot before being stored and served. It is logically invalid for us to return an error here (translation of resources always needs to result in a xds snapshot, so we are resilient to pod restarts); instead we should just return the xds snapshot unmodified.

type XdsSanitizers

type XdsSanitizers []XdsSanitizer

func (XdsSanitizers) SanitizeSnapshot

func (s XdsSanitizers) SanitizeSnapshot(
	ctx context.Context,
	glooSnapshot *v1snap.ApiSnapshot,
	xdsSnapshot envoycache.Snapshot,
	reports reporter.ResourceReports,
) envoycache.Snapshot

Jump to

Keyboard shortcuts

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