Documentation ¶
Index ¶
- Constants
- Variables
- func AbortJob(c kubernetes.Interface, namespace string, jobName string) *testkube.ExecutionResult
- func GetJobPods(podsClient tcorev1.PodInterface, jobName string, retryNr, retryCount int) (*corev1.PodList, error)
- func GetPodLogs(c kubernetes.Interface, namespace string, pod corev1.Pod, ...) (logs []byte, err error)
- func IsPodLoggable(c kubernetes.Interface, podName, namespace string) wait.ConditionFunc
- func IsPodReady(c kubernetes.Interface, podName, namespace string) wait.ConditionFunc
- func PrepareEnvs(envs map[string]string) []corev1.EnvVar
- func PrepareSecretEnvs(secretEnvs map[string]string, variables map[string]testkube.Variable, ...) []corev1.EnvVar
- func Run(dir string, command string, envMngr secret.Manager, arguments ...string) (out []byte, err error)
- type Images
- type Templates
Constants ¶
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 ¶
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 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
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
Templates contains templates for executor
func NewTemplatesFromEnv ¶ added in v1.7.16
NewTemplatesFromEnv returns base64 encoded templates from nev