util

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyImagePullSecret added in v1.7.0

func ApplyImagePullSecret(secret string, podspec apiv1.PodSpec) *apiv1.PodSpec

ApplyImagePullSecret applies image pull secret to the give pod spec. It's intentional not to check the existence of secret here. First, Kubernetes will set Pod status to "ImagePullBackOff" once kubelet failed to pull image so that users will know what's happening. Second, Fission no longer need to handle "secret not found" error when creating the environment deployment since kubelet will retry to pull image until successes.

func ConvertConfigSecrets added in v1.14.1

func ConvertConfigSecrets(ctx context.Context, fn *fv1.Function, kc kubernetes.Interface) ([]apiv1.EnvFromSource, error)

ConvertConfigSecrets returns envFromSource which can be passed directly into the pod spec

func CreateDumpFile added in v1.19.0

func CreateDumpFile(logger *zap.Logger) (*os.File, error)

CreateDumpFile => create dump file inside temp directory

func GetObjectReaperInterval added in v1.18.0

func GetObjectReaperInterval(logger *zap.Logger, executorType fv1.ExecutorType, defaultReaperInterval uint) uint

func GetSpecFromConfigMap added in v1.17.0

func GetSpecFromConfigMap(filePath string) (*apiv1.PodSpec, error)

func MergeContainer

func MergeContainer(dst *apiv1.Container, src *apiv1.Container) (*apiv1.Container, error)

MergeContainer returns merged container specs. Slices are merged, and return an error if the elements in the slice have name conflicts. Maps are merged, the value of map of dst container are overridden if the key is the same. The rest of fields of dst container are overridden directly.

func MergePodSpec

func MergePodSpec(srcPodSpec *apiv1.PodSpec, targetPodSpec *apiv1.PodSpec) (*apiv1.PodSpec, error)

MergePodSpec updates srcPodSpec with targetPodSpec fields if not empty

func WaitTimeout added in v1.7.0

func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration)

WaitTimeout starts a wait group with timeout

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