podsets

package
v0.0.0-...-a8f7ac2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReplicaSetString  = "ReplicaSet"
	StatefulsetString = "StatefulSet"
)

Variables

View Source
var WaitForDeploymentSetReady = func(ns, name string, timeout time.Duration, logger *log.Logger) bool {
	logger.Info("Check if Deployment %s:%s is ready", ns, name)
	clients := clientsholder.GetClientsHolder()
	start := time.Now()
	for time.Since(start) < timeout {
		dp, err := provider.GetUpdatedDeployment(clients.K8sClient.AppsV1(), ns, name)
		if err != nil {
			logger.Error("Error while getting Deployment %q, err: %v", name, err)
		} else if !dp.IsDeploymentReady() {
			logger.Warn("Deployment %q is not ready yet", dp.ToString())
		} else {
			logger.Info("Deployment %q is ready!", dp.ToString())
			return true
		}

		time.Sleep(time.Second)
	}
	logger.Error("Deployment %s:%s is not ready", ns, name)
	return false
}
View Source
var WaitForScalingToComplete = func(ns, name string, timeout time.Duration, groupResourceSchema schema.GroupResource, logger *log.Logger) bool {
	logger.Info("Check if scale object for CRs %s:%s is ready", ns, name)
	clients := clientsholder.GetClientsHolder()
	start := time.Now()
	for time.Since(start) < timeout {
		crScale, err := provider.GetUpdatedCrObject(clients.ScalingClient, ns, name, groupResourceSchema)
		if err != nil {
			logger.Error("Error while getting the scaling fields %v", err)
		} else if !crScale.IsScaleObjectReady() {
			logger.Warn("%s is not ready yet", crScale.ToString())
		} else {
			logger.Info("%s is ready!", crScale.ToString())
			return true
		}

		time.Sleep(time.Second)
	}
	logger.Error("Timeout waiting for CR %s:%s scaling to be complete", ns, name)
	return false
}

Functions

func GetAllNodesForAllPodSets

func GetAllNodesForAllPodSets(pods []*provider.Pod) (nodes map[string]bool)

func WaitForAllPodSetsReady

func WaitForAllPodSetsReady(env *provider.TestEnvironment, timeout time.Duration, logger *log.Logger) (
	notReadyDeployments []*provider.Deployment,
	notReadyStatefulSets []*provider.StatefulSet)

func WaitForStatefulSetReady

func WaitForStatefulSetReady(ns, name string, timeout time.Duration, logger *log.Logger) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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