Documentation ¶
Index ¶
- Variables
- func AddPrefix(containerId string, runtime Runtime) string
- func AssertLogContains(t *testing.T, m *Minikube, pod metav1.Object, expectedLog string)
- func AssertLogContainsWithTimeout(t *testing.T, m *Minikube, pod metav1.Object, expectedLog string, ...)
- func AssertProcessNOTRunningInContainer(t *testing.T, m *Minikube, pod metav1.Object, containername string, ...)
- func AssertProcessRunningInContainer(t *testing.T, m *Minikube, pod metav1.Object, containername string, ...)
- func ContainsAttribute(attributes map[string][]string, key, value string) bool
- func GetContainerStatus(m *Minikube, pod metav1.Object, containername string) (*corev1.ContainerStatus, error)
- func HasAttribute(target discovery_kit_api.Target, key, value string) bool
- func NewContainerTarget(m *Minikube, pod metav1.Object, containername string) (*action_kit_api.Target, error)
- func PollForEnrichmentData(ctx context.Context, e *Extension, targetId string, ...) (discovery_kit_api.EnrichmentData, error)
- func PollForTarget(ctx context.Context, e *Extension, targetId string, ...) (discovery_kit_api.Target, error)
- func RemovePrefix(containerId string) string
- func Retry(t *testing.T, maxAttempts int, sleep time.Duration, f func(r *R)) bool
- func WaitForContainerStatusUsingContainerEngine(m *Minikube, containerId string, wantedStatus string) error
- func WithDefaultMinikube(t *testing.T, ext ExtensionFactory, testCases []WithMinikubeTestCase)
- func WithMinikube(t *testing.T, mOpts MinikubeOpts, ext ExtensionFactory, ...)
- type Extension
- func (e *Extension) DiscoverEnrichmentData(discoveryId string) ([]discovery_kit_api.EnrichmentData, error)
- func (e *Extension) DiscoverTargets(discoveryId string) ([]discovery_kit_api.Target, error)
- func (e *Extension) RunAction(actionId string, target *action_kit_api.Target, config interface{}, ...) (aclient.ActionExecution, error)
- func (e *Extension) RunActionWithFiles(actionId string, target *action_kit_api.Target, config interface{}, ...) (aclient.ActionExecution, error)
- type ExtensionFactory
- type HelmExtensionFactory
- type Iperf
- func (n *Iperf) AssertBandwidth(t *testing.T, min float64, max float64)
- func (n *Iperf) AssertPackageLoss(t *testing.T, min float64, max float64)
- func (n *Iperf) AssertPackageLossWithRetry(min float64, max float64, maxRetries int) bool
- func (n *Iperf) Delete() error
- func (n *Iperf) Deploy(name string, ...) error
- func (n *Iperf) MeasureBandwidth() (float64, error)
- func (n *Iperf) MeasurePackageLoss() (float64, error)
- func (n *Iperf) Target() (*action_kit_api.Target, error)
- type Minikube
- func (m *Minikube) Config() *rest.Config
- func (m *Minikube) CreateDeployment(deployment *appsv1.Deployment) (metav1.Object, []corev1.Pod, error)
- func (m *Minikube) CreatePod(pod *acorev1.PodApplyConfiguration) (metav1.Object, error)
- func (m *Minikube) CreateService(service *acorev1.ServiceApplyConfiguration) (metav1.Object, error)
- func (m *Minikube) DeleteDeployment(deployment metav1.Object) error
- func (m *Minikube) DeletePod(pod metav1.Object) error
- func (m *Minikube) DeleteService(service metav1.Object) error
- func (m *Minikube) Exec(pod metav1.Object, containername string, cmd ...string) (string, error)
- func (m *Minikube) GetClient() *kubernetes.Clientset
- func (m *Minikube) GetPod(pod metav1.Object) (*corev1.Pod, error)
- func (m *Minikube) GetRuntime() Runtime
- func (m *Minikube) ListPods(ctx context.Context, namespace, matchLabels string) ([]corev1.Pod, error)
- func (m *Minikube) LoadImage(image string) error
- func (m *Minikube) NewRestClientForService(service metav1.Object) (*ServiceClient, error)
- func (m *Minikube) PodExec(pod metav1.Object, containername string, cmd ...string) (string, error)
- func (m *Minikube) PortForward(pod metav1.Object, remotePort uint16, stopCh <-chan struct{}) (uint16, error)
- func (m *Minikube) SshExec(arg ...string) *exec.Cmd
- func (m *Minikube) TailLog(ctx context.Context, pod metav1.Object)
- func (m *Minikube) TunnelService(service metav1.Object) (string, func(), error)
- func (m *Minikube) WaitForDeploymentPhase(deployment metav1.Object, phase corev1.PodPhase, labelSelector string, ...) ([]corev1.Pod, error)
- func (m *Minikube) WaitForPodPhase(pod metav1.Object, phase corev1.PodPhase, duration time.Duration) error
- type MinikubeOpts
- type Netperf
- type Nginx
- func (n *Nginx) AssertCanReach(t *testing.T, url string, expected bool)
- func (n *Nginx) AssertCannotReach(t *testing.T, url string, errContains string)
- func (n *Nginx) AssertIsReachable(t *testing.T, expected bool)
- func (n *Nginx) CanReach(url string) error
- func (n *Nginx) ContainerStatus() (*corev1.ContainerStatus, error)
- func (n *Nginx) Delete() error
- func (n *Nginx) Deploy(podName string, opts ...func(c *acorev1.PodApplyConfiguration)) error
- func (n *Nginx) IsReachable() error
- func (n *Nginx) Target() (*action_kit_api.Target, error)
- type NginxDeployment
- func (n *NginxDeployment) AssertIsReachable(t *testing.T, expected bool)
- func (n *NginxDeployment) ContainerStatus() (*corev1.ContainerStatus, error)
- func (n *NginxDeployment) Delete() error
- func (n *NginxDeployment) Deploy(deploymentName string) error
- func (n *NginxDeployment) IsReachable() error
- func (n *NginxDeployment) Target() (*action_kit_api.Target, error)
- type R
- type Runtime
- type ServiceClient
- type WithMinikubeTestCase
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AllRuntimes = []Runtime{RuntimeDocker, RuntimeContainerd, RuntimeCrio}
)
Functions ¶
func AssertLogContains ¶
func AssertLogContainsWithTimeout ¶ added in v1.0.2
func ContainsAttribute ¶ added in v1.0.13
func GetContainerStatus ¶
func HasAttribute ¶
func HasAttribute(target discovery_kit_api.Target, key, value string) bool
func NewContainerTarget ¶
func PollForEnrichmentData ¶ added in v1.0.13
func PollForEnrichmentData(ctx context.Context, e *Extension, targetId string, predicate func(target discovery_kit_api.EnrichmentData) bool) (discovery_kit_api.EnrichmentData, error)
func PollForTarget ¶
func PollForTarget(ctx context.Context, e *Extension, targetId string, predicate func(target discovery_kit_api.Target) bool) (discovery_kit_api.Target, error)
func RemovePrefix ¶
func WithDefaultMinikube ¶
func WithDefaultMinikube(t *testing.T, ext ExtensionFactory, testCases []WithMinikubeTestCase)
func WithMinikube ¶
func WithMinikube(t *testing.T, mOpts MinikubeOpts, ext ExtensionFactory, testCases []WithMinikubeTestCase)
Types ¶
type Extension ¶
type Extension struct { Client *resty.Client Pod metav1.Object // contains filtered or unexported fields }
func (*Extension) DiscoverEnrichmentData ¶ added in v1.1.0
func (e *Extension) DiscoverEnrichmentData(discoveryId string) ([]discovery_kit_api.EnrichmentData, error)
func (*Extension) DiscoverTargets ¶
func (e *Extension) DiscoverTargets(discoveryId string) ([]discovery_kit_api.Target, error)
func (*Extension) RunAction ¶
func (e *Extension) RunAction(actionId string, target *action_kit_api.Target, config interface{}, executionContext *action_kit_api.ExecutionContext) (aclient.ActionExecution, error)
func (*Extension) RunActionWithFiles ¶
type ExtensionFactory ¶
type HelmExtensionFactory ¶
type HelmExtensionFactory struct { Name string ImageName string Port uint16 ChartPath string PodLabelSelector string ExtraArgs func(minikube *Minikube) []string }
func (*HelmExtensionFactory) CreateImage ¶
func (h *HelmExtensionFactory) CreateImage() error
type Iperf ¶
type Iperf struct { Minikube *Minikube ServerPod metav1.Object ClientPod metav1.Object ServerIp string }
func (*Iperf) AssertBandwidth ¶
func (*Iperf) AssertPackageLoss ¶
func (*Iperf) AssertPackageLossWithRetry ¶ added in v1.0.8
func (*Iperf) Deploy ¶
func (n *Iperf) Deploy(name string, opts ...func(server *acorev1.PodApplyConfiguration, client *acorev1.PodApplyConfiguration)) error
func (*Iperf) MeasureBandwidth ¶
func (*Iperf) MeasurePackageLoss ¶
type Minikube ¶
type Minikube struct { Runtime Runtime Driver string Profile string Client *kubernetes.Clientset ClientConfig *rest.Config // contains filtered or unexported fields }
func (*Minikube) CreateDeployment ¶ added in v1.0.12
func (*Minikube) CreateService ¶
func (*Minikube) DeleteDeployment ¶ added in v1.0.12
func (*Minikube) Exec ¶
Exec executes a command in a container of a pod Deprecated: Please use PodExec instead
func (*Minikube) GetClient ¶
func (m *Minikube) GetClient() *kubernetes.Clientset
func (*Minikube) GetRuntime ¶
func (*Minikube) NewRestClientForService ¶
func (m *Minikube) NewRestClientForService(service metav1.Object) (*ServiceClient, error)
func (*Minikube) PortForward ¶
func (*Minikube) TunnelService ¶
func (*Minikube) WaitForDeploymentPhase ¶ added in v1.0.12
type MinikubeOpts ¶
type MinikubeOpts struct {
// contains filtered or unexported fields
}
func DefaultMinikubeOpts ¶ added in v1.1.0
func DefaultMinikubeOpts() MinikubeOpts
func (MinikubeOpts) AfterStart ¶ added in v1.1.0
func (o MinikubeOpts) AfterStart(f func(m *Minikube) error) MinikubeOpts
AfterStart the after start callback will be called *after* the minikube cluster and *before* the extension is started.
func (MinikubeOpts) WithDriver ¶ added in v1.1.0
func (o MinikubeOpts) WithDriver(driver string) MinikubeOpts
func (MinikubeOpts) WithRuntimes ¶ added in v1.1.0
func (o MinikubeOpts) WithRuntimes(runtimes ...Runtime) MinikubeOpts
type Netperf ¶
type Netperf struct { Minikube *Minikube ServerPod metav1.Object ClientPod metav1.Object ServerIp string }
func (*Netperf) AssertLatency ¶
func (*Netperf) Deploy ¶
func (n *Netperf) Deploy(name string, opts ...func(server *acorev1.PodApplyConfiguration, client *acorev1.PodApplyConfiguration)) error
type Nginx ¶
func (*Nginx) AssertCanReach ¶
func (*Nginx) AssertCannotReach ¶
func (*Nginx) ContainerStatus ¶
func (n *Nginx) ContainerStatus() (*corev1.ContainerStatus, error)
func (*Nginx) Deploy ¶
func (n *Nginx) Deploy(podName string, opts ...func(c *acorev1.PodApplyConfiguration)) error
func (*Nginx) IsReachable ¶
type NginxDeployment ¶ added in v1.0.12
type NginxDeployment struct { Minikube *Minikube Deployment metav1.Object Service metav1.Object Pods []corev1.Pod }
func (*NginxDeployment) AssertIsReachable ¶ added in v1.0.12
func (n *NginxDeployment) AssertIsReachable(t *testing.T, expected bool)
func (*NginxDeployment) ContainerStatus ¶ added in v1.0.12
func (n *NginxDeployment) ContainerStatus() (*corev1.ContainerStatus, error)
func (*NginxDeployment) Delete ¶ added in v1.0.12
func (n *NginxDeployment) Delete() error
func (*NginxDeployment) Deploy ¶ added in v1.0.12
func (n *NginxDeployment) Deploy(deploymentName string) error
func (*NginxDeployment) IsReachable ¶ added in v1.0.12
func (n *NginxDeployment) IsReachable() error
func (*NginxDeployment) Target ¶ added in v1.0.12
func (n *NginxDeployment) Target() (*action_kit_api.Target, error)
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
func (*ServiceClient) Close ¶
func (c *ServiceClient) Close()
func (*ServiceClient) R ¶ added in v1.2.2
func (c *ServiceClient) R() *resty.Request
Click to show internal directories.
Click to hide internal directories.