util

package
v1.7.0-fix Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// JobCreatedReason is added in a job when it is created.
	JobCreatedReason = "Created"
	// JobSucceededReason is added in a job when it is succeeded.
	JobSucceededReason = "Succeeded"
	// JobRunningReason is added in a job when it is running.
	JobRunningReason = "Running"
	// JobFailedReason is added in a job when it is failed.
	JobFailedReason = "Failed"
	// JobRestartingReason is added in a job when it is restarting.
	JobRestartingReason = "Restarting"
	// JobFailedValidationReason is added in a job when it failed validation
	JobFailedValidationReason = "FailedValidation"
	// JobSuspendedReason is added in a job when it is suspended.
	JobSuspendedReason = "Suspended"
	// JobResumedReason is added in a job when it is unsuspended.
	JobResumedReason = "Resumed"
)

Variables

This section is empty.

Functions

func IsFailed

func IsFailed(status apiv1.JobStatus) bool

IsFailed checks if the job is failed

func IsFinished

func IsFinished(status apiv1.JobStatus) bool

IsFinished checks if the job is succeeded or failed

func IsRunning

func IsRunning(status apiv1.JobStatus) bool

func IsSucceeded

func IsSucceeded(status apiv1.JobStatus) bool

IsSucceeded checks if the job is succeeded

func IsSuspended

func IsSuspended(status apiv1.JobStatus) bool

func LoggerForJob

func LoggerForJob(job metav1.Object) *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(job metav1.Object, rtype string) *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 UpdateJobConditions

func UpdateJobConditions(
	jobStatus *apiv1.JobStatus,
	conditionType apiv1.JobConditionType,
	conditionStatus v1.ConditionStatus,
	reason, message string,
)

UpdateJobConditions adds to the jobStatus a new condition if needed, with the conditionType, reason, and message

Types

type Counter

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

func NewCounter

func NewCounter() *Counter

func (*Counter) Counts

func (c *Counter) Counts(key string) (int, error)

func (*Counter) Dec

func (c *Counter) Dec(key string) error

func (*Counter) DeleteKey

func (c *Counter) DeleteKey(key string)

func (*Counter) Inc

func (c *Counter) Inc(key string)

Directories

Path Synopsis
Package that various helper routines for training.
Package that various helper routines for training.

Jump to

Keyboard shortcuts

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