util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterCreatedReason is added in a KubeCluster when it is created.
	ClusterCreatedReason = "Created"
	// ClusterRunningReason is added in a KubeCluster when it is running.
	ClusterRunningReason = "Running"
	// ClusterFailedReason is added in a KubeCluster when it is failed.
	ClusterFailedReason = "Failed"
	// ClusterRestartingReason is added in a KubeCluster when it is restarting.
	ClusterRestartingReason = "Restarting"
	// ClusterFailedValidationReason is added in a KubeCluster when it failed validation
	ClusterFailedValidationReason = "FailedValidation"
	// ClusterSuspendedReason is added in a KubeCluster when it is suspended.
	ClusterSuspendedReason = "Suspended"
	// ClusterResumedReason is added in a KubeCluster when it is unsuspended.
	ClusterResumedReason = "Resumed"
)

Variables

This section is empty.

Functions

func IsFailed

func IsFailed(status v1alpha1.ClusterStatus) bool

IsFailed checks if the KubeCluster is failed

func IsFinished

func IsFinished(status v1alpha1.ClusterStatus) bool

IsFinished checks if the cluster is succeeded or failed

func IsRunning

func IsRunning(status v1alpha1.ClusterStatus) bool

func IsSuspended

func IsSuspended(status v1alpha1.ClusterStatus) bool

func LoggerForCluster

func LoggerForCluster(cluster metav1.Object) *log.Entry

func LoggerForConfigMap

func LoggerForConfigMap(cm *v1.ConfigMap, kind string) *log.Entry

func LoggerForKey

func LoggerForKey(key string) *log.Entry

func LoggerForPod

func LoggerForPod(pod *v1.Pod, kind string) *log.Entry

func LoggerForReplica

func LoggerForReplica(cluster metav1.Object, rtype kubeclusterorgv1alpha1.ReplicaType) *log.Entry

func LoggerForService

func LoggerForService(svc *v1.Service, kind string) *log.Entry

func LoggerForUnstructured

func LoggerForUnstructured(obj *metav1unstructured.Unstructured, kind string) *log.Entry

func NewReason

func NewReason(kind, reason string) string

func RandStr

func RandStr(n int) string

func UpdateClusterConditions

func UpdateClusterConditions(
	ClusterStatus *v1alpha1.ClusterStatus,
	conditionType v1alpha1.ClusterConditionType,
	conditionStatus v1.ConditionStatus,
	reason, message string,
)

UpdateClusterConditions adds to the ClusterStatus a new condition if needed, with the conditionType, reason, and message

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