executor

package
v1.5.40 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 17 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 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 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, 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

This section is empty.

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