util

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionType

type ConditionType string

ConditionType describes the various conditions a Job can be in.

const (
	// JobRunning means that Job was deployed by Trial.
	// Job doesn't have succeeded or failed condition.
	JobRunning ConditionType = "Running"

	// JobSucceeded means that Job status satisfies Trial success condition
	JobSucceeded ConditionType = "Succeeded"

	// JobFailed means that Job status satisfies Trial failure condition
	JobFailed ConditionType = "Failed"
)

type GvkListFlag

type GvkListFlag []schema.GroupVersionKind

GvkListFlag is the custom flag to parse GroupVersionKind list for trial resources.

func (*GvkListFlag) Set

func (flag *GvkListFlag) Set(value string) error

Set is the method to set gvk from string flag value

func (*GvkListFlag) String

func (flag *GvkListFlag) String() string

Set is the method to convert gvk to string value

type TrialJobStatus

type TrialJobStatus struct {
	// Condition describes the state of the Job at a certain point.
	// Can be either Running, Succeeded or Failed
	Condition ConditionType `json:"condition,omitempty"`

	// The reason received from Job's status, if it is possible
	Reason string `json:"reason,omitempty"`

	// The message received from Job's status, if it is possible
	Message string `json:"message,omitempty"`
}

TrialJobStatus is the internal representation for deployed Job status

func GetDeployedJobStatus

func GetDeployedJobStatus(trial *trialsv1beta1.Trial, deployedJob *unstructured.Unstructured) (*TrialJobStatus, error)

GetDeployedJobStatus returns internal representation for deployed Job status.

type TrialsCollector

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

func NewTrialsCollector

func NewTrialsCollector(store cache.Cache, registerer prometheus.Registerer) *TrialsCollector

func (*TrialsCollector) Collect

func (m *TrialsCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (*TrialsCollector) Describe

func (m *TrialsCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

func (*TrialsCollector) IncreaseTrialsCreatedCount

func (c *TrialsCollector) IncreaseTrialsCreatedCount(ns string)

func (*TrialsCollector) IncreaseTrialsDeletedCount

func (c *TrialsCollector) IncreaseTrialsDeletedCount(ns string)

func (*TrialsCollector) IncreaseTrialsFailedCount

func (c *TrialsCollector) IncreaseTrialsFailedCount(ns string)

func (*TrialsCollector) IncreaseTrialsSucceededCount

func (c *TrialsCollector) IncreaseTrialsSucceededCount(ns string)

Jump to

Keyboard shortcuts

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