util

package
v0.5.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Set in https://github.com/pravega/pravega/blob/master/docker/bookkeeper/entrypoint.sh#L21
	PravegaPath = "pravega"
	ZkFinalizer = "cleanUpZookeeper"
)
View Source
const (
	MajorMinorVersionRegexp string = `^v?(?P<Version>[0-9]+\.[0-9]+\.[0-9]+)`
)

Variables

This section is empty.

Functions

func CompareConfigMap added in v0.5.2

func CompareConfigMap(cm1 *corev1.ConfigMap, cm2 *corev1.ConfigMap) bool

func CompareVersions

func CompareVersions(v1, v2, operator string) (bool, error)

func ContainsString

func ContainsString(slice []string, str string) bool

func ContainsVersion

func ContainsVersion(list []string, version string) bool

func ControllerReadinessCheck added in v0.5.1

func ControllerReadinessCheck(port int32, authflag bool) []string

This function check for the readiness of the controller in the following cases 1) Auth and TLS Enabled- in this case, we check if the controller is properly enabled with authentication or not and we do a get on controller and with dummy credentials(testtls:testtls) and the controller returns 401 error in this case if it's correctly configured 2) Auth Enabled and TLS Disabled- in this case, we check if the controller is properly enabled with authentication or not and we do a get on controller and with dummy credentials(testtls:testtls) and the controller returns 401 error in this case if it's correctly configured 3) Auth Disabled and TLS Enabled- in this case, we check if the controller can create scopes or not by checking if _system scope is present or not 4) Auth and TLS Disabled- in this case, we check if the controller can create scopes or not by checking if _system scope is present or not

func DeleteAllZnodes

func DeleteAllZnodes(zkUri string, clusterName string) (err error)

Delete all znodes related to a specific Pravega cluster

func DownwardAPIEnv

func DownwardAPIEnv() []corev1.EnvVar

func GenerateJVMOption added in v0.4.2

func GenerateJVMOption(k, v string) string

Concatenate the key value pair to be a JVM option string.

func GetPodVersion

func GetPodVersion(pod *v1.Pod) string

func HealthcheckCommand

func HealthcheckCommand(port int32) []string

func IsOrphan added in v0.4.3

func IsOrphan(k8sObjectName string, replicas int32) bool

func IsPodFaulty added in v0.4.2

func IsPodFaulty(pod *corev1.Pod) (bool, error)

func IsPodReady

func IsPodReady(pod *corev1.Pod) bool

func IsVersionBelow07 added in v0.5.0

func IsVersionBelow07(ver string) bool

function to check if the version is below 0.7 or not

func ListSubTreeBFS

func ListSubTreeBFS(conn *zk.Conn, root string) (*list.List, error)

Construct a BFS tree

func Min

func Min(x, y int32) int32

Min returns the smaller of x or y.

func NormalizeVersion

func NormalizeVersion(version string) (string, error)

func OverrideDefaultJVMOptions added in v0.4.2

func OverrideDefaultJVMOptions(defaultOpts []string, customOpts []string) []string

This method will override the default JVM options with user provided custom options

func PodAntiAffinity

func PodAntiAffinity(component string, clusterName string) *corev1.Affinity

func RemoveString

func RemoveString(slice []string, str string) (result []string)

func UpdateOneJVMOption added in v0.4.2

func UpdateOneJVMOption(arg string, om *OrderedMap)

This method will parse the JVM options into a key value pair and store it in the OrderedMap

Types

type OrderedMap added in v0.4.2

type OrderedMap struct {
	// contains filtered or unexported fields
}

OrderedMap is a map that has insertion order when iterating. The iteration of map in GO is in random order by default.

Jump to

Keyboard shortcuts

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