configmapmanager

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(dnsEntry DNSEntry) (string, error)

Types

type ConfigMapClient added in v1.1.1

type ConfigMapClient interface {
	Get(ctx context.Context) (*v1.ConfigMap, error)
	Update(ctx context.Context, cfg *v1.ConfigMap) error
}

ConfigMapClient is an abstraction over different ways to interact with a ConfigMap.

type DNSEntry

type DNSEntry struct {
	PodName string
	Network string
	Scope   string
}

type DNSManager added in v1.1.1

type DNSManager interface {
	GetConfigMap(ctx context.Context) (*v1.ConfigMap, error)
	AddDNSEntryToConfigMap(ctx context.Context, updatedData map[string]string) error
	RemoveDNSRecords(ctx context.Context, removals map[string][]string) error
	ListDNSRecords(ctx context.Context) (map[string][]string, error)
	AddDNSEntry(ctx context.Context, dnsName, ipAddress string) error
	RemoveDNSEntry(ctx context.Context, key string) error
	AddServerToConfigMap(ctx context.Context, domainName, serverDomain, serverPort string) error
}

DNSManager defines the interface for managing CoreDNS ConfigMaps.

func NewDNSManager added in v1.1.1

func NewDNSManager(namespace, configMap string, k8sConfig *rest.Config, crClient client.Client) (DNSManager, error)

NewDNSManager is the factory function that creates a DNSManager. If crClient is provided (non-nil), it uses the controller-runtime client; otherwise, it falls back to using the standard Kubernetes clientset.

Jump to

Keyboard shortcuts

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