container

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParsingImage = fmt.Errorf("unable to parse image reference into a valid bootc target")

Functions

func ImageToBootcTarget added in v0.4.0

func ImageToBootcTarget(image string) (string, error)

Bootc does not accept images with tags AND digests specified - in the case when we get both we will use the image digest.

Related underlying issue: https://github.com/containers/image/issues/1736

func IsOsImageReconciled

func IsOsImageReconciled(host *BootcHost, desiredSpec *v1alpha1.DeviceSpec) (bool, error)

IsOsImageReconciled returns true if the booted image equals the target for the spec image.

Types

type BootcClient

type BootcClient interface {
	// Status returns the current bootc status.
	Status(ctx context.Context) (*BootcHost, error)
	// Switch targets a new container image reference to boot.
	Switch(ctx context.Context, image string) error
	// UsrOverlay adds a transient writable overlayfs on `/usr` that will be discarded on reboot.
	UsrOverlay(ctx context.Context) error
	// Apply restart or reboot into the new target image.
	Apply(ctx context.Context) error
}

type BootcHost

type BootcHost struct {
	APIVersion string   `json:"apiVersion"`
	Kind       string   `json:"kind"`
	Metadata   Metadata `json:"metadata"`
	Spec       Spec     `json:"spec"`
	Status     Status   `json:"status"`
}

func (*BootcHost) GetBootedImage

func (b *BootcHost) GetBootedImage() string

func (*BootcHost) GetBootedImageDigest added in v0.3.0

func (b *BootcHost) GetBootedImageDigest() string

func (*BootcHost) GetRollbackImage

func (b *BootcHost) GetRollbackImage() string

func (*BootcHost) GetStagedImage

func (b *BootcHost) GetStagedImage() string

type ImageDetails

type ImageDetails struct {
	Image       ImageSpec `json:"image"`
	ImageDigest string    `json:"imageDigest"`
}

type ImageSpec

type ImageSpec struct {
	Image string `json:"image"`
}

type ImageStatus

type ImageStatus struct {
	Image ImageDetails `json:"image"`
}

type Metadata

type Metadata struct {
	Name string `json:"name"`
}

type Spec

type Spec struct {
	Image ImageSpec `json:"image"`
}

type Status

type Status struct {
	Staged   ImageStatus `json:"staged"`
	Booted   ImageStatus `json:"booted"`
	Rollback ImageStatus `json:"rollback"`
	Type     string      `json:"type"`
}

Jump to

Keyboard shortcuts

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