Documentation ¶
Index ¶
- Constants
- func InspectDockerImage(namespace, registry, image string, imageSecrets []string) ([]string, string, error)
- func NewExecutorJobSpec(log *zap.SugaredLogger, options *JobOptions) (*batchv1.Job, error)
- func NewPVCOptionsFromJobOptions(options JobOptions) client.PVCOptions
- func NewScraperJobSpec(log *zap.SugaredLogger, options *JobOptions) (*batchv1.Job, error)
- type ContainerExecutor
- func (c *ContainerExecutor) Abort(ctx context.Context, execution *testkube.Execution) (*testkube.ExecutionResult, error)
- func (c *ContainerExecutor) Execute(ctx context.Context, execution *testkube.Execution, ...) (*testkube.ExecutionResult, error)
- func (c *ContainerExecutor) Logs(ctx context.Context, id string) (out chan output.Output, err error)
- func (c *ContainerExecutor) TailJobLogs(ctx context.Context, id string, logs chan []byte) (err error)
- type EventEmitter
- type ExecutionCounter
- type JobOptions
Constants ¶
const (
// EntrypointScriptName is entrypoint script name
EntrypointScriptName = "entrypoint.sh"
)
Variables ¶
This section is empty.
Functions ¶
func InspectDockerImage ¶ added in v1.14.0
func InspectDockerImage(namespace, registry, image string, imageSecrets []string) ([]string, string, error)
InspectDockerImage inspects docker image
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 NewPVCOptionsFromJobOptions ¶ added in v1.16.21
func NewPVCOptionsFromJobOptions(options JobOptions) client.PVCOptions
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
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, testExecutionsClient testexecutionsv1.Interface, templatesClient templatesv1.Interface, registry string, podStartTimeout time.Duration, clusterID string, dashboardURI string, apiURI string, natsUri string, debug bool, logsStream logsclient.Stream, features featureflags.FeatureFlags, ) (client *ContainerExecutor, err error)
NewContainerExecutor creates new job executor
func (*ContainerExecutor) Abort ¶
func (c *ContainerExecutor) Abort(ctx context.Context, execution *testkube.Execution) (*testkube.ExecutionResult, error)
Abort K8sJob aborts K8S by job name
func (*ContainerExecutor) Execute ¶
func (c *ContainerExecutor) Execute(ctx context.Context, 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) 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
func (*ContainerExecutor) TailJobLogs ¶ added in v1.15.0
func (c *ContainerExecutor) TailJobLogs(ctx context.Context, id string, 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.
type EventEmitter ¶
type ExecutionCounter ¶
type JobOptions ¶
type JobOptions struct { Name string Namespace string Image string ImagePullSecrets []string Command []string Args []string WorkingDir 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 PvcTemplateExtensions string EnvConfigMaps []testkube.EnvReference EnvSecrets []testkube.EnvReference Labels map[string]string Registry string ClusterID string ExecutionNumber int32 ContextType string ContextData string Debug bool LogSidecarImage string NatsUri string APIURI string Features featureflags.FeatureFlags }
func NewJobOptions ¶
func NewJobOptions(log *zap.SugaredLogger, templatesClient templatesv1.Interface, images executor.Images, templates executor.Templates, serviceAccountName, registry, clusterID, apiURI string, execution testkube.Execution, options client.ExecuteOptions, natsUri string, debug bool) (*JobOptions, error)
TODO refactor JobOptions to use builder pattern TODO extract JobOptions for both container and job executor to common package in separate PR NewJobOptions provides job options for templates
func NewJobOptionsFromExecutionOptions ¶
func NewJobOptionsFromExecutionOptions(options client.ExecuteOptions) *JobOptions
NewJobOptionsFromExecutionOptions compose JobOptions based on ExecuteOptions