Documentation
¶
Index ¶
- Constants
- func IsDNSLabel(value string) bool
- func MakeBashTask(t *v2alpha2.TaskSpec) (tasks.Task, error)
- func MakeExec(t *v2alpha2.TaskSpec) (tasks.Task, error)
- func MakePromoteKubectlTask(t *v2alpha2.TaskSpec) (tasks.Task, error)
- func MakeReadinessTask(t *v2alpha2.TaskSpec) (tasks.Task, error)
- func MakeTask(t *v2alpha2.TaskSpec) (tasks.Task, error)
- type BashInputs
- type BashTask
- type ExecInputs
- type ExecTask
- type ObjRef
- type PromoteKubectlInputs
- type PromoteKubectlTask
- type ReadinessInputs
- type ReadinessTask
Constants ¶
const ( // BashTaskName is the name of the bash task BashTaskName string = "bash" )
const ( // ExecTaskName is the name of this file implements ExecTaskName string = "exec" )
const ( // LibraryName is the name of this task library LibraryName string = "common" )
const ( // PromoteKubectlTaskName is the name of the task PromoteKubectlTaskName string = "promote-kubectl" )
const ( // ReadinessTaskName is the name of the readiness task ReadinessTaskName string = "readiness" )
Variables ¶
This section is empty.
Functions ¶
func IsDNSLabel ¶
IsDNSLabel tests for a string that conforms to the definition of a label in DNS (RFC 1035/1123). The following function is implemented in (very) old versions of k8s util package. This function doesn't seem to exist in newer versions, so reimplemented here.
func MakeBashTask ¶
MakeBashTask converts an exec task spec into an exec task.
func MakePromoteKubectlTask ¶
MakePromoteKubectlTask converts a task spec into an task.
func MakeReadinessTask ¶
MakeReadinessTask creates a readiness task with correct defaults.
Types ¶
type BashInputs ¶
type BashInputs struct {
Script string `json:"script" yaml:"script"`
}
BashInputs contain the name and arguments of the command to be executed.
type BashTask ¶
type BashTask struct {
tasks.TaskMeta `json:",inline" yaml:",inline"`
With BashInputs `json:"with" yaml:"with"`
}
BashTask encapsulates a command that can be executed.
type ExecInputs ¶
type ExecInputs struct {
Cmd string `json:"cmd" yaml:"cmd"`
Args []interface{} `json:"args,omitempty" yaml:"args,omitempty"`
DisableInterpolation bool `json:"disableInterpolation,omitempty" yaml:"disableInterpolation,omitempty"`
}
ExecInputs contain the name and arguments of the command to be executed.
type ExecTask ¶
type ExecTask struct {
tasks.TaskMeta `json:",inline" yaml:",inline"`
With ExecInputs `json:"with" yaml:"with"`
}
ExecTask encapsulates a command that can be executed.
type ObjRef ¶
type ObjRef struct {
// Kind of the object. Specified in the TYPE[.VERSION][.GROUP] format used by `kubectl`
// See https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get
Kind string `json:"kind" yaml:"kind"`
// Namespace of the object. Optional. If left unspecified, this will be defaulted to the namespace of the experiment
Namespace *string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
// Name of the object
Name string `json:"name" yaml:"name"`
// Wait for condition. Optional.
// Any value that is accepted by the --for flag of the `kubectl wait` command can be specified.
// See https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait
WaitFor *string `json:"waitFor,omitempty" yaml:"waitFor,omitempty"`
}
ObjRef contains details about a specific K8s object whose existence and readiness will be checked
type PromoteKubectlInputs ¶
type PromoteKubectlInputs struct {
Manifest string `json:"manifest" yaml:"manifest"`
//+optional
Namespace *string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
//+optional
Recursive *bool `json:"recursive,omitempty" yaml:"recursive,omitempty"`
}
PromoteKubectlInputs contain the name and arguments of the command to be executed.
type PromoteKubectlTask ¶
type PromoteKubectlTask struct {
tasks.TaskMeta `json:",inline" yaml:",inline"`
With PromoteKubectlInputs `json:"with" yaml:"with"`
}
PromoteKubectlTask encapsulates a promotion details.
func (*PromoteKubectlTask) Run ¶
func (t *PromoteKubectlTask) Run(ctx context.Context) error
Run the command.
func (*PromoteKubectlTask) ToBashTask ¶
func (t *PromoteKubectlTask) ToBashTask() *BashTask
ToBashTask converts a PromoteKubectl task to a Bash task
type ReadinessInputs ¶
type ReadinessInputs struct {
// InitialDelaySeconds is optional and defaulted to 5 secs. The first check will be performed after this delay.
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty" yaml:"initialDelaySeconds,omitempty"`
// NumRetries is optional and defaulted to 12. This is the number of retries that will be attempted after the first check. Total number of trials = 1 + NumRetries.
NumRetries *int32 `json:"numRetries,omitempty" yaml:"numRetries,omitempty"`
// IntervalSeconds is optional and defaulted to 5 secs
// Retries will be attempted periodically every IntervalSeconds
IntervalSeconds *int32 `json:"intervalSeconds,omitempty" yaml:"intervalSeconds,omitempty"`
// ObjRefs is a list of K8s objects along with optional readiness conditions
ObjRefs []ObjRef `json:"objRefs,omitempty" yaml:"objRefs,omitempty"`
}
ReadinessInputs contains a list of K8s object references along with optional readiness conditions for them. The inputs also specify the delays and retries involved in the existence and readiness checks. This task will also check for existence of objects specified in the VersionInfo field of the experiment.
type ReadinessTask ¶
type ReadinessTask struct {
tasks.TaskMeta `json:",inline" yaml:",inline"`
With ReadinessInputs `json:"with" yaml:"with"`
}
ReadinessTask checks existence and readiness of specified resources