exec

package
v0.0.0-...-3544c3d Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeTimeout = 124
	ExitCodeError   = 1
)

Variables

View Source
var (
	ErrDeployNotFound  = status.Errorf(codes.NotFound, "Current deploy not found")
	ErrNonZeroExitCode = status.Errorf(codes.Unknown, "Exec command returned a non zero value")
	ErrTimeout         = status.Errorf(codes.Aborted, "Timeout on performing the command")
)

Functions

This section is empty.

Types

type Defaults

type Defaults struct {
	RunnerImage  string
	StoreImage   string
	LimitsCPU    string
	LimitsMemory string
}

type ExecOperations

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

func (*ExecOperations) RunCommand

func (ops *ExecOperations) RunCommand(ctx context.Context, user *database.User, appName string, command ...string) (io.ReadCloser, <-chan error)

func (*ExecOperations) RunCommandBySpec

func (ops *ExecOperations) RunCommandBySpec(ctx context.Context, podSpec *spec.Pod) (io.ReadCloser, <-chan error)

type FakeOperations

type FakeOperations struct {
	ExpectedErr error
}

func NewFakeOperations

func NewFakeOperations() *FakeOperations

func (*FakeOperations) RunCommand

func (f *FakeOperations) RunCommand(ctx context.Context, user *database.User, appName string, command ...string) (io.ReadCloser, <-chan error)

func (*FakeOperations) RunCommandBySpec

func (f *FakeOperations) RunCommandBySpec(ctx context.Context, podSpec *spec.Pod) (io.ReadCloser, <-chan error)

type K8sOperations

type K8sOperations interface {
	DeployAnnotation(namespace, deployName, annotation string) (string, error)
	PodRun(podSpec *spec.Pod) (io.ReadCloser, <-chan int, error)
	IsNotFound(err error) bool
	DeletePod(namespace, podName string) error
}

type Operations

type Operations interface {
	RunCommand(ctx context.Context, user *database.User, appName string, command ...string) (io.ReadCloser, <-chan error)
	RunCommandBySpec(ctx context.Context, podSpec *spec.Pod) (io.ReadCloser, <-chan error)
}

func NewOperations

func NewOperations(appOps app.Operations, k8s K8sOperations, fs storage.Storage, defaults *Defaults) Operations

type Service

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

func NewService

func NewService(ops Operations, keepAliveTimeout time.Duration) *Service

func (*Service) Command

func (s *Service) Command(req *execpb.CommandRequest, stream execpb.Exec_CommandServer) error

func (*Service) RegisterService

func (s *Service) RegisterService(grpcServer *grpc.Server)

Jump to

Keyboard shortcuts

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