...

Package client

import "github.com/chaos-mesh/chaos-mesh/pkg/ctrl/client"
Overview
Index

Overview ▾

Constants

const (
    CtrlServerPort = 10082
)

func DisableRuntimeErrorHandler

func DisableRuntimeErrorHandler()

disable error handler in k8s runtime TODO: ignore specific errors only

func ForwardCtrlServer

func ForwardCtrlServer(ctx context.Context, ns, managerSvc string) (context.CancelFunc, uint16, error)

func ForwardSvcPorts

func ForwardSvcPorts(ctx context.Context, ns, svc string, port uint16) (context.CancelFunc, uint16, error)

type CommonRestClientGetter

CommonRestClientGetter is used for non-e2e test environment. It's basically do the same thing as genericclioptions.ConfigFlags, but it load rest config from incluster or .kubeconfig file

type CommonRestClientGetter struct {
    *genericclioptions.ConfigFlags
}

func NewCommonRestClientGetter

func NewCommonRestClientGetter() *CommonRestClientGetter

func (*CommonRestClientGetter) ToRESTConfig

func (it *CommonRestClientGetter) ToRESTConfig() (*rest.Config, error)

type CtrlClient

type CtrlClient struct {
    QueryClient        *graphql.Client
    SubscriptionClient *graphql.SubscriptionClient
}

func NewCtrlClient

func NewCtrlClient(url string) *CtrlClient

func (*CtrlClient) CleanIptables

func (c *CtrlClient) CleanIptables(ctx context.Context, namespace, name string, chains []string) ([]string, error)

func (*CtrlClient) CleanTcs

func (c *CtrlClient) CleanTcs(ctx context.Context, namespace, name string, devices []string) ([]string, error)

func (*CtrlClient) KillProcesses

func (c *CtrlClient) KillProcesses(ctx context.Context, namespace, name string, pids []string) ([]string, error)

func (*CtrlClient) ListNamespace

func (c *CtrlClient) ListNamespace(ctx context.Context) ([]string, error)