status

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package status is a generated GoMock package.

Index

Constants

View Source
const (
	PodmanEngine = "podman"

	CrioEngine = "crio"
)
View Source
const (
	// BootIDPath is the path to the boot ID file.
	DefaultBootIDPath = "/proc/sys/kernel/random/boot_id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	// Get returns the device status and is safe to call without a management client.
	Get(context.Context) *v1alpha1.DeviceStatus
}

type Container

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

Container collects container status.

func (*Container) CrioExport

func (c *Container) CrioExport(ctx context.Context, status *v1alpha1.DeviceStatus) error

func (*Container) Export

func (c *Container) Export(ctx context.Context, status *v1alpha1.DeviceStatus) error

func (*Container) PodmanExport

func (c *Container) PodmanExport(ctx context.Context, status *v1alpha1.DeviceStatus) error

func (*Container) SetProperties

func (c *Container) SetProperties(spec *v1alpha1.RenderedDeviceSpec)

type CrioContainerList

type CrioContainerList struct {
	Containers []CrioContainerListEntry `json:"containers"`
}

type CrioContainerListEntry

type CrioContainerListEntry struct {
	Id       string `json:"id"`
	Metadata struct {
		Name string `json:"name"`
	} `json:"metadata"`
	Image string `json:"imageRef"`
	State string `json:"state"`
}

type Exporter

type Exporter interface {
	// Export collects status information and updates the device status.
	Export(ctx context.Context, device *v1alpha1.DeviceStatus) error
	// SetProperties sets the properties for the exporter.
	SetProperties(*v1alpha1.RenderedDeviceSpec)
}

type Hooks

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

Hooks collects config hook status.

func (*Hooks) Export

func (s *Hooks) Export(ctx context.Context, status *v1alpha1.DeviceStatus) error

Export returns the status of the config hooks.

func (*Hooks) SetProperties

func (s *Hooks) SetProperties(spec *v1alpha1.RenderedDeviceSpec)

type Manager

type Manager interface {
	Collector
	// Sync collects status information from all exporters and updates the device status.
	Sync(context.Context) error
	// Collect gathers status information from all exporters and is safe to call without a management client.
	Collect(context.Context) error
	// Update updates the device status with the given update functions.
	Update(ctx context.Context, updateFuncs ...UpdateStatusFn) (*v1alpha1.DeviceStatus, error)
	// UpdateCondition updates the device status with the given condition.
	UpdateCondition(context.Context, v1alpha1.Condition) error
	// SetClient sets the management client for the status manager.
	SetClient(client.Management)
	// SetProperties sets the properties for the exporters.
	SetProperties(*v1alpha1.RenderedDeviceSpec)
}

type MockCollector

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

MockCollector is a mock of Collector interface.

func NewMockCollector

func NewMockCollector(ctrl *gomock.Controller) *MockCollector

NewMockCollector creates a new mock instance.

func (*MockCollector) EXPECT

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

func (*MockCollector) Get

Get mocks base method.

type MockCollectorMockRecorder

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

MockCollectorMockRecorder is the mock recorder for MockCollector.

func (*MockCollectorMockRecorder) Get

func (mr *MockCollectorMockRecorder) Get(arg0 any) *gomock.Call

Get indicates an expected call of Get.

type MockExporter

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

MockExporter is a mock of Exporter interface.

func NewMockExporter

func NewMockExporter(ctrl *gomock.Controller) *MockExporter

NewMockExporter creates a new mock instance.

func (*MockExporter) EXPECT

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

func (*MockExporter) Export

func (m *MockExporter) Export(ctx context.Context, device *v1alpha1.DeviceStatus) error

Export mocks base method.

func (*MockExporter) SetProperties

func (m *MockExporter) SetProperties(arg0 *v1alpha1.RenderedDeviceSpec)

SetProperties mocks base method.

type MockExporterMockRecorder

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

MockExporterMockRecorder is the mock recorder for MockExporter.

func (*MockExporterMockRecorder) Export

func (mr *MockExporterMockRecorder) Export(ctx, device any) *gomock.Call

Export indicates an expected call of Export.

func (*MockExporterMockRecorder) SetProperties

func (mr *MockExporterMockRecorder) SetProperties(arg0 any) *gomock.Call

SetProperties indicates an expected call of SetProperties.

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

func (m *MockManager) Collect(arg0 context.Context) error

Collect 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) Get

Get mocks base method.

func (*MockManager) SetClient

func (m *MockManager) SetClient(arg0 client.Management)

SetClient mocks base method.

func (*MockManager) SetProperties

func (m *MockManager) SetProperties(arg0 *v1alpha1.RenderedDeviceSpec)

SetProperties mocks base method.

func (*MockManager) Sync

func (m *MockManager) Sync(arg0 context.Context) error

Sync mocks base method.

func (*MockManager) Update

func (m *MockManager) Update(ctx context.Context, updateFuncs ...UpdateStatusFn) (*v1alpha1.DeviceStatus, error)

Update mocks base method.

func (*MockManager) UpdateCondition

func (m *MockManager) UpdateCondition(arg0 context.Context, arg1 v1alpha1.Condition) error

UpdateCondition mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) Collect

func (mr *MockManagerMockRecorder) Collect(arg0 any) *gomock.Call

Collect indicates an expected call of Collect.

func (*MockManagerMockRecorder) Get

func (mr *MockManagerMockRecorder) Get(arg0 any) *gomock.Call

Get indicates an expected call of Get.

func (*MockManagerMockRecorder) SetClient

func (mr *MockManagerMockRecorder) SetClient(arg0 any) *gomock.Call

SetClient indicates an expected call of SetClient.

func (*MockManagerMockRecorder) SetProperties

func (mr *MockManagerMockRecorder) SetProperties(arg0 any) *gomock.Call

SetProperties indicates an expected call of SetProperties.

func (*MockManagerMockRecorder) Sync

func (mr *MockManagerMockRecorder) Sync(arg0 any) *gomock.Call

Sync indicates an expected call of Sync.

func (*MockManagerMockRecorder) Update

func (mr *MockManagerMockRecorder) Update(ctx any, updateFuncs ...any) *gomock.Call

Update indicates an expected call of Update.

func (*MockManagerMockRecorder) UpdateCondition

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

UpdateCondition indicates an expected call of UpdateCondition.

type PodmanContainerList

type PodmanContainerList []PodmanContainerListEntry

type PodmanContainerListEntry

type PodmanContainerListEntry struct {
	Names    []string `json:"Names"`
	State    string   `json:"State"`
	Image    string   `json:"Image"`
	Id       string   `json:"Id"`
	ExitCode int      `json:"ExitCode"`
	Restarts int      `json:"Restarts"`
}

type Resources

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

func (*Resources) Export

func (r *Resources) Export(ctx context.Context, status *v1alpha1.DeviceStatus) error

func (*Resources) SetProperties

func (r *Resources) SetProperties(spec *v1alpha1.RenderedDeviceSpec)

type Shell

type Shell interface {
	Command(cmd string) (output []byte, err error)
}

type StatusManager

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

Collector aggregates device status from various exporters.

func NewManager

func NewManager(
	deviceName string,
	resourceManager resource.Manager,
	hookManager hook.Manager,
	executer executer.Executer,
	log *log.PrefixLogger,
) *StatusManager

NewManager creates a new device status manager.

func (*StatusManager) Collect

func (m *StatusManager) Collect(ctx context.Context) error

func (*StatusManager) Get

func (*StatusManager) SetClient

func (m *StatusManager) SetClient(managementClient client.Management)

func (*StatusManager) SetProperties

func (m *StatusManager) SetProperties(spec *v1alpha1.RenderedDeviceSpec)

func (*StatusManager) Sync

func (m *StatusManager) Sync(ctx context.Context) error

func (*StatusManager) Update

func (m *StatusManager) Update(ctx context.Context, updateFuncs ...UpdateStatusFn) (*v1alpha1.DeviceStatus, error)

func (*StatusManager) UpdateCondition

func (m *StatusManager) UpdateCondition(ctx context.Context, condition v1alpha1.Condition) error

type SystemD

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

SystemD collects systemd unit status as defined by match patterns.

func (*SystemD) Export

func (c *SystemD) Export(ctx context.Context, status *v1alpha1.DeviceStatus) error

func (*SystemD) SetProperties

func (c *SystemD) SetProperties(spec *v1alpha1.RenderedDeviceSpec)

type SystemDUnitList

type SystemDUnitList []SystemDUnitListEntry

type SystemDUnitListEntry

type SystemDUnitListEntry struct {
	Unit        string `json:"unit"`
	LoadState   string `json:"load"`
	ActiveState string `json:"active"`
	Sub         string `json:"sub"`
	Description string `json:"description"`
}

type SystemInfo

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

SystemInfo collects system information.

func (*SystemInfo) Export

func (s *SystemInfo) Export(ctx context.Context, status *v1alpha1.DeviceStatus) error

func (*SystemInfo) SetProperties

func (c *SystemInfo) SetProperties(spec *v1alpha1.RenderedDeviceSpec)

type UpdateStatusFn

type UpdateStatusFn func(status *v1alpha1.DeviceStatus) error

func SetConfig

func SetConfig(configStatus v1alpha1.DeviceConfigStatus) UpdateStatusFn

func SetDeviceSummary

func SetDeviceSummary(summaryStatus v1alpha1.DeviceSummaryStatus) UpdateStatusFn

func SetOSImage

func SetOSImage(osStatus v1alpha1.DeviceOSStatus) UpdateStatusFn

Jump to

Keyboard shortcuts

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