Help us shape the future of Go! Take the 2026 Go Developer Survey

hostnameresolver

package
v1.154.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostResolver

type HostResolver interface {
	HasSynced() bool
	Subset() []corev1.EndpointSubset
}

HostResolver is used for getting endpoint subsets with resolved IPs.

type Provider

type Provider interface {
	HasSynced() bool
	Start(ctx context.Context) error
	WithCallback(onUpdate func())
	HostResolver
}

Provider allows to start and attach callbacks for a specific host resolution updates.

func CreateForCluster

func CreateForCluster(restConfig *rest.Config, log logr.Logger) (Provider, error)

CreateForCluster tries to use the hostname and port from the client to create the provider. If that fails, then tries to use the KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT environment variable. If that fails it fallbacks to NoOpProvider().

func NewNoOpProvider

func NewNoOpProvider() Provider

NewNoOpProvider returns a no-op Provider.

func NewProvider

func NewProvider(host string, port string, log logr.Logger, resync time.Duration) Provider

NewProvider returns a Provider for a specific host and port with resync indicating how often the hostname resolution is happening.

Jump to

Keyboard shortcuts

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