os

package
v1.4.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 20 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 os is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDeltaSystemInfo added in v1.4.0

func ApplyDeltaSystemInfo(info *v1beta1.DeviceSystemInfo, caps Capabilities)

ApplyDeltaSystemInfo populates the capability-derived fields of the device system info: OCI delta eligibility, the bootc and oci-delta tool versions, and the OS management mode. OsMode is only reported when it is a recognized mode; when the mode is unknown the field is cleared so any stale value is omitted from status.

Types

type Capabilities added in v1.4.0

type Capabilities struct {
	OsMode          v1beta1.OsModeType
	DeltaEligible   bool
	BootcVersion    string
	OCIDeltaVersion string
}

type Client

type Client interface {
	// Status retrieves the current OS status
	Status(ctx context.Context) (*Status, error)
	// Switch prepares the system to switch to the specified OS image
	Switch(ctx context.Context, image string) error
	// SwitchOCI stages a reconstructed OCI layout directory for the next boot.
	SwitchOCI(ctx context.Context, layoutDir string) error
	// SwitchRegistry stages the registry image so bootc records the spec name.
	SwitchRegistry(ctx context.Context, image string) error
	// Rollback stages the previous deployment and reboots into it
	Rollback(ctx context.Context) error
	// Apply applies the OS changes, potentially triggering a reboot
	Apply(ctx context.Context) error
	// Capabilities reports OS mode, tool versions, and whether this device can consume OCI deltas.
	Capabilities(ctx context.Context) Capabilities
	// RebootStaged reboots into an already staged deployment without fetching.
	RebootStaged(ctx context.Context) error
}

func NewClient

func NewClient(log *log.PrefixLogger, exec executer.Executer) Client

type Manager

type Manager interface {
	BeforeUpdate(ctx context.Context, current, desired *v1beta1.DeviceSpec) error
	AfterUpdate(ctx context.Context, desired *v1beta1.DeviceSpec) error
	// Rollback validates that the rollback deployment matches the expected image
	// from the spec, then stages the previous deployment and reboots into it.
	Rollback(ctx context.Context, desired *v1beta1.DeviceSpec) error
	Reboot(ctx context.Context, desired *v1beta1.DeviceSpec) error

	dependency.OCICollector
	status.Exporter
}

func NewManager

func NewManager(
	log *log.PrefixLogger,
	client Client,
	caps Capabilities,
	readWriter fileio.ReadWriter,
	podmanClient *client.Podman,
	pullConfigResolver dependency.PullConfigResolver,
	ociDelta *client.OCIDelta,
	skopeo *client.Skopeo,
	pullTimeout time.Duration,
	opts ...Option,
) Manager

NewManager creates a new OS manager.

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Apply

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

Apply mocks base method.

func (*MockClient) Capabilities added in v1.4.0

func (m *MockClient) Capabilities(ctx context.Context) Capabilities

Capabilities mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) RebootStaged added in v1.4.0

func (m *MockClient) RebootStaged(ctx context.Context) error

RebootStaged mocks base method.

func (*MockClient) Rollback added in v1.2.0

func (m *MockClient) Rollback(ctx context.Context) error

Rollback mocks base method.

func (*MockClient) Status

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

Status mocks base method.

func (*MockClient) Switch

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

Switch mocks base method.

func (*MockClient) SwitchOCI added in v1.4.0

func (m *MockClient) SwitchOCI(ctx context.Context, layoutDir string) error

SwitchOCI mocks base method.

func (*MockClient) SwitchRegistry added in v1.4.0

func (m *MockClient) SwitchRegistry(ctx context.Context, image string) error

SwitchRegistry mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Apply

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

Apply indicates an expected call of Apply.

func (*MockClientMockRecorder) Capabilities added in v1.4.0

func (mr *MockClientMockRecorder) Capabilities(ctx any) *gomock.Call

Capabilities indicates an expected call of Capabilities.

func (*MockClientMockRecorder) RebootStaged added in v1.4.0

func (mr *MockClientMockRecorder) RebootStaged(ctx any) *gomock.Call

RebootStaged indicates an expected call of RebootStaged.

func (*MockClientMockRecorder) Rollback added in v1.2.0

func (mr *MockClientMockRecorder) Rollback(ctx any) *gomock.Call

Rollback indicates an expected call of Rollback.

func (*MockClientMockRecorder) Status

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

Status indicates an expected call of Status.

func (*MockClientMockRecorder) Switch

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

Switch indicates an expected call of Switch.

func (*MockClientMockRecorder) SwitchOCI added in v1.4.0

func (mr *MockClientMockRecorder) SwitchOCI(ctx, layoutDir any) *gomock.Call

SwitchOCI indicates an expected call of SwitchOCI.

func (*MockClientMockRecorder) SwitchRegistry added in v1.4.0

func (mr *MockClientMockRecorder) SwitchRegistry(ctx, image any) *gomock.Call

SwitchRegistry indicates an expected call of SwitchRegistry.

type MockManager

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

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) AfterUpdate

func (m *MockManager) AfterUpdate(ctx context.Context, desired *v1beta1.DeviceSpec) error

AfterUpdate mocks base method.

func (*MockManager) BeforeUpdate

func (m *MockManager) BeforeUpdate(ctx context.Context, current, desired *v1beta1.DeviceSpec) error

BeforeUpdate mocks base method.

func (*MockManager) CollectOCITargets added in v0.9.0

func (m *MockManager) CollectOCITargets(ctx context.Context, current, desired *v1beta1.DeviceSpec, opts ...dependency.OCICollectOpt) (*dependency.OCICollection, error)

CollectOCITargets mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

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

func (*MockManager) Reboot

func (m *MockManager) Reboot(ctx context.Context, desired *v1beta1.DeviceSpec) error

Reboot mocks base method.

func (*MockManager) Rollback added in v1.2.0

func (m *MockManager) Rollback(ctx context.Context, desired *v1beta1.DeviceSpec) error

Rollback mocks base method.

func (*MockManager) Status

func (m *MockManager) Status(arg0 context.Context, arg1 *v1beta1.DeviceStatus, arg2 ...status.CollectorOpt) error

Status mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) AfterUpdate

func (mr *MockManagerMockRecorder) AfterUpdate(ctx, desired any) *gomock.Call

AfterUpdate indicates an expected call of AfterUpdate.

func (*MockManagerMockRecorder) BeforeUpdate

func (mr *MockManagerMockRecorder) BeforeUpdate(ctx, current, desired any) *gomock.Call

BeforeUpdate indicates an expected call of BeforeUpdate.

func (*MockManagerMockRecorder) CollectOCITargets added in v0.9.0

func (mr *MockManagerMockRecorder) CollectOCITargets(ctx, current, desired any, opts ...any) *gomock.Call

CollectOCITargets indicates an expected call of CollectOCITargets.

func (*MockManagerMockRecorder) Reboot

func (mr *MockManagerMockRecorder) Reboot(ctx, desired any) *gomock.Call

Reboot indicates an expected call of Reboot.

func (*MockManagerMockRecorder) Rollback added in v1.2.0

func (mr *MockManagerMockRecorder) Rollback(ctx, desired any) *gomock.Call

Rollback indicates an expected call of Rollback.

func (*MockManagerMockRecorder) Status

func (mr *MockManagerMockRecorder) Status(arg0, arg1 any, arg2 ...any) *gomock.Call

Status indicates an expected call of Status.

type Option added in v1.4.0

type Option func(*manager)

Option configures optional OS manager integrations.

func WithDeltaStatusStore added in v1.4.0

func WithDeltaStatusStore(store *deltastatus.Store) Option

WithDeltaStatusStore persists OS delta outcomes across agent restarts.

type Status

type Status struct {
	container.BootcHost
}

Jump to

Keyboard shortcuts

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