util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package util provides various helper routines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPodsEventHandler added in v0.4.0

func AddPodsEventHandler(inf cache.SharedInformer, queue workqueue.RateLimitingInterface)

func BuildResourceTemplate added in v0.4.0

func BuildResourceTemplate(stepName string, action string, manifest string, successCondition string, failureCondition string, inParams workflow_v1.Inputs, outParams workflow_v1.Outputs) workflow_v1.Template

func BuildStep added in v0.4.0

func BuildStep(stepName string, template string, argParams workflow_v1.Arguments) workflow_v1.WorkflowStep

func BuildTemplate added in v0.4.0

func BuildTemplate(stepName string, image string, command []string, envVars []apiv1.EnvVar, volMnts []apiv1.VolumeMount, inParams workflow_v1.Inputs, outParams workflow_v1.Outputs) workflow_v1.Template

func ConvertEnvVarsToString added in v0.4.0

func ConvertEnvVarsToString(envs []apiv1.EnvVar) string

func ConvertKubebenchJobToArgoWorkflow added in v0.4.0

func ConvertKubebenchJobToArgoWorkflow(kbJob *kubebenchjob.KubebenchJob) (wkflw *workflow_v1.Workflow, err error)

!TODO ADD DATA VOLUME

func ConvertVolumeMountsToString added in v0.4.0

func ConvertVolumeMountsToString(vMounts []apiv1.VolumeMount) string

func ConvertVolumesToString added in v0.4.0

func ConvertVolumesToString(volumes []apiv1.Volume) string

func CreateArgumentsForString added in v0.4.0

func CreateArgumentsForString(names []string, values []string) workflow_v1.Arguments

func CreateInputs added in v0.4.0

func CreateInputs(names []string) workflow_v1.Inputs

func CreateKeyValuePairs added in v0.4.0

func CreateKeyValuePairs(m map[string]string) string

func CreateOutputs added in v0.4.0

func CreateOutputs(names []string, paths []string) workflow_v1.Outputs

func CreateWorkingQueue added in v0.4.0

func CreateWorkingQueue() workqueue.RateLimitingInterface

func GenerateJobFromParameters added in v0.4.0

func GenerateJobFromParameters(parameters map[string]string) (job *kubebenchjob.KubebenchJob, err error)

func GetJobName added in v0.4.0

func GetJobName(kbJob *kubebenchjob.KubebenchJob) (name string)

func GetPodsSharedIndexInformer added in v0.4.0

func GetPodsSharedIndexInformer(client kubernetes.Interface) cache.SharedIndexInformer

func GetTeamsSharedIndexInformer added in v0.4.0

func GetTeamsSharedIndexInformer(client kubernetes.Interface, kubebenchjobclient kubebenchjobclientset.Interface) cache.SharedIndexInformer

func Pformat

func Pformat(value interface{}) string

Pformat returns a pretty format output of any value that can be marshaled to JSON.

func RandString

func RandString(n int) string

RandString generates a random string of the desired length.

The string is DNS-1035 label compliant; i.e. its only alphanumeric lowercase. From: https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-golang

func ReadResourcesFromYAML added in v0.6.0

func ReadResourcesFromYAML(reader io.Reader) ([]unstructured.Unstructured, error)

ReadResourcesFromYAML reads in k8s resources as a list of Unstructured from YAML input

func Run

func Run(command []string, dir string, env []string) ([]byte, error)

Run a subprocess and return stdout

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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