mock

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProvider

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

MockProvider implements the virtual-kubelet provider interface and stores pods in memory.

func NewMockProvider

func NewMockProvider(nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*MockProvider, error)

NewMockProvider creates a new MockProvider

func (*MockProvider) Capacity

func (p *MockProvider) Capacity() v1.ResourceList

Capacity returns a resource list containing the capacity limits.

func (*MockProvider) CreatePod

func (p *MockProvider) CreatePod(pod *v1.Pod) error

CreatePod accepts a Pod definition and stores it in memory.

func (*MockProvider) DeletePod

func (p *MockProvider) DeletePod(pod *v1.Pod) (err error)

DeletePod deletes the specified pod out of memory.

func (*MockProvider) GetContainerLogs

func (p *MockProvider) GetContainerLogs(namespace, podName, containerName string, tail int) (string, error)

GetContainerLogs retrieves the logs of a container by name from the provider.

func (*MockProvider) GetPod

func (p *MockProvider) GetPod(namespace, name string) (pod *v1.Pod, err error)

GetPod returns a pod by name that is stored in memory.

func (*MockProvider) GetPodStatus

func (p *MockProvider) GetPodStatus(namespace, name string) (*v1.PodStatus, error)

GetPodStatus returns the status of a pod by name that is "running". returns nil if a pod by that name is not found.

func (*MockProvider) GetPods

func (p *MockProvider) GetPods() ([]*v1.Pod, error)

GetPods returns a list of all pods known to be "running".

func (*MockProvider) NodeAddresses

func (p *MockProvider) NodeAddresses() []v1.NodeAddress

NodeAddresses returns a list of addresses for the node status within Kubernetes.

func (*MockProvider) NodeConditions

func (p *MockProvider) NodeConditions() []v1.NodeCondition

NodeConditions returns a list of conditions (Ready, OutOfDisk, etc), for updates to the node status within Kubernetes.

func (*MockProvider) NodeDaemonEndpoints

func (p *MockProvider) NodeDaemonEndpoints() *v1.NodeDaemonEndpoints

NodeDaemonEndpoints returns NodeDaemonEndpoints for the node status within Kubernetes.

func (*MockProvider) OperatingSystem

func (p *MockProvider) OperatingSystem() string

OperatingSystem returns the operating system for this provider. This is a noop to default to Linux for now.

func (*MockProvider) UpdatePod

func (p *MockProvider) UpdatePod(pod *v1.Pod) error

UpdatePod accepts a Pod definition and updates its reference.

Jump to

Keyboard shortcuts

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