store

package
v0.0.0-...-0677d28 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSecretForAuth = fmt.Errorf("secret is used for authentication")

ErrSecretForAuth error to indicate a secret is used for authentication

Functions

This section is empty.

Types

type ConfigMapLister

type ConfigMapLister struct {
	cache.Store
}

ConfigMapLister makes a Store that lists Configmaps.

func (*ConfigMapLister) ByKey

func (cml *ConfigMapLister) ByKey(key string) (*apiv1.ConfigMap, error)

ByKey returns the ConfigMap matching key in the local ConfigMap Store.

type EndpointLister

type EndpointLister struct {
	cache.Store
}

EndpointLister makes a Store that lists Endpoints.

func (*EndpointLister) ByKey

func (s *EndpointLister) ByKey(key string) (*apiv1.Endpoints, error)

ByKey returns the Endpoints of the Service matching key in the local Endpoint Store.

type Event

type Event struct {
	Type EventType
	Obj  interface{}
}

Event holds the context of an event.

type EventType

type EventType string

EventType type of event associated with an informer

const (
	// CreateEvent event associated with new objects in an informer
	CreateEvent EventType = "CREATE"
	// UpdateEvent event associated with an object update in an informer
	UpdateEvent EventType = "UPDATE"
	// DeleteEvent event associated when an object is removed from an informer
	DeleteEvent EventType = "DELETE"
	// ConfigurationEvent event associated when a controller configuration object is created or updated
	ConfigurationEvent EventType = "CONFIGURATION"
)

type Informer

Informer defines the required SharedIndexInformers that interact with the API server.

func (*Informer) Run

func (i *Informer) Run(stopCh chan struct{})

Run initiates the synchronization of the informers against the API server.

type IngressLister

type IngressLister struct {
	cache.Store
}

IngressLister makes a Store that lists Ingress.

func (IngressLister) ByKey

func (il IngressLister) ByKey(key string) (*extensions.Ingress, error)

ByKey returns the Ingress matching key in the local Ingress Store.

type IngressWithAnnotationsLister

type IngressWithAnnotationsLister struct {
	cache.Store
}

IngressWithAnnotationsLister makes a Store that lists Ingress rules with annotations already parsed

func (IngressWithAnnotationsLister) ByKey

ByKey returns the Ingress with annotations matching key in the local store or an error

type Lister

type Lister struct {
	Ingress               IngressLister
	Service               ServiceLister
	Endpoint              EndpointLister
	Secret                SecretLister
	ConfigMap             ConfigMapLister
	IngressWithAnnotation IngressWithAnnotationsLister
	Pod                   PodLister
}

Lister contains object listers (stores).

type NotExistsError

type NotExistsError string

NotExistsError is returned when an object does not exist in a local store.

func (NotExistsError) Error

func (e NotExistsError) Error() string

Error implements the error interface.

type ObjectRefMap

type ObjectRefMap interface {
	Insert(consumer string, ref ...string)
	Delete(consumer string)
	Len() int
	Has(ref string) bool
	HasConsumer(consumer string) bool
	Reference(ref string) []string
	ReferencedBy(consumer string) []string
}

ObjectRefMap is a map of references from object(s) to object (1:n). It is used to keep track of which data objects (Secrets) are used within Ingress objects.

func NewObjectRefMap

func NewObjectRefMap() ObjectRefMap

NewObjectRefMap returns a new ObjectRefMap.

type PodLister

type PodLister struct {
	cache.Store
}

PodLister makes a Store that lists Pods.

type SSLCertTracker

type SSLCertTracker struct {
	cache.ThreadSafeStore
}

SSLCertTracker holds a store of referenced Secrets in Ingress rules

func NewSSLCertTracker

func NewSSLCertTracker() *SSLCertTracker

NewSSLCertTracker creates a new SSLCertTracker store

func (SSLCertTracker) ByKey

func (s SSLCertTracker) ByKey(key string) (*ingress.SSLCert, error)

ByKey searches for an ingress in the local ingress Store

type SecretLister

type SecretLister struct {
	cache.Store
}

SecretLister makes a Store that lists Secrets.

func (*SecretLister) ByKey

func (sl *SecretLister) ByKey(key string) (*apiv1.Secret, error)

ByKey returns the Secret matching key in the local Secret Store.

type ServiceLister

type ServiceLister struct {
	cache.Store
}

ServiceLister makes a Store that lists Services.

func (*ServiceLister) ByKey

func (sl *ServiceLister) ByKey(key string) (*apiv1.Service, error)

ByKey returns the Service matching key in the local Service Store.

type Storer

type Storer interface {
	// GetBackendConfiguration returns the nginx configuration stored in a configmap
	GetBackendConfiguration() ngx_config.Configuration

	// GetConfigMap returns the ConfigMap matching key.
	GetConfigMap(key string) (*corev1.ConfigMap, error)

	// GetSecret returns the Secret matching key.
	GetSecret(key string) (*corev1.Secret, error)

	// GetService returns the Service matching key.
	GetService(key string) (*corev1.Service, error)

	// GetServiceEndpoints returns the Endpoints of a Service matching key.
	GetServiceEndpoints(key string) (*corev1.Endpoints, error)

	// ListIngresses returns a list of all Ingresses in the store.
	ListIngresses() []*ingress.Ingress

	// GetRunningControllerPodsCount returns the number of Running ingress-nginx controller Pods.
	GetRunningControllerPodsCount() int

	// GetLocalSSLCert returns the local copy of a SSLCert
	GetLocalSSLCert(name string) (*ingress.SSLCert, error)

	// ListLocalSSLCerts returns the list of local SSLCerts
	ListLocalSSLCerts() []*ingress.SSLCert

	// GetAuthCertificate resolves a given secret name into an SSL certificate.
	// The secret must contain 3 keys named:
	//   ca.crt: contains the certificate chain used for authentication
	GetAuthCertificate(string) (*resolver.AuthSSLCert, error)

	// GetDefaultBackend returns the default backend configuration
	GetDefaultBackend() defaults.Backend

	// Run initiates the synchronization of the controllers
	Run(stopCh chan struct{})
}

Storer is the interface that wraps the required methods to gather information about ingresses, services, secrets and ingress annotations.

func New

func New(checkOCSP bool,
	namespace, configmap, tcp, udp, defaultSSLCertificate string,
	resyncPeriod time.Duration,
	client clientset.Interface,
	fs file.Filesystem,
	updateCh *channels.RingChannel,
	isDynamicCertificatesEnabled bool,
	pod *k8s.PodInfo,
	disableCatchAll bool) Storer

New creates a new object store to be used in the ingress controller

Jump to

Keyboard shortcuts

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