Documentation ¶
Index ¶
- type MockConfig
- type MockProvider
- func (p *MockProvider) Capacity(ctx context.Context) v1.ResourceList
- func (p *MockProvider) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *MockProvider) DeletePod(ctx context.Context, pod *v1.Pod) (err error)
- func (p *MockProvider) ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, ...) error
- func (p *MockProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, tail int) (string, error)
- func (p *MockProvider) GetPod(ctx context.Context, namespace, name string) (pod *v1.Pod, err error)
- func (p *MockProvider) GetPodFullName(namespace string, pod string) string
- func (p *MockProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *MockProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *MockProvider) GetStatsSummary(ctx context.Context) (*stats.Summary, error)
- func (p *MockProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
- func (p *MockProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
- func (p *MockProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
- func (p *MockProvider) OperatingSystem() string
- func (p *MockProvider) UpdatePod(ctx context.Context, pod *v1.Pod) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockConfig ¶ added in v0.4.1
type MockConfig struct { CPU string `json:"cpu,omitempty"` Memory string `json:"memory,omitempty"` Pods string `json:"pods,omitempty"` }
MockConfig contains a mock virtual-kubelet's configurable parameters.
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(providerConfig, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*MockProvider, error)
NewMockProvider creates a new MockProvider
func (*MockProvider) Capacity ¶
func (p *MockProvider) Capacity(ctx context.Context) v1.ResourceList
Capacity returns a resource list containing the capacity limits.
func (*MockProvider) ExecInContainer ¶ added in v0.4.1
func (p *MockProvider) ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error
ExecInContainer executes a command in a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr.
func (*MockProvider) GetContainerLogs ¶
func (p *MockProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, tail int) (string, error)
GetContainerLogs retrieves the logs of a container by name from the provider.
func (*MockProvider) GetPodFullName ¶ added in v0.4.1
func (p *MockProvider) GetPodFullName(namespace string, pod string) string
Get full pod name as defined in the provider context TODO: Implementation
func (*MockProvider) GetPodStatus ¶
func (p *MockProvider) GetPodStatus(ctx context.Context, 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) GetStatsSummary ¶ added in v0.7.3
GetStatsSummary returns dummy stats for all pods known by this provider.
func (*MockProvider) NodeAddresses ¶
func (p *MockProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
NodeAddresses returns a list of addresses for the node status within Kubernetes.
func (*MockProvider) NodeConditions ¶
func (p *MockProvider) NodeConditions(ctx context.Context) []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(ctx context.Context) *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.