iso

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendReader

type BackendReader interface {
	// Read data (from a backend) based on a mac address
	// and return DHCP headers and options, including netboot info.
	GetByMac(context.Context, net.HardwareAddr) (*data.DHCP, *data.Netboot, error)
}

BackendReader is an interface that defines the method to read data from a backend.

type Handler

type Handler struct {
	Backend           BackendReader
	ExtraKernelParams []string
	Logger            logr.Logger
	// MagicString is the string pattern that will be matched
	// in the source iso before patching. The field can be set
	// during build time by setting this field.
	// Ref: https://github.com/tinkerbell/hook/blob/main/linuxkit-templates/hook.template.yaml
	MagicString string
	// SourceISO is the source url where the unmodified iso lives.
	// It must be a valid url.URL{} object and must have a url.URL{}.Scheme of HTTP or HTTPS.
	SourceISO          string
	Syslog             string
	TinkServerTLS      bool
	TinkServerGRPCAddr string
	StaticIPAMEnabled  bool
	// contains filtered or unexported fields
}

Handler is a struct that contains the necessary fields to patch an ISO file with relevant information for the Tink worker.

func (*Handler) Copy added in v0.15.1

func (h *Handler) Copy(ctx context.Context, dst io.Writer, src io.Reader, buf []byte) (int64, error)

Copy implements the internal.CopyBuffer interface. This implementation allows us to inspect and patch content on its way to the client without buffering the entire response in memory. This allows memory use to be constant regardless of the size of the response.

func (*Handler) HandlerFunc

func (h *Handler) HandlerFunc() (http.HandlerFunc, error)

HandlerFunc returns a reverse proxy HTTP handler function that performs ISO patching.

func (*Handler) RoundTrip

func (h *Handler) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip is a method on the Handler struct that implements the http.RoundTripper interface. This method is called by the internal.NewSingleHostReverseProxy to handle the incoming request. The method is responsible for validating the incoming request and getting the source ISO.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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