utils

package
v1.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const ErrorCodeSystem = "system"
View Source
const ErrorCodeUnknown = "Unknown"
View Source
const ErrorCodeUser = "User"
View Source
const ResourceNvidiaGPU = "nvidia.com/gpu"

ResourceNvidiaGPU is the name of the Nvidia GPU resource.

Variables

View Source
var NotTheOwnerError = errors.Errorf("FlytePropeller is not the owner")

Functions

func CopyMap

func CopyMap(o map[string]string) (r map[string]string)

func GetContainer added in v0.16.4

func GetContainer(pod *v1.PodSpec, containerName string) (*v1.Container, error)

GetContainer searches the provided pod spec for a container with the specified name

func GetKubeConfig added in v0.16.4

func GetKubeConfig(_ context.Context, cfg *config.Config) (*kubernetes.Clientset, *restclient.Config, error)

func GetProtoTime

func GetProtoTime(t *metav1.Time) *timestamp.Timestamp

func GetSanitizedPrometheusKey added in v0.7.0

func GetSanitizedPrometheusKey(key string) (string, error)

func GetWorkflowIDFromOwner

func GetWorkflowIDFromOwner(reference *metav1.OwnerReference, namespace string) (v1alpha1.WorkflowID, error)

func MakeBinding

func MakeBinding(variable string, b *core.BindingData) *core.Binding

func MakeBindingDataCollection

func MakeBindingDataCollection(bindings ...*core.BindingData) *core.BindingData

func MakeBindingDataMap

func MakeBindingDataMap(pairs ...Pair) *core.BindingData

func MakeBindingDataPromise

func MakeBindingDataPromise(fromNode, fromVar string) *core.BindingData

func MakeBindingPromise

func MakeBindingPromise(fromNode, fromVar, toVar string) *core.Binding

func MakePrimitiveBindingData

func MakePrimitiveBindingData(v interface{}) (*core.BindingData, error)

func MustMakePrimitiveBindingData

func MustMakePrimitiveBindingData(v interface{}) *core.BindingData

func NewK8sEventRecorder added in v0.16.4

func NewK8sEventRecorder(ctx context.Context, kubeclientset kubernetes.Interface, controllerAgentName string, publishK8sEvents bool) (record.EventRecorder, error)

func SanitizeLabelValue added in v0.1.16

func SanitizeLabelValue(name string) string

SanitizeLabelValue ensures that the label value is a valid DNS-1123 string

func ToK8sEnvVar

func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar

func ToK8sResourceList

func ToK8sResourceList(resources []*core.Resources_ResourceEntry) (v1.ResourceList, error)

TODO we should modify the container resources to contain a map of enum values? Also we should probably create tolerations / taints, but we could do that as a post process

func ToK8sResourceRequirements

func ToK8sResourceRequirements(resources *core.Resources) (*v1.ResourceRequirements, error)

Types

type FailingRawStore

type FailingRawStore struct {
}

func (FailingRawStore) CopyRaw

func (FailingRawStore) CopyRaw(ctx context.Context, source, destination storage.DataReference, opts storage.Options) error

func (FailingRawStore) CreateSignedURL added in v0.16.42

func (FailingRawStore) GetBaseContainerFQN

func (FailingRawStore) GetBaseContainerFQN(ctx context.Context) storage.DataReference

func (FailingRawStore) Head

func (FailingRawStore) ReadRaw

func (FailingRawStore) WriteRaw

func (FailingRawStore) WriteRaw(ctx context.Context, reference storage.DataReference, size int64, opts storage.Options, raw io.Reader) error

type Pair

type Pair struct {
	K string
	V *core.BindingData
}

func NewPair

func NewPair(k string, v *core.BindingData) Pair

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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