filter

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// masterservice filter is used to mutate the ClusterIP and https port of default/kubernetes service
	// in order to pods on edge nodes can access kube-apiserver directly by inClusterConfig.
	MasterServiceFilterName = "masterservice"

	// servicetopology filter is used to reassemble endpointslice in order to make the service traffic
	// under the topology that defined by service.Annotation["openyurt.io/topologyKeys"]
	ServiceTopologyFilterName = "servicetopology"

	// discardcloudservice filter is used to discard cloud service(like loadBalancer service)
	// on kube-proxy list/watch service request from edge nodes.
	DiscardCloudServiceFilterName = "discardcloudservice"
)

Variables

View Source
var DisabledInCloudMode = []string{DiscardCloudServiceFilterName}

DisabledInCloudMode contains the filters that should be disabled when yurthub is working in cloud mode.

Functions

func NewFilterReadCloser

func NewFilterReadCloser(
	req *http.Request,
	rc io.ReadCloser,
	handler Handler,
	serializer *serializer.Serializer,
	ownerName string,
	stopCh <-chan struct{}) (int, io.ReadCloser, error)

NewFilterReadCloser create an filterReadCloser object

Types

type Approver

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

func NewApprover

func NewApprover(comp, resource string, verbs ...string) *Approver

func (*Approver) Approve

func (a *Approver) Approve(comp, resource, verb string) bool

type Factory

type Factory func() (Interface, error)

type FilterInitializer

type FilterInitializer interface {
	Initialize(filter Interface) error
}

type FilterInitializers

type FilterInitializers []FilterInitializer

func (FilterInitializers) Initialize

func (fis FilterInitializers) Initialize(ins Interface) error

type Filters

type Filters struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewFilters

func NewFilters(disabledFilters []string) *Filters

func (*Filters) Enabled

func (fs *Filters) Enabled(name string) bool

func (*Filters) NewFromFilters

func (fs *Filters) NewFromFilters(initializer FilterInitializer) (Interface, error)

func (*Filters) Register

func (fs *Filters) Register(name string, fn Factory)

type Handler

type Handler interface {
	StreamResponseFilter(rc io.ReadCloser, ch chan watch.Event) error
	ObjectResponseFilter(b []byte) ([]byte, error)
}

type Interface

type Interface interface {
	Approve(comp, resource, verb string) bool
	Filter(req *http.Request, rc io.ReadCloser, stopCh <-chan struct{}) (int, io.ReadCloser, error)
}

type NodeGetter

type NodeGetter func() (*v1.Node, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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