utils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPodInCrashloopBackoff added in v0.1.4

func IsPodInCrashloopBackoff(status v1.PodStatus) bool

IsPodInCrashloopBackoff checks if the pod is in CrashloopBackoff from its status fields.

func Key

func Key(namespaceOrName string, nameOpt ...string) client.ObjectKey

Key creates a new client.ObjectKey from the given parameters. There are only two ways to call this function:

  • If only namespaceOrName is set, then a client.ObjectKey with name set to namespaceOrName is returned.
  • If namespaceOrName and one nameOpt is given, then a client.ObjectKey with namespace set to namespaceOrName and name set to nameOpt[0] is returned.

For all other cases, this method panics.

func MergeMaps

func MergeMaps(a, b map[string]interface{}) map[string]interface{}

MergeMaps takes two maps <a>, <b> and merges them. If <b> defines a value with a key already existing in the <a> map, the <a> value for that key will be overwritten.

func MergeStringMaps

func MergeStringMaps(oldMap map[string]string, newMaps ...map[string]string) map[string]string

MergeStringMaps merges the content of the newMaps with the oldMap. If a key already exists then it gets overwritten by the last value with the same key.

func StorageProviderFromInfraProvider

func StorageProviderFromInfraProvider(infra *druidv1alpha1.StorageProvider) string

StorageProviderFromInfraProvider converts infra to object store provider.

func TimeElapsed

func TimeElapsed(timestamp *metav1.Time, duration time.Duration) bool

TimeElapsed takes a <timestamp> and a <duration> checks whether the elapsed time until now is less than the <duration>. If yes, it returns true, otherwise it returns false.

func ValueExists

func ValueExists(value string, list []string) bool

ValueExists returns true or false, depending on whether the given string <value> is part of the given []string list <list>.

Types

This section is empty.

Jump to

Keyboard shortcuts

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