Documentation ¶
Index ¶
- type MockProvider
- func (p *MockProvider) Capacity() v1.ResourceList
- func (p *MockProvider) CreatePod(pod *v1.Pod) error
- func (p *MockProvider) DeletePod(pod *v1.Pod) (err error)
- func (p *MockProvider) GetContainerLogs(namespace, podName, containerName string, tail int) (string, error)
- func (p *MockProvider) GetPod(namespace, name string) (pod *v1.Pod, err error)
- func (p *MockProvider) GetPodStatus(namespace, name string) (*v1.PodStatus, error)
- func (p *MockProvider) GetPods() ([]*v1.Pod, error)
- func (p *MockProvider) NodeAddresses() []v1.NodeAddress
- func (p *MockProvider) NodeConditions() []v1.NodeCondition
- func (p *MockProvider) NodeDaemonEndpoints() *v1.NodeDaemonEndpoints
- func (p *MockProvider) OperatingSystem() string
- func (p *MockProvider) UpdatePod(pod *v1.Pod) error
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.