dnsnameresolver

package
v0.0.0-...-623431e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(mgr manager.Manager, config Config) (controller.Controller, error)

NewUnmanaged creates and returns a controller that watches DNSNameResolver objects. The controller re-resolves the DNS names which get added to the status of the DNSNameResolver objects. It also removes IP addresses of DNS names, whose TTLs have expired, from the status.

Types

type Config

type Config struct {
	OperandNamespace         string
	ServiceName              string
	DNSPort                  string
	DNSNameResolverNamespace string
}

type Resolver

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

Resolver keeps track of the DNS names, the corresponding IP addresses and TTLs. It sends DNS resolution requests to CoreDNS pods whenever TTL of any IP address associated to a DNS name expires.

func NewResolver

func NewResolver(cache cache.Cache, port string) *Resolver

NewResolver initializes and returns a new resolver instance.

func (*Resolver) AddResolvedName

func (resolver *Resolver) AddResolvedName(dnsDetails dnsDetails)

AddResolvedName is called whenever a DNSNameResolver object is added or updated.

func (*Resolver) DeleteResolvedName

func (resolver *Resolver) DeleteResolvedName(dnsDetails dnsDetails)

DeleteResolvedName is called whenever a DNSNameResolver object is deleted.

func (*Resolver) Start

func (resolver *Resolver) Start()

Start starts a goroutine for sending DNS lookup requests of the DNS names on expiration of the corresponding TTLs.

Jump to

Keyboard shortcuts

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