util

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 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 added in v1.7.0

func IsFailed(status apiv1.JobStatus) bool

IsFailed checks if the job is failed

func IsFinished added in v1.7.0

func IsFinished(status apiv1.JobStatus) bool

IsFinished checks if the job is succeeded or failed

func IsRunning added in v1.7.0

func IsRunning(status apiv1.JobStatus) bool

func IsSucceeded added in v1.7.0

func IsSucceeded(status apiv1.JobStatus) bool

IsSucceeded checks if the job is succeeded

func IsSuspended added in v1.7.0

func IsSuspended(status apiv1.JobStatus) bool

func LoggerForJob added in v1.7.0

func LoggerForJob(job metav1.Object) *log.Entry

func LoggerForKey added in v1.7.0

func LoggerForKey(key string) *log.Entry

func LoggerForPod added in v1.7.0

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

func LoggerForReplica added in v1.7.0

func LoggerForReplica(job metav1.Object, rtype string) *log.Entry

func LoggerForService added in v1.7.0

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

func LoggerForUnstructured added in v1.7.0

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

func NewReason added in v1.7.0

func NewReason(kind, reason string) string

func UpdateJobConditions added in v1.7.0

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 added in v1.7.0

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

func NewCounter added in v1.7.0

func NewCounter() *Counter

func (*Counter) Counts added in v1.7.0

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

func (*Counter) Dec added in v1.7.0

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

func (*Counter) DeleteKey added in v1.7.0

func (c *Counter) DeleteKey(key string)

func (*Counter) Inc added in v1.7.0

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