controller

package
v0.1.2-alpha3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config struct {
	EnableIPv6         bool
	IPExpiration       time.Duration
	MaxRequeueTime     uint32
	DNS                *dns.ClientConfig
	DNSProtocol        string
	DNSEnvironment     string
	UpstreamDNSService string
}

Functions

func NPGenerate

func NPGenerate(ip_map *dnsv1alpha1.IPMap) (np *networking.NetworkPolicy)

Types

type DNSResolverReconciler

type DNSResolverReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

func (DNSResolverReconciler) NPReconcile

func (r DNSResolverReconciler) NPReconcile(ctx context.Context, ip_map *dnsv1alpha1.IPMap) error

Create or update the NetworkPolicy associated with ip_map

func (*DNSResolverReconciler) Reconcile

func (r *DNSResolverReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile makes sure that each DNSResolver has an associated IPMap. It gets triggered by changes in DNSResolvers

func (*DNSResolverReconciler) SetupWithManager

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

type IPCacheT

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

IPCache keeps track of when an IP that is no longer seen should be removed from an IPMap

var IPCache IPCacheT

func (*IPCacheT) CleanUp

func (cache *IPCacheT) CleanUp(name types.NamespacedName)

Remove expired IPs from cache

func (*IPCacheT) Delete

func (cache *IPCacheT) Delete(name types.NamespacedName, ip string)

func (*IPCacheT) Get

func (cache *IPCacheT) Get(name types.NamespacedName, ip string) time.Time

Return the expiration time for an IPMap and IP if it exists, the zero time if not

func (*IPCacheT) NameExists

func (cache *IPCacheT) NameExists(name types.NamespacedName) bool

func (*IPCacheT) Set

func (cache *IPCacheT) Set(name types.NamespacedName, ip string, expires time.Time)

Jump to

Keyboard shortcuts

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