bootc

package
v0.0.0-...-2e6cce1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootEntry

type BootEntry struct {
	Image             *ImageStatus   `json:"image"`
	CachedUpdate      *ImageStatus   `json:"cachedUpdate"`
	Incompatible      bool           `json:"incompatible"`
	Pinned            bool           `json:"pinned"`
	SoftRebootCapable bool           `json:"softRebootCapable"`
	DownloadOnly      bool           `json:"downloadOnly"`
	Store             *string        `json:"store"`
	Ostree            *OstreeInfo    `json:"ostree"`
	Composefs         *ComposefsInfo `json:"composefs"`
}

BootEntry represents a single boot entry (booted, staged, or rollback).

type ComposefsInfo

type ComposefsInfo struct {
	Verity               string  `json:"verity"`
	BootType             string  `json:"bootType"`
	Bootloader           string  `json:"bootloader"`
	BootDigest           *string `json:"bootDigest"`
	MissingVerityAllowed bool    `json:"missingVerityAllowed"`
}

ComposefsInfo holds composefs-specific metadata.

type Executor

type Executor interface {
	Status(ctx context.Context) ([]byte, error)
	Stage(ctx context.Context, image string) error
	Reboot(ctx context.Context) error
}

Executor abstracts the execution of bootc commands on the host. The real implementation uses nsenter to enter the host's mount and PID namespaces. Tests can provide a fake implementation.

type FilesystemOverlay

type FilesystemOverlay struct {
	AccessMode  string `json:"accessMode"`
	Persistence string `json:"persistence"`
}

FilesystemOverlay describes a /usr overlay state.

type HostExecutor

type HostExecutor struct{}

HostExecutor runs bootc commands on the host via nsenter. It requires hostPID: true and privileged: true in the pod spec.

func NewHostExecutor

func NewHostExecutor() *HostExecutor

func (*HostExecutor) Reboot

func (e *HostExecutor) Reboot(ctx context.Context) error

func (*HostExecutor) Stage

func (e *HostExecutor) Stage(ctx context.Context, image string) error

func (*HostExecutor) Status

func (e *HostExecutor) Status(ctx context.Context) ([]byte, error)

type ImageReference

type ImageReference struct {
	Image     string          `json:"image"`
	Transport string          `json:"transport"`
	Signature *ImageSignature `json:"signature,omitempty"`
}

ImageReference holds the transport and image pullspec.

type ImageSignature

type ImageSignature struct {
	OstreeRemote    *string `json:"ostreeRemote,omitempty"`
	ContainerPolicy *bool   `json:"containerPolicy,omitempty"`
	Insecure        *bool   `json:"insecure,omitempty"`
}

ImageSignature describes the signature verification policy.

type ImageStatus

type ImageStatus struct {
	Image        ImageReference `json:"image"`
	Version      *string        `json:"version"`
	Timestamp    *time.Time     `json:"timestamp"`
	ImageDigest  string         `json:"imageDigest"`
	Architecture string         `json:"architecture"`
}

ImageStatus describes the image in a boot entry.

type OstreeInfo

type OstreeInfo struct {
	Stateroot    string `json:"stateroot"`
	Checksum     string `json:"checksum"`
	DeploySerial int    `json:"deploySerial"`
}

OstreeInfo holds OSTree-specific metadata.

type Status

type Status struct {
	APIVersion string     `json:"apiVersion"`
	Kind       string     `json:"kind"`
	Spec       StatusSpec `json:"spec"`
	Status     StatusBody `json:"status"`
}

Status represents the top-level bootc status --json output.

func ParseStatus

func ParseStatus(data []byte) (*Status, error)

ParseStatus parses raw bootc status --json output.

type StatusBody

type StatusBody struct {
	Staged           *BootEntry         `json:"staged"`
	Booted           *BootEntry         `json:"booted"`
	Rollback         *BootEntry         `json:"rollback"`
	OtherDeployments []BootEntry        `json:"otherDeployments,omitempty"`
	RollbackQueued   bool               `json:"rollbackQueued"`
	Type             *string            `json:"type"`
	UsrOverlay       *FilesystemOverlay `json:"usrOverlay"`
}

StatusBody is the status section of bootc status output.

type StatusSpec

type StatusSpec struct {
	Image     *ImageReference `json:"image"`
	BootOrder string          `json:"bootOrder"`
}

StatusSpec is the spec section of bootc status output.

Jump to

Keyboard shortcuts

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