executor

package
v1.7.18 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 24 Imported by: 26

Documentation

Index

Constants

View Source
const (
	// GitUsernameSecretName is git username secret name
	GitUsernameSecretName = "git-username"
	// GitUsernameEnvVarName is git username environment var name
	GitUsernameEnvVarName = "RUNNER_GITUSERNAME"
	// GitTokenSecretName is git token secret name
	GitTokenSecretName = "git-token"
	// GitTokenEnvVarName is git token environment var name
	GitTokenEnvVarName = "RUNNER_GITTOKEN"
)

Variables

View Source
var RunnerEnvVars = []corev1.EnvVar{
	{
		Name:  "DEBUG",
		Value: os.Getenv("DEBUG"),
	},
	{
		Name:  "RUNNER_ENDPOINT",
		Value: os.Getenv("STORAGE_ENDPOINT"),
	},
	{
		Name:  "RUNNER_ACCESSKEYID",
		Value: os.Getenv("STORAGE_ACCESSKEYID"),
	},
	{
		Name:  "RUNNER_SECRETACCESSKEY",
		Value: os.Getenv("STORAGE_SECRETACCESSKEY"),
	},
	{
		Name:  "RUNNER_LOCATION",
		Value: os.Getenv("STORAGE_LOCATION"),
	},
	{
		Name:  "RUNNER_TOKEN",
		Value: os.Getenv("STORAGE_TOKEN"),
	},
	{
		Name:  "RUNNER_SSL",
		Value: os.Getenv("STORAGE_SSL"),
	},
	{
		Name:  "RUNNER_SCRAPPERENABLED",
		Value: os.Getenv("SCRAPPERENABLED"),
	},
	{
		Name:  "RUNNER_DATADIR",
		Value: "/data",
	},
}

Functions

func AbortJob added in v1.5.35

func AbortJob(c kubernetes.Interface, namespace string, jobName string) *testkube.ExecutionResult

AbortJob - aborts Kubernetes Job with no grace period

func GetJobPods added in v1.5.35

func GetJobPods(podsClient tcorev1.PodInterface, jobName string, retryNr, retryCount int) (*corev1.PodList, error)

GetJobPods returns job pods

func GetPodLogs added in v1.5.35

func GetPodLogs(c kubernetes.Interface, namespace string, pod corev1.Pod, logLinesCount ...int64) (logs []byte, err error)

GetPodLogs returns pod logs bytes

func IsPodLoggable added in v1.6.11

func IsPodLoggable(c kubernetes.Interface, podName, namespace string) wait.ConditionFunc

IsPodLoggable defines if pod is ready to get logs from it

func IsPodReady added in v1.5.35

func IsPodReady(c kubernetes.Interface, podName, namespace string) wait.ConditionFunc

IsPodReady defines if pod is ready or failed for logs scrapping

func PrepareEnvs added in v1.6.5

func PrepareEnvs(envs map[string]string) []corev1.EnvVar

func PrepareSecretEnvs added in v1.5.35

func PrepareSecretEnvs(secretEnvs map[string]string, variables map[string]testkube.Variable,
	usernameSecret, tokenSecret *testkube.SecretRef) []corev1.EnvVar

PrepareSecretEnvs prepares all the secrets for templating

func Run

func Run(dir string, command string, envMngr secret.Manager, arguments ...string) (out []byte, err error)

Run runs executor process wrapped in json line output wraps stdout lines into JSON chunks we want it to have common interface for agent stdin <- testkube.Execution, stdout <- stream of json logs LoggedExecuteInDir will put wrapped JSON output to stdout AND get RAW output into out var json logs can be processed later on watch of pod logs

Types

type Images added in v1.7.16

type Images struct {
	Init    string
	Scraper string
}

Images contains images for executor

func SyncDefaultExecutors added in v1.7.16

func SyncDefaultExecutors(executorsClient executorsclientv1.Interface, namespace, data string, readOnlyExecutors bool) (
	images Images, err error)

SyncDefaultExecutors creates or updates default executors

type Templates added in v1.7.16

type Templates struct {
	Job     string
	PVC     string
	Scraper string
}

Templates contains templates for executor

func NewTemplatesFromEnv added in v1.7.16

func NewTemplatesFromEnv(env string) (t Templates, err error)

NewTemplatesFromEnv returns base64 encoded templates from nev

Directories

Path Synopsis
Package client is a generated GoMock package.
Package client is a generated GoMock package.

Jump to

Keyboard shortcuts

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