devices

package
v0.6.4-cnv-1.1-2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device interface {
	// Right now, including bridge/veth, only setup is needed, since veths are deleted if namespaces where they are part of are deleted
	Setup(vmi *v1.VirtualMachineInstance, hostNamespaces *isolation.IsolationResult, podNamespaces *isolation.IsolationResult) error

	// Available can be used to test if kernel modules, bridges, ... are present.
	// If nil is returned it is assumed that under normal conditions setting up the container would work
	Available() error
}

type HostBridge

type HostBridge struct {
}

func (HostBridge) Available

func (HostBridge) Available() error

func (HostBridge) Setup

func (HostBridge) Setup(vmi *v1.VirtualMachineInstance, hostNamespaces *isolation.IsolationResult, podNamespaces *isolation.IsolationResult) error

type KVM

type KVM struct {
	ClusterConfig *config.ClusterConfig
}

func (*KVM) Available

func (k *KVM) Available() error

func (*KVM) Setup

func (k *KVM) Setup(_ *v1.VirtualMachineInstance, hostNamespaces *isolation.IsolationResult, podNamespaces *isolation.IsolationResult) error

Setup creates /dev/kvm inside a container and sets the right permissions for qemu

type KernelDevice

type KernelDevice struct {
	// Major represent the major device number
	Major int64
	// Minor represents the minor device number
	Minor int64
}

func NewKernelDevice

func NewKernelDevice(major int64, minor int64) *KernelDevice

func (*KernelDevice) MKDev

func (k *KernelDevice) MKDev() int

type MockDevice

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

Mock of Device interface

func NewMockDevice

func NewMockDevice(ctrl *gomock.Controller) *MockDevice

func (*MockDevice) Available

func (_m *MockDevice) Available() error

func (*MockDevice) EXPECT

func (_m *MockDevice) EXPECT() *_MockDeviceRecorder

func (*MockDevice) Setup

func (_m *MockDevice) Setup(vmi *v1.VirtualMachineInstance, hostNamespaces *isolation.IsolationResult, podNamespaces *isolation.IsolationResult) error

type TUN

type TUN struct {
}

func (*TUN) Available

func (t *TUN) Available() error

func (*TUN) Setup

func (t *TUN) Setup(_ *v1.VirtualMachineInstance, hostNamespaces *isolation.IsolationResult, podNamespaces *isolation.IsolationResult) error

Setup creates /dev/net/tun inside the container to all tun/tap based operations on VMIs

Jump to

Keyboard shortcuts

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