Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertContainerOutputToResponse(output string, err error, defaultResponse *spec.Response) *spec.Response
- func GetAllDockerFlagNames() map[string]spec.Empty
- func GetAllExecutors() map[string]spec.Executor
- func GetContainer(client *Client, uid string, containerId, containerName string) (types.Container, *spec.Response)
- func GetContainerSelfFlags() []spec.ExpFlagSpec
- func GetExecInContainerFlags() []spec.ExpFlagSpec
- func GetExecSidecarFlags() []spec.ExpFlagSpec
- func GetExecutorKey(target, action string) string
- func NewContainerCommandSpec() spec.ExpModelCommandSpec
- func NewDockerExpModelSpec() *dockerExpModelSpec
- func NewRemoveActionCommand() spec.ExpActionCommandSpec
- type BaseDockerClientExecutor
- type Client
- type ContainerCommandModelSpec
- type ResourceExpModelSpec
- type RunCmdInContainerExecutor
- type RunCmdInContainerExecutorByCP
- func (r *RunCmdInContainerExecutorByCP) DeployChaosBlade(ctx context.Context, containerId string, srcFile, extractDirName string, ...) error
- func (r *RunCmdInContainerExecutorByCP) Exec(uid string, ctx context.Context, expModel *spec.ExpModel) *spec.Response
- func (r *RunCmdInContainerExecutorByCP) Name() string
- func (r *RunCmdInContainerExecutorByCP) SetChannel(channel spec.Channel)
- type RunInSidecarContainerExecutor
Constants ¶
View Source
const ( ChaosBladeImageVersion = "latest" DefaultImageRepo = "registry.cn-hangzhou.aliyuncs.com/chaosblade/chaosblade-tool" )
View Source
const BladeBin = "/opt/chaosblade/blade"
BladeBin is the blade path in the chaosblade-tool image
View Source
const CategorySystemContainer = "system_container"
View Source
const DstChaosBladeDir = "/opt"
View Source
const (
ForceFlag = "force"
)
Variables ¶
View Source
var ChaosBladeOverrideFlag = &spec.ExpFlag{ Name: "chaosblade-override", Desc: "Override the exists chaosblade tool in the target container or not, default value is false", NoArgs: true, }
View Source
var ChaosBladeReleaseFlag = &spec.ExpFlag{
Name: "chaosblade-release",
Desc: "The pull path of the chaosblade tar package, for example, --chaosblade-release /opt/chaosblade-0.4.0.tar.gz",
}
View Source
var ContainerIdFlag = &spec.ExpFlag{ Name: "container-id", Desc: "Container id, when used with container-name, container-id is preferred", NoArgs: false, Required: false, RequiredWhenDestroyed: false, }
View Source
var ContainerNameFlag = &spec.ExpFlag{ Name: "container-name", Desc: "Container name, when used with container-id, container-id is preferred", NoArgs: false, Required: false, RequiredWhenDestroyed: false, }
View Source
var EndpointFlag = &spec.ExpFlag{ Name: "docker-endpoint", Desc: "Docker socket endpoint", NoArgs: false, Required: false, }
View Source
var ImageRepoFlag = &spec.ExpFlag{ Name: "image-repo", Desc: "Image repository of the chaosblade-tool", NoArgs: false, Required: false, }
View Source
var ImageVersionFlag = &spec.ExpFlag{ Name: "image-version", Desc: "Image version of the chaosblade-tool", NoArgs: false, Required: false, }
View Source
var JvmSpecFileForYaml = ""
Functions ¶
func GetAllDockerFlagNames ¶
func GetAllExecutors ¶
func GetContainer ¶
func GetContainer(client *Client, uid string, containerId, containerName string) (types.Container, *spec.Response)
GetContainer return container by container flag, such as container id or container name.
func GetContainerSelfFlags ¶
func GetContainerSelfFlags() []spec.ExpFlagSpec
func GetExecInContainerFlags ¶
func GetExecInContainerFlags() []spec.ExpFlagSpec
func GetExecSidecarFlags ¶
func GetExecSidecarFlags() []spec.ExpFlagSpec
func GetExecutorKey ¶
func NewContainerCommandSpec ¶
func NewContainerCommandSpec() spec.ExpModelCommandSpec
func NewDockerExpModelSpec ¶
func NewDockerExpModelSpec() *dockerExpModelSpec
func NewRemoveActionCommand ¶
func NewRemoveActionCommand() spec.ExpActionCommandSpec
Types ¶
type BaseDockerClientExecutor ¶
type BaseDockerClientExecutor struct { Client *Client CommandFunc func(uid string, ctx context.Context, model *spec.ExpModel) string }
BaseDockerClientExecutor
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type ContainerCommandModelSpec ¶
type ContainerCommandModelSpec struct {
spec.BaseExpModelCommandSpec
}
func (*ContainerCommandModelSpec) LongDesc ¶
func (cms *ContainerCommandModelSpec) LongDesc() string
func (*ContainerCommandModelSpec) Name ¶
func (cms *ContainerCommandModelSpec) Name() string
func (*ContainerCommandModelSpec) ShortDesc ¶
func (cms *ContainerCommandModelSpec) ShortDesc() string
type ResourceExpModelSpec ¶
type ResourceExpModelSpec interface { // Scope Scope() string // ExpModels returns the map of the experiment name and the model ExpModels() map[string]spec.ExpModelCommandSpec // GetExpActionModelSpec returns the action spec GetExpActionModelSpec(target, action string) spec.ExpActionCommandSpec }
type RunCmdInContainerExecutor ¶
type RunCmdInContainerExecutor interface { spec.Executor DeployChaosBlade(ctx context.Context, containerId string, srcFile, extractDirName string, override bool) error }
RunCmdInContainerExecutor is an executor interface which executes command in the target container directly
func NewRunCmdInContainerExecutorByCP ¶
func NewRunCmdInContainerExecutorByCP() RunCmdInContainerExecutor
type RunCmdInContainerExecutorByCP ¶
type RunCmdInContainerExecutorByCP struct {
BaseDockerClientExecutor
}
RunCmdInContainerExecutorByCP is an executor implementation which used copy chaosblade tool to the target container and executed
func (*RunCmdInContainerExecutorByCP) DeployChaosBlade ¶
func (*RunCmdInContainerExecutorByCP) Name ¶
func (r *RunCmdInContainerExecutorByCP) Name() string
func (*RunCmdInContainerExecutorByCP) SetChannel ¶
func (r *RunCmdInContainerExecutorByCP) SetChannel(channel spec.Channel)
type RunInSidecarContainerExecutor ¶
type RunInSidecarContainerExecutor struct { BaseDockerClientExecutor // contains filtered or unexported fields }
func NewNetWorkSidecarExecutor ¶
func NewNetWorkSidecarExecutor() *RunInSidecarContainerExecutor
func (*RunInSidecarContainerExecutor) Name ¶
func (*RunInSidecarContainerExecutor) Name() string
func (*RunInSidecarContainerExecutor) SetChannel ¶
func (*RunInSidecarContainerExecutor) SetChannel(channel spec.Channel)
Click to show internal directories.
Click to hide internal directories.