Documentation ¶
Index ¶
- type Kubernetes
- type KubernetesImpl
- func (k *KubernetesImpl) Apply(files []string, waitUntilReady bool) error
- func (k *KubernetesImpl) Delete(files []string) error
- func (k *KubernetesImpl) GetPodLogs(ctx context.Context, podName, nameSpace string) (io.ReadCloser, error)
- func (k *KubernetesImpl) GetPods(selector string) (*v1.PodList, error)
- func (k *KubernetesImpl) HealthCheckPods(selectors []string, timeout time.Duration) error
- func (k *KubernetesImpl) SetConfig(kubeconfig string) (Kubernetes, error)
- type MockKubernetes
- func (m *MockKubernetes) Apply(files []string, waitUntilReady bool) error
- func (m *MockKubernetes) Delete(files []string) error
- func (m *MockKubernetes) GetPodLogs(ctx context.Context, podName, nameSpace string) (io.ReadCloser, error)
- func (m *MockKubernetes) GetPods(selector string) (*v1.PodList, error)
- func (m *MockKubernetes) HealthCheckPods(selectors []string, timeout time.Duration) error
- func (m *MockKubernetes) SetConfig(kubeconfig string) (Kubernetes, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kubernetes ¶
type Kubernetes interface { SetConfig(string) (Kubernetes, error) GetPods(string) (*v1.PodList, error) HealthCheckPods(selectors []string, timeout time.Duration) error Apply(files []string, waitUntilReady bool) error Delete(files []string) error GetPodLogs(ctx context.Context, podName, nameSpace string) (io.ReadCloser, error) }
Kubernetes defines an interface for a Kuberenetes client
func NewKubernetes ¶
func NewKubernetes(t time.Duration, l logger.Logger) Kubernetes
NewKubernetes creates a new client for interacting with Kubernetes clusters
type KubernetesImpl ¶
type KubernetesImpl struct {
// contains filtered or unexported fields
}
KubernetesImpl is a concrete implementation of a Kubernetes client
func (*KubernetesImpl) Apply ¶
func (k *KubernetesImpl) Apply(files []string, waitUntilReady bool) error
Apply Kubernetes YAML files at path if waitUntilReady is true then the client will block until all resources have been created
func (*KubernetesImpl) Delete ¶
func (k *KubernetesImpl) Delete(files []string) error
Delete Kuberentes YAML files at path
func (*KubernetesImpl) GetPodLogs ¶
func (k *KubernetesImpl) GetPodLogs(ctx context.Context, podName, nameSpace string) (io.ReadCloser, error)
GetPodLogs returns a io.ReadCloser,err for a given pods' logs
func (*KubernetesImpl) GetPods ¶
func (k *KubernetesImpl) GetPods(selector string) (*v1.PodList, error)
GetPods returns the Kubernetes pods based on the label selector
func (*KubernetesImpl) HealthCheckPods ¶
func (k *KubernetesImpl) HealthCheckPods(selectors []string, timeout time.Duration) error
HealthCheckPods uses the given selector to check that all pods are started and running. selectors are checked sequentially pods = ["component=server,app=consul", "component=client,app=consul"]
func (*KubernetesImpl) SetConfig ¶
func (k *KubernetesImpl) SetConfig(kubeconfig string) (Kubernetes, error)
SetConfig for the Kubernetes cluster and clones the client
type MockKubernetes ¶
func (*MockKubernetes) Apply ¶
func (m *MockKubernetes) Apply(files []string, waitUntilReady bool) error
func (*MockKubernetes) Delete ¶
func (m *MockKubernetes) Delete(files []string) error
func (*MockKubernetes) GetPodLogs ¶
func (m *MockKubernetes) GetPodLogs(ctx context.Context, podName, nameSpace string) (io.ReadCloser, error)
func (*MockKubernetes) GetPods ¶
func (m *MockKubernetes) GetPods(selector string) (*v1.PodList, error)
func (*MockKubernetes) HealthCheckPods ¶
func (m *MockKubernetes) HealthCheckPods(selectors []string, timeout time.Duration) error
func (*MockKubernetes) SetConfig ¶
func (m *MockKubernetes) SetConfig(kubeconfig string) (Kubernetes, error)