utils

package
v0.0.0-...-4bbb7cc Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// TODO: refactor the code. We should move the endpoint from the expect to the http call.
	// So we don't need to remember to pass the correct expect.
	Host           = "http://127.0.0.1:9180"
	DataPanelHost  = "http://127.0.0.1:9080"
	PrometheusHost = "http://127.0.0.1:9080"
)

Functions

func DeleteRoute

func DeleteRoute(e *httpexpect.Expect) *httpexpect.Response

func ExecInPod

func ExecInPod(cli *kubernetes.Clientset, pod *corev1.Pod, cmd string) (string, error)

func GetEgressBandwidthPerSecond

func GetEgressBandwidthPerSecond(e *httpexpect.Expect) (float64, float64)

func GetPods

func GetPods(cli client.Client, ns string, listOption client.MatchingLabels) ([]corev1.Pod, error)

func GetRoute

func GetRoute(e *httpexpect.Expect, expectStatus int) *httpexpect.Response

func GetRouteIgnoreError

func GetRouteIgnoreError(e *httpexpect.Expect) *httpexpect.Response

func GetRouteList

func GetRouteList(e *httpexpect.Expect, expectStatus int) *httpexpect.Response

func GetSilentHttpexpectClient

func GetSilentHttpexpectClient() *httpexpect.Expect

func Log

func Log(pod *corev1.Pod, c *kubernetes.Clientset, sinceTime time.Time) (string, error)

Log print log of pod

func RoughCompare

func RoughCompare(a float64, b float64) bool

func SetPrometheusMetricsPublicAPI

func SetPrometheusMetricsPublicAPI(e *httpexpect.Expect) *httpexpect.Response

func SetRoute

func SetRoute(e *httpexpect.Expect, expectStatusRange httpexpect.StatusRange) *httpexpect.Response

func SetRouteIgnoreError

func SetRouteIgnoreError(e *httpexpect.Expect) *httpexpect.Response

func TestPrometheusEtcdMetric

func TestPrometheusEtcdMetric(e *httpexpect.Expect, expectEtcd int) *httpexpect.Response

func WaitUntilMethodSucceed

func WaitUntilMethodSucceed(e *httpexpect.Expect, method string, interval int)

Types

type ClientSet

type ClientSet struct {
	CtrlCli client.Client
	KubeCli *kubernetes.Clientset
}

func InitClientSet

func InitClientSet() (*ClientSet, error)

Jump to

Keyboard shortcuts

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