ingclass

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControllerTypeNginxCommunity = "k8s.io/ingress-nginx"
	ControllerTypeTraefik        = "traefik.io/ingress-controller"
)

Supported ingress controller types.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

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

Watcher watches for IngressClass resources, maintaining a local cache of these resources, updated as they are created, modified or deleted. It watches for netv1.IngressClass, netv1beta1.IngressClass and hubv1alpha1.IngressClass.

func NewWatcher

func NewWatcher() *Watcher

NewWatcher creates a new Watcher to track IngressClass resources.

func (*Watcher) GetController

func (w *Watcher) GetController(name string) (string, error)

GetController returns the controller of the IngressClass matching the given name. If no IngressClass is found, an empty string is returned.

func (*Watcher) GetDefaultController

func (w *Watcher) GetDefaultController() (string, error)

GetDefaultController returns the controller of the IngressClass that is noted as default. If no IngressClass is noted as default, an empty string is returned. If multiple IngressClasses are marked as default, an error is returned instead.

func (*Watcher) OnAdd

func (w *Watcher) OnAdd(obj interface{})

OnAdd implements Kubernetes cache.ResourceEventHandler so it can be used as an informer event handler.

func (*Watcher) OnDelete

func (w *Watcher) OnDelete(obj interface{})

OnDelete implements Kubernetes cache.ResourceEventHandler so it can be used as an informer event handler.

func (*Watcher) OnUpdate

func (w *Watcher) OnUpdate(_, newObj interface{})

OnUpdate implements Kubernetes cache.ResourceEventHandler so it can be used as an informer event handler.

Jump to

Keyboard shortcuts

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