containerexecutor

package
v1.12.5-beta001 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutorJobSpec added in v1.7.16

func NewExecutorJobSpec(log *zap.SugaredLogger, options *JobOptions) (*batchv1.Job, error)

NewExecutorJobSpec is a method to create new executor job spec

func NewPersistentVolumeClaimSpec added in v1.7.16

func NewPersistentVolumeClaimSpec(log *zap.SugaredLogger, options *JobOptions) (*corev1.PersistentVolumeClaim, error)

NewPersistentVolumeClaimSpec is a method to create new persistent volume claim spec

func NewScraperJobSpec added in v1.7.16

func NewScraperJobSpec(log *zap.SugaredLogger, options *JobOptions) (*batchv1.Job, error)

NewScraperJobSpec is a method to create new scraper job spec

func TailJobLogs

func TailJobLogs(ctx context.Context, log *zap.SugaredLogger, c kubernetes.Interface, namespace string, id string,
	podStartTimeout time.Duration, logs chan []byte) (err error)

TailJobLogs - locates logs for job pod(s) These methods here are similar to Job executor, but they don't require the json structure.

Types

type ContainerExecutor

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

ContainerExecutor is container for managing job executor dependencies

func NewContainerExecutor

func NewContainerExecutor(
	repo result.Repository,
	namespace string,
	images executor.Images,
	templates executor.Templates,
	serviceAccountName string,
	metrics ExecutionCounter,
	emiter EventEmitter,
	configMap config.Repository,
	executorsClient executorsclientv1.Interface,
	testsClient testsv3.Interface,
	registry string,
	podStartTimeout time.Duration,
	clusterID string,
) (client *ContainerExecutor, err error)

NewContainerExecutor creates new job executor

func (*ContainerExecutor) Abort

Abort K8sJob aborts K8S by job name

func (*ContainerExecutor) Execute

Execute starts new external test execution, reads data and returns ID Execution is started asynchronously client can check later for results

func (*ContainerExecutor) ExecuteSync

ExecuteSync starts new external test execution, reads data and returns ID Execution is started synchronously client will be blocked

func (*ContainerExecutor) Logs

func (c *ContainerExecutor) Logs(ctx context.Context, id string) (out chan output.Output, err error)

Logs returns job logs stream channel using kubernetes api

type EventEmitter

type EventEmitter interface {
	Notify(event testkube.Event)
}

type ExecutionCounter

type ExecutionCounter interface {
	IncExecuteTest(execution testkube.Execution)
}

type JobOptions

type JobOptions struct {
	Name                      string
	Namespace                 string
	Image                     string
	ImagePullSecrets          []string
	Command                   []string
	Args                      []string
	WorkingDir                string
	ImageOverride             string
	Jsn                       string
	TestName                  string
	InitImage                 string
	ScraperImage              string
	JobTemplate               string
	ScraperTemplate           string
	PVCTemplate               string
	SecretEnvs                map[string]string
	Envs                      map[string]string
	HTTPProxy                 string
	HTTPSProxy                string
	UsernameSecret            *testkube.SecretRef
	TokenSecret               *testkube.SecretRef
	CertificateSecret         string
	Variables                 map[string]testkube.Variable
	ActiveDeadlineSeconds     int64
	ArtifactRequest           *testkube.ArtifactRequest
	ServiceAccountName        string
	DelaySeconds              int
	JobTemplateExtensions     string
	ScraperTemplateExtensions string
	EnvConfigMaps             []testkube.EnvReference
	EnvSecrets                []testkube.EnvReference
	Labels                    map[string]string
	Registry                  string
	ClusterID                 string
}

func NewJobOptions

func NewJobOptions(images executor.Images, templates executor.Templates, serviceAccountName, registry, clusterID string,
	execution testkube.Execution, options client.ExecuteOptions) (*JobOptions, error)

NewJobOptions provides job options for templates

func NewJobOptionsFromExecutionOptions

func NewJobOptionsFromExecutionOptions(options client.ExecuteOptions) *JobOptions

NewJobOptionsFromExecutionOptions compose JobOptions based on ExecuteOptions

Jump to

Keyboard shortcuts

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