Documentation
¶
Index ¶
- func NewJobSpec(log *zap.SugaredLogger, options *JobOptions) (*batchv1.Job, error)
- func TailJobLogs(log *zap.SugaredLogger, c kubernetes.Interface, namespace string, id string, ...) (err error)
- type ContainerExecutor
- func (c *ContainerExecutor) Abort(jobName string) *testkube.ExecutionResult
- func (c *ContainerExecutor) Execute(execution *testkube.Execution, options client.ExecuteOptions) (testkube.ExecutionResult, error)
- func (c *ContainerExecutor) ExecuteSync(execution *testkube.Execution, options client.ExecuteOptions) (testkube.ExecutionResult, error)
- func (c *ContainerExecutor) Logs(id string) (out chan output.Output, err error)
- type EventEmitter
- type ExecutionCounter
- type JobOptions
- type ResultRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJobSpec ¶
func NewJobSpec(log *zap.SugaredLogger, options *JobOptions) (*batchv1.Job, error)
NewJobSpec is a method to create new job spec
func TailJobLogs ¶
func TailJobLogs(log *zap.SugaredLogger, c kubernetes.Interface, namespace string, id string, logs chan []byte) (err error)
These methods here are similiar to Job executor, but they don't require the json structure. TailJobLogs - locates logs for job pod(s)
Types ¶
type ContainerExecutor ¶
type ContainerExecutor struct {
// contains filtered or unexported fields
}
ContainerExecutor is container for managing job executor dependencies
func NewContainerExecutor ¶
func NewContainerExecutor(repo ResultRepository, namespace, initImage, jobTemplate string, metrics ExecutionCounter, emiter EventEmitter) (client *ContainerExecutor, err error)
NewContainerExecutor creates new job executor
func (*ContainerExecutor) Abort ¶
func (c *ContainerExecutor) Abort(jobName string) *testkube.ExecutionResult
AbortK8sJob aborts K8S by job name
func (*ContainerExecutor) Execute ¶
func (c *ContainerExecutor) Execute(execution *testkube.Execution, options client.ExecuteOptions) (testkube.ExecutionResult, error)
Execute starts new external test execution, reads data and returns ID Execution is started asynchronously client can check later for results
func (*ContainerExecutor) ExecuteSync ¶
func (c *ContainerExecutor) ExecuteSync(execution *testkube.Execution, options client.ExecuteOptions) (testkube.ExecutionResult, error)
Execute starts new external test execution, reads data and returns ID Execution is started synchronously client will be blocked
type EventEmitter ¶
type ExecutionCounter ¶
type JobOptions ¶
type JobOptions struct {
Name string
Namespace string
Image string
ImagePullSecrets []string
Command []string
Args []string
ImageOverride string
Jsn string
TestName string
JobTemplate string
InitImage string
SecretEnvs map[string]string
Envs map[string]string
HTTPProxy string
HTTPSProxy string
UsernameSecret *testkube.SecretRef
TokenSecret *testkube.SecretRef
Variables map[string]testkube.Variable
ActiveDeadlineSeconds int64
}
func NewJobOptions ¶
func NewJobOptions(initImage, jobTemplate string, execution testkube.Execution, options client.ExecuteOptions) (*JobOptions, error)
func NewJobOptionsFromExecutionOptions ¶
func NewJobOptionsFromExecutionOptions(options client.ExecuteOptions) *JobOptions
NewJobOptionsFromExecutionOptions compose JobOptions based on ExecuteOptions
type ResultRepository ¶
type ResultRepository interface {
// UpdateExecution updates result in execution
UpdateResult(ctx context.Context, id string, execution testkube.ExecutionResult) error
// StartExecution updates execution start time
StartExecution(ctx context.Context, id string, startTime time.Time) error
// EndExecution updates execution end time
EndExecution(ctx context.Context, execution testkube.Execution) error
}