shim

package
v1.2.8-k3s.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnonDialer

func AnonDialer(address string, timeout time.Duration) (net.Conn, error)

AnonDialer returns a dialer for an abstract socket

func BinaryName

func BinaryName(runtime string) string

BinaryName returns the shim binary name from the runtime name, empty string returns means runtime name is invalid

func Command

func Command(ctx context.Context, runtime, containerdAddress, path string, cmdArgs ...string) (*exec.Cmd, error)

Command returns the shim command with the provided args and configuration

func Connect

func Connect(address string, d func(string, time.Duration) (net.Conn, error)) (net.Conn, error)

Connect to the provided address

func NewSocket

func NewSocket(address string) (*net.UnixListener, error)

NewSocket returns a new socket

func Run

func Run(id string, initFunc Init)

Run initializes and runs a shim server

func SetScore

func SetScore(pid int) error

SetScore sets the oom score for a process

func SocketAddress

func SocketAddress(ctx context.Context, id string) (string, error)

SocketAddress returns an abstract socket address

func WriteAddress

func WriteAddress(path, address string) error

WriteAddress writes a address file atomically

func WritePidFile

func WritePidFile(path string, pid int) error

WritePidFile writes a pid file atomically

Types

type Client

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

Client for a shim server

func NewShimClient

func NewShimClient(ctx context.Context, svc shimapi.TaskService, signals chan os.Signal) *Client

NewShimClient creates a new shim server client

func (*Client) Serve

func (s *Client) Serve() error

Serve the shim server

type Init

Init func for the creation of a shim server

type Opts

type Opts struct {
	BundlePath string
	Debug      bool
}

Opts are context options associated with the shim invocation.

type OptsKey

type OptsKey struct{}

OptsKey is the context key for the Opts value.

type Shim

type Shim interface {
	shimapi.TaskService
	Cleanup(ctx context.Context) (*shimapi.DeleteResponse, error)
	StartShim(ctx context.Context, id, containerdBinary, containerdAddress string) (string, error)
}

Shim server interface

Jump to

Keyboard shortcuts

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