ipxe

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package ipxe provides iPXE functionality.

Package ipxe provides iPXE functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootFromDiskMethod

type BootFromDiskMethod string

BootFromDiskMethod defines a way to boot from disk.

const (
	// BootIPXEExit is a method to boot from disk using iPXE script with `exit` command.
	BootIPXEExit BootFromDiskMethod = "ipxe-exit"

	// Boot404 is a method to boot from disk using HTTP 404 response to iPXE.
	Boot404 BootFromDiskMethod = "http-404"

	// BootSANDisk is a method to boot from disk using iPXE script with `sanboot` command.
	BootSANDisk BootFromDiskMethod = "ipxe-sanboot"
)

type Handler

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

Handler represents an iPXE handler.

func NewHandler

func NewHandler(imageFactoryClient ImageFactoryClient, state state.State, options HandlerOptions, logger *zap.Logger) (*Handler, error)

NewHandler creates a new iPXE server.

func (*Handler) ServeHTTP

func (handler *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP serves the iPXE request.

URL pattern: http://ip-of-this-provider:50042/ipxe?uuid=${uuid}&mac=${net${idx}/mac:hexhyp}&domain=${domain}&hostname=${hostname}&serial=${serial}&arch=${buildarch}

Implements http.Handler interface.

type HandlerOptions

type HandlerOptions struct {
	APIAdvertiseAddress string
	BootFromDiskMethod  string
	APIPort             int
	UseLocalBootAssets  bool
	AgentTestMode       bool
}

HandlerOptions represents the options for the iPXE handler.

type ImageFactoryClient

type ImageFactoryClient interface {
	SchematicIPXEURL(ctx context.Context, agentMode bool, talosVersion, arch string, extensions, extraKernelArgs []string) (string, error)
}

ImageFactoryClient represents an image factory client which ensures a schematic exists on image factory, and returns the PXE URL to it.

Jump to

Keyboard shortcuts

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