container

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package container is a generated GoMock package.

Index

Constants

View Source
const (
	CmdBootc = "bootc"
)

Variables

This section is empty.

Functions

func IsOsImageDirty

func IsOsImageDirty(host *BootcHost) bool

IsOsImageDirty returns true if the booted image does not equal the spec image.

func IsOsImageReconciled

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

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

Types

type BootcClient

type BootcClient interface {
	Status(ctx context.Context) (*BootcHost, error)
	Switch(ctx context.Context, image string) error
	Apply(ctx context.Context) error
	UsrOverlay(ctx context.Context) error
}

type BootcCmd

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

func NewBootcCmd

func NewBootcCmd(executer executer.Executer) *BootcCmd

NewBootcCmd creates a new bootc command.

func (*BootcCmd) Apply

func (b *BootcCmd) Apply(ctx context.Context) error

Apply restart or reboot into the new target image.

func (*BootcCmd) Status

func (b *BootcCmd) Status(ctx context.Context) (*BootcHost, error)

Status returns the current bootc host status.

func (*BootcCmd) Switch

func (b *BootcCmd) Switch(ctx context.Context, image string) error

Switch pulls the specified image and stages it for the next boot while retaining a copy of the most recently booted image. The status will be updated in logger.

func (*BootcCmd) UsrOverlay

func (b *BootcCmd) UsrOverlay(ctx context.Context) error

UsrOverlay adds a transient writable overlayfs on `/usr` that will be discarded on reboot.

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) GetRollbackImage

func (b *BootcHost) GetRollbackImage() string

func (*BootcHost) GetStagedImage

func (b *BootcHost) GetStagedImage() string

type ImageDetails

type ImageDetails struct {
	Image       ImageSpec `json:"image"`
	Version     string    `json:"version"`
	Timestamp   string    `json:"timestamp"`
	ImageDigest string    `json:"imageDigest"`
}

type ImageSpec

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

type ImageStatus

type ImageStatus struct {
	Image        ImageDetails  `json:"image"`
	CachedUpdate *bool         `json:"cachedUpdate"`
	Incompatible bool          `json:"incompatible"`
	Pinned       bool          `json:"pinned"`
	Ostree       OstreeDetails `json:"ostree"`
}

type Metadata

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

type MockBootcClient

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

MockBootcClient is a mock of BootcClient interface.

func NewMockBootcClient

func NewMockBootcClient(ctrl *gomock.Controller) *MockBootcClient

NewMockBootcClient creates a new mock instance.

func (*MockBootcClient) Apply

func (m *MockBootcClient) Apply(ctx context.Context) error

Apply mocks base method.

func (*MockBootcClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBootcClient) Status

func (m *MockBootcClient) Status(ctx context.Context) (*BootcHost, error)

Status mocks base method.

func (*MockBootcClient) Switch

func (m *MockBootcClient) Switch(ctx context.Context, image string) error

Switch mocks base method.

func (*MockBootcClient) UsrOverlay

func (m *MockBootcClient) UsrOverlay(ctx context.Context) error

UsrOverlay mocks base method.

type MockBootcClientMockRecorder

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

MockBootcClientMockRecorder is the mock recorder for MockBootcClient.

func (*MockBootcClientMockRecorder) Apply

func (mr *MockBootcClientMockRecorder) Apply(ctx any) *gomock.Call

Apply indicates an expected call of Apply.

func (*MockBootcClientMockRecorder) Status

func (mr *MockBootcClientMockRecorder) Status(ctx any) *gomock.Call

Status indicates an expected call of Status.

func (*MockBootcClientMockRecorder) Switch

func (mr *MockBootcClientMockRecorder) Switch(ctx, image any) *gomock.Call

Switch indicates an expected call of Switch.

func (*MockBootcClientMockRecorder) UsrOverlay

func (mr *MockBootcClientMockRecorder) UsrOverlay(ctx any) *gomock.Call

UsrOverlay indicates an expected call of UsrOverlay.

type OstreeDetails

type OstreeDetails struct {
	Checksum     string `json:"checksum"`
	DeploySerial int    `json:"deploySerial"`
}

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