utils

package
v0.0.0-...-f33f640 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestID

func GetRequestID() int

GetRequestID return an auto-increase id

func RunCMD

func RunCMD(s string) string

RunCMD run the shell command

Types

type KubeRunner

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

KubeRunner represent the command running in the container

func NewKubeRunnerFromENV

func NewKubeRunnerFromENV() (*KubeRunner, error)

NewKubeRunnerFromENV ...

func (*KubeRunner) CountOfCDS

func (r *KubeRunner) CountOfCDS(name, ns string) int

CountOfCDS get cds count of pod

func (*KubeRunner) CountOfEDS

func (r *KubeRunner) CountOfEDS(name, ns string) int

CountOfEDS get eds count of pod

func (*KubeRunner) CreateNamespace

func (r *KubeRunner) CreateNamespace(namespace string, inject bool) error

CreateNamespace creates namespace, with the control of istio-injection label

func (*KubeRunner) ExecPod

func (r *KubeRunner) ExecPod(container, podName, namespace, command string) (string, error)

ExecPod execute the command in the specified pod

func (*KubeRunner) GetAccessLog

func (r *KubeRunner) GetAccessLog(container, podName, ns string, since time.Time, match string) (string, error)

GetAccessLog get the access log of container

func (*KubeRunner) GetFirstPodByLabels

func (r *KubeRunner) GetFirstPodByLabels(namespace, labels string) (*corev1.Pod, error)

GetFirstPodByLabels get the first pod by labels

func (*KubeRunner) GetServiceIP

func (r *KubeRunner) GetServiceIP(name, ns string) string

GetServiceIP get service ip by service name and namespace

func (*KubeRunner) XDSStatistics

func (r *KubeRunner) XDSStatistics(name, ns string) string

XDSStatistics get the cds and eds statistics of pod

Jump to

Keyboard shortcuts

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