logind

package
v1.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package logind provides D-Bus logind mock to facilitate graceful kubelet shutdown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBusBroker

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

DBusBroker implements simplified D-Bus broker which allows to connect kubelet D-Bus connection with Talos logind mock.

Broker doesn't actually implement auth, and it is supposed that service connects on one socket, while a client connects on another socket.

func NewBroker

func NewBroker(serviceSocketPath, clientSocketPath string) (*DBusBroker, error)

NewBroker initializes new broker.

func (*DBusBroker) Close

func (broker *DBusBroker) Close() error

Close the listen sockets.

func (*DBusBroker) Run

func (broker *DBusBroker) Run(ctx context.Context) error

Run the broker.

type ServiceMock

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

ServiceMock connects to the broker and mocks the D-Bus and logind.

func NewServiceMock

func NewServiceMock(socketPath string) (*ServiceMock, error)

NewServiceMock initializes the D-Bus and logind mock.

func (*ServiceMock) Close

func (mock *ServiceMock) Close() error

Close the connection.

func (*ServiceMock) EmitShutdown

func (mock *ServiceMock) EmitShutdown() error

EmitShutdown notifies about the shutdown.

func (*ServiceMock) WaitLockRelease

func (mock *ServiceMock) WaitLockRelease(ctx context.Context) error

WaitLockRelease waits for the inhibit lock to be released.

Jump to

Keyboard shortcuts

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