commands

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultNetbootImage = "netboot:latest"

DefaultNetbootImage is the default netboot OCI image used when a Machine omits spec.host.netboot.netbootImage. It is set at build time via -ldflags.

Functions

func BuildScheme

func BuildScheme() *runtime.Scheme

func DefaultCacheDir

func DefaultCacheDir() string

func InterfaceForIP

func InterfaceForIP(ip net.IP) (string, error)

InterfaceForIP returns the name of the network interface that holds the given IP address.

func InterfaceIPv4

func InterfaceIPv4(name string) (net.IP, error)

func LeaderElectionID

func LeaderElectionID(site string) string

func OutboundIP

func OutboundIP() (net.IP, error)

func PrintConfig

func PrintConfig(key, value string)

func PrintReady

func PrintReady()

func PrintService

func PrintService(protocol, address string)

func PrintStep

func PrintStep(msg string)

func ServePXECmd

func ServePXECmd() *cobra.Command

ServePXECmd returns a cobra.Command that runs PXE servers and the BMC control loop.

func SiteSelector

func SiteSelector(site string) (labels.Selector, error)

Types

type ClusterInfoWatcher

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

ClusterInfoWatcher watches the cluster-info ConfigMap in the kube-public namespace and provides up-to-date API server URL and CA certificate to the FileResolver through the ClusterInfoProvider interface.

It combines an informer for prompt pickup where cluster-info is published with a periodic re-resolve (clusterInfoPollInterval) as a provider-agnostic floor: clusters that do not publish cluster-info (e.g. AKS) deliver no ConfigMap event, and in-cluster service-account CA rotation is a file change the ConfigMap informer cannot observe, so the poll keeps the CA current on every cluster. When the operator injects METALMAN_APISERVER_URL the served URL is pinned to that value and only the CA is refreshed; without an override the cluster-info URL is refreshed too.

func NewClusterInfoWatcher

func NewClusterInfoWatcher(
	ctx context.Context,
	clientset kubernetes.Interface,
	log *slog.Logger,
) (*ClusterInfoWatcher, error)

NewClusterInfoWatcher creates a watcher that resolves the API server URL and CA certificate from the cluster-info ConfigMap in kube-public. It performs an initial synchronous resolve so that values are available before the first template render.

If the METALMAN_APISERVER_URL environment variable is set, its value overrides the API server URL from the ConfigMap on every refresh. When cluster-info is unavailable (e.g. AKS), the API server URL comes from that override and the CA from the in-cluster service-account mount.

func (*ClusterInfoWatcher) ClusterInfo

func (w *ClusterInfoWatcher) ClusterInfo() netboot.ClusterInfo

ClusterInfo returns the current cluster-info snapshot. Safe for concurrent use.

func (*ClusterInfoWatcher) Start

func (w *ClusterInfoWatcher) Start(ctx context.Context) error

Start implements manager.Runnable. It watches the cluster-info ConfigMap in kube-public for prompt updates and, on a fixed interval, re-resolves the API server URL and CA certificate regardless of provider.

type StatusUpdater

type StatusUpdater struct {
	Client client.Client
}

StatusUpdater implements attestation.StatusUpdater using a controller-runtime client.

func (*StatusUpdater) Update

func (u *StatusUpdater) Update(ctx context.Context, node *v1alpha3.Machine) error

Jump to

Keyboard shortcuts

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