rfutil

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingPrivateKeyFile = errors.New(`creds: "ECDSA_KEY_FILE" not specified`)
)

well known errros

Functions

func ExecutorLabels

func ExecutorLabels(funcinst *rfv1beta3.Funcinst) map[string]string

ExecutorLabels infers a set of labels for corresponding rs, pods

func ExecutorPodName

func ExecutorPodName(pod *apiv1.Pod) string

ExecutorPodName returns a printable name of an executor pod

func FuncinstAnnotations added in v0.2.1

func FuncinstAnnotations(fndef *rfv1beta3.Funcdef) map[string]string

FuncinstAnnotations infers a set of annotations for corresponding funcinst

func FuncinstLabels

func FuncinstLabels(fndef *rfv1beta3.Funcdef) map[string]string

FuncinstLabels infers a set of labels for corresponding funcinst

func GetFunctionVersion

func GetFunctionVersion(fndef *rfv1beta3.Funcdef) string

func GetHash

func GetHash(fndef *rfv1beta3.Funcdef) string

func GetMD5Hash added in v0.2.1

func GetMD5Hash(object interface{}) string

func GetSpecHash added in v0.2.1

func GetSpecHash(fndef *rfv1beta3.Funcdef) string

func IsExecutorRes

func IsExecutorRes(obj interface{}) (metav1.Object, bool)

IsExecutorRes checks if a given k8s resource belongs to a executor

func IsRefuncRes

func IsRefuncRes(obj interface{}) (metav1.Object, bool)

IsRefuncRes checks if the given object has refunc labels, and return its meta for future filtering

func IsRuntimePodReady

func IsRuntimePodReady(obj metav1.Object) bool

IsRuntimePodReady returns true if given k8s resource is an executor pod and it has been initialized

func IsXenvRes

func IsXenvRes(obj interface{}) (metav1.Object, bool)

IsXenvRes checks if a given k8s resources belongs to an xenv

func IssueToken

func IssueToken(sub string, perms rfv1beta3.Permissions, exp time.Duration) (string, error)

IssueToken issues a token to connect to nats for a funcinst

func K8sResNameForRefunc

func K8sResNameForRefunc(refunc *rfv1beta3.Funcdef) string

K8sResNameForRefunc returns a valid k8s name fro funcdef

func Sign

func Sign(claims jwt.Claims) (string, error)

Sign signs given claims with ES256

func UpdateFuncinstStatus

func UpdateFuncinstStatus(c rfcliv1.FuncinstInterface, funcinst *rfv1beta3.Funcinst, status rfv1beta3.FuncinstStatus) (*rfv1beta3.Funcinst, error)

UpdateFuncinstStatus ensures update to given status only if status changed

func XenvLabels

func XenvLabels(xenv *rfv1beta3.Xenv) map[string]string

XenvLabels infers a set of labels for corresponding deployment

Types

This section is empty.

Jump to

Keyboard shortcuts

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