kubernetes

package
v0.0.0-...-5447720 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRemoteExecutor

type DefaultRemoteExecutor struct{}

DefaultRemoteExecutor是远程命令执行的标准实现

func (*DefaultRemoteExecutor) Execute

func (*DefaultRemoteExecutor) Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error

type ExecOptions

type ExecOptions struct {
	Namespace     string
	PodName       string
	ContainerName string
	Stdin         bool
	Command       []string

	In  io.Reader
	Out io.Writer
	Err io.Writer

	Executor RemoteExecutor
	Client   *kubernetes.Clientset
	Config   *restclient.Config
}

ExecOptions声明Exec命令接受的参数

func (*ExecOptions) Run

func (p *ExecOptions) Run() error

Run 执行 验证过的远程命名

type Executor

type Executor struct {

	//BuildLog      *os.File
	Trace         common.JobTrace
	ObjectName    string
	IsSystemError bool
	// contains filtered or unexported fields
}

func (*Executor) Cleanup

func (e *Executor) Cleanup() error

func (*Executor) Prepare

func (e *Executor) Prepare(job common.Job) error

func (*Executor) Run

func (e *Executor) Run() error

func (*Executor) SendError

func (e *Executor) SendError(err error)

func (*Executor) Wait

func (e *Executor) Wait() error

type JobStage

type JobStage string

job 运行时的状态机

const (
	JobStageBeforeScript JobStage = "before_script"
	JobStageGetSources   JobStage = "get_sources"
	JobStageAfterScript  JobStage = "after_script"
)

type PluginStage

type PluginStage string

plugin 运行时的状态机

const (
	PluginStageBefore           PluginStage = "plugin-before"
	PluginStageArtifactDownload PluginStage = "artifact-download"
	PluginStageBuildScript      PluginStage = "build_script"
	PluginStageArtifactUpload   PluginStage = "artifact-upload"
	PluginStageAfter            PluginStage = "plugin-after"
)

type PodRuntimeState

type PodRuntimeState string

pod 运行时的状态机

const (
	PodRunStatePending      PodRuntimeState = "pending"
	PodRunRuntimeRunning    PodRuntimeState = "running"
	PodRunRuntimeFinished   PodRuntimeState = "finished"
	PodRunRuntimeCanceled   PodRuntimeState = "canceled"
	PodRunRuntimeTerminated PodRuntimeState = "terminated"
	PodRunRuntimeTimedout   PodRuntimeState = "timedout"
)

type RemoteExecutor

type RemoteExecutor interface {
	Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error
}

RemoteExecutor定义Exec命令接受的接口-用于测试

type Runtime

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

Jump to

Keyboard shortcuts

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