v1alpha2

package
v0.0.0-...-f3f1ec7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const GroupName = "fleet.crd.tess.io"

Variables

View Source
var (
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"}

SchemeGroupVersion is group version used to register these objects.

Functions

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Param

type Param struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Param is a key value pair which can consumed in PipelineRuns for all Release Events.

func (*Param) DeepCopy

func (in *Param) DeepCopy() *Param

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Param.

func (*Param) DeepCopyInto

func (in *Param) DeepCopyInto(out *Param)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseCalendar

type ReleaseCalendar struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ReleaseCalendarSpec `json:"spec,omitempty"`
}

ReleaseCalendar describes a Release arragement from calendar view.

func (*ReleaseCalendar) DeepCopy

func (in *ReleaseCalendar) DeepCopy() *ReleaseCalendar

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseCalendar.

func (*ReleaseCalendar) DeepCopyInto

func (in *ReleaseCalendar) DeepCopyInto(out *ReleaseCalendar)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReleaseCalendar) DeepCopyObject

func (in *ReleaseCalendar) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReleaseCalendarAfterPolicy

type ReleaseCalendarAfterPolicy string

ReleaseCalendarAfterPolicy specifies how does the RunAfter policy on Release events affect the PipelineRun execution.

const (
	// AfterPolicyIgnore means the time to run doesn't look for completeness
	// of its precedent events.
	AfterPolicyIgnore ReleaseCalendarAfterPolicy = "Ignore"
	// AfterPolicyAlways means the time to run relies on the completion time
	// of its precedent events.
	AfterPolicyAlways ReleaseCalendarAfterPolicy = "Always"
)

type ReleaseCalendarConcurrentPolicy

type ReleaseCalendarConcurrentPolicy string
const (
	// ConcurrentPolicyDelete will delete the previous Pending event
	ConcurrentPolicyDelete ReleaseCalendarConcurrentPolicy = "Delete"
	// ConcurrentPolicyWait will wait for the previous Pending event
	ConcurrentPolicyWait ReleaseCalendarConcurrentPolicy = "Wait"
)

type ReleaseCalendarDay

type ReleaseCalendarDay struct {
	// From specifies the start day of week. For e.g, 0 means Sunday.
	// +kubebuilder:validation:Maximum=6
	// +kubebuilder:validation:Minimum=0
	From int64 `json:"from"`
	// To specifies the end day of week. For e.g, 4 means Thursday.
	// +kubebuilder:validation:Maximum=6
	// +kubebuilder:validation:Minimum=0
	To int64 `json:"to"`
}

func (*ReleaseCalendarDay) DeepCopy

func (in *ReleaseCalendarDay) DeepCopy() *ReleaseCalendarDay

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseCalendarDay.

func (*ReleaseCalendarDay) DeepCopyInto

func (in *ReleaseCalendarDay) DeepCopyInto(out *ReleaseCalendarDay)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseCalendarGroupPolicy

type ReleaseCalendarGroupPolicy string
const (
	// GroupPolicyAll means events can be in the same execution group as long as they have the same group name
	GroupPolicyAll ReleaseCalendarGroupPolicy = "All"
	// GroupPolicyDaily means events can be in the same execution group if they start in the same day (with timezone)
	GroupPolicyDaily ReleaseCalendarGroupPolicy = "Daily"
)

type ReleaseCalendarHour

type ReleaseCalendarHour struct {
	// From specifies the starting hour of the day. For e.g, 10 means 10AM.
	// If unset or set to 0, it means the begining of the day.
	// +kubebuilder:validation:Maximum=47
	// +kubebuilder:validation:Minimum=0
	From int64 `json:"from"`
	// To specifies the end hour of the day. For e.g, 17 means 5PM.
	// If To is greater or equal to 24, the hour falls into the second day.
	// +kubebuilder:validation:Maximum=47
	// +kubebuilder:validation:Minimum=0
	To int64 `json:"to"`
	// Params specifies the parameters that should be applied to all Events
	// in this time range.
	Params []Param `json:"params,omitempty"`
}

ReleaseCalendarHour specifies a range of time that this calendar considers as active time periods.

func (*ReleaseCalendarHour) DeepCopy

func (in *ReleaseCalendarHour) DeepCopy() *ReleaseCalendarHour

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseCalendarHour.

func (*ReleaseCalendarHour) DeepCopyInto

func (in *ReleaseCalendarHour) DeepCopyInto(out *ReleaseCalendarHour)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseCalendarList

type ReleaseCalendarList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of calendars.
	Items []ReleaseCalendar `json:"items"`
}

func (*ReleaseCalendarList) DeepCopy

func (in *ReleaseCalendarList) DeepCopy() *ReleaseCalendarList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseCalendarList.

func (*ReleaseCalendarList) DeepCopyInto

func (in *ReleaseCalendarList) DeepCopyInto(out *ReleaseCalendarList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReleaseCalendarList) DeepCopyObject

func (in *ReleaseCalendarList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReleaseCalendarPipeline

type ReleaseCalendarPipeline struct {
	// Name is a key to the specified TemplateRef.
	Name string `json:"name"`
	// TimeOffset specifies the relative time from the scheduled event Time.
	// There are two formats supported:
	// 1. "-6h": This Pipeline should be executed 6 hours ahead.
	// 2. "-1d,10:00": This Pipeline should be exeucted at 10:00am from
	//    the previous day.
	TimeOffset string `json:"timeOffset,omitempty"`
	// RunPolicy specifies the policy for this Pipeline. It might be:
	// 1. LeaderOnly: This Pipeline is only executed on leader events.
	// 2. Always: This Pipeline should be executed for all events.
	RunPolicy ReleaseCalendarRunPolicy `json:"runPolicy,omitempty"`
	// AfterPolicy specifies whether the execution of this Pipeline should
	// honor event After settings. If this set to Always and A has B as after,
	// then this Pipeline for event A can only run when event B finishes the
	// same Pipeline.
	AfterPolicy ReleaseCalendarAfterPolicy `json:"afterPolicy,omitempty"`
	// Rollback is a key to the specified TemplateRef. The template is used
	// to create PipelineRun that is meant for rollback.
	Rollback string `json:"rollback,omitempty"`
	// RollbackPolicy specifies when the rollback PipelineRun should run.
	// This could be Auto so that rollback will happen automatically on
	// failure, or if set to None, then this rollback Pipeline can only
	// be triggered manually.
	RollbackPolicy ReleaseCalendarRollbackPolicy `json:"rollbackPolicy,omitempty"`
}

ReleaseCalendarPipeline specifies how and when a PipelineRun should be executed.

func (*ReleaseCalendarPipeline) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseCalendarPipeline.

func (*ReleaseCalendarPipeline) DeepCopyInto

func (in *ReleaseCalendarPipeline) DeepCopyInto(out *ReleaseCalendarPipeline)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseCalendarRollbackPolicy

type ReleaseCalendarRollbackPolicy string

ReleaseCalendarRollbackPolicy specifies how should Rollback happen.

const (
	// RollbackPolicyAuto means the rollback should happen on failure without
	// human interaction.
	RollbackPolicyAuto ReleaseCalendarRollbackPolicy = "Auto"
	// RollbackPolicyNone means the rollback can only be triggered manually.
	RollbackPolicyNone ReleaseCalendarRollbackPolicy = "None"
)

type ReleaseCalendarRunPolicy

type ReleaseCalendarRunPolicy string

ReleaseCalendarRunPolicy specifies which events should run this PipelineRun.

const (
	// RunPolicyAlways means all the events should run.
	RunPolicyAlways ReleaseCalendarRunPolicy = "Always"
	// RunPolicyLeaderOnly means only the leader should run.
	RunPolicyLeaderOnly ReleaseCalendarRunPolicy = "LeaderOnly"
)

type ReleaseCalendarSpec

type ReleaseCalendarSpec struct {
	// Paused when set to true, the execution of this Event should stop. All
	// the running PipelineRuns will still run till completion.
	Paused bool `json:"paused,omitempty"`
	// TemplateRef specifies the available PipelineRun templates. Usually it
	// is a ConfigMap, and each key in this ConfigMap can represent one stage
	// of each event.
	TemplateRef TemplateRef `json:"templateRef"`
	// Params is a list of Name-Value pairs that will be passed as parameters
	// to all the PipelineRuns.
	Params []Param `json:"params,omitempty"`
	// Pipelines describes a sequential Pipelines that should be executed for
	// each ReleaseEvent.
	Pipelines []ReleaseCalendarPipeline `json:"pipelines"`
	// SkipDays specifies the days when releaseevents shouldn't be scheduled.
	SkipDays []string `json:"skipDays,omitempty"`
	// Weekdays specifies the weekdays when releaseevents can be scheduled.
	Weekdays []ReleaseCalendarDay `json:"weekdays,omitempty"`
	// Hours specifies the hours when release events can execute. This usually
	// aligns with working hours, for e.g, 9:00AM-05:00PM.
	Hours []ReleaseCalendarHour `json:"hours,omitempty"`
	// TimeZone specifies the applicable timezone. For, e.g -8 means PST.
	TimeZone intstr.IntOrString `json:"timeZone"`
	// GroupPolicy defines the policy of grouping events' execution
	GroupPolicy ReleaseCalendarGroupPolicy `json:"groupPolicy,omitempty"`
	// ConcurrencePolicy specifies what happens to an old Pending event
	// when new events with the same name get created.
	// If this is not specified, the new event will wait for the old event to be
	// done (Completed, Failed or Cancelled)
	ConcurrentPolicy ReleaseCalendarConcurrentPolicy `json:"concurrentPolicy,omitempty"`
}

ReleaseCalendarSpec describes how and when this calendar should be executed.

func (*ReleaseCalendarSpec) DeepCopy

func (in *ReleaseCalendarSpec) DeepCopy() *ReleaseCalendarSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseCalendarSpec.

func (*ReleaseCalendarSpec) DeepCopyInto

func (in *ReleaseCalendarSpec) DeepCopyInto(out *ReleaseCalendarSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseEvent

type ReleaseEvent struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ReleaseEventSpec   `json:"spec,omitempty"`
	Status            ReleaseEventStatus `json:"status,omitempty"`
}

ReleaseEvent describes an event with specific parameters. This event runs through all the Pipelines as specified in the corresponding ReleaseCalendar.

func (*ReleaseEvent) DeepCopy

func (in *ReleaseEvent) DeepCopy() *ReleaseEvent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseEvent.

func (*ReleaseEvent) DeepCopyInto

func (in *ReleaseEvent) DeepCopyInto(out *ReleaseEvent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReleaseEvent) DeepCopyObject

func (in *ReleaseEvent) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReleaseEventList

type ReleaseEventList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of releaseevents.
	Items []ReleaseEvent `json:"items"`
}

func (*ReleaseEventList) DeepCopy

func (in *ReleaseEventList) DeepCopy() *ReleaseEventList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseEventList.

func (*ReleaseEventList) DeepCopyInto

func (in *ReleaseEventList) DeepCopyInto(out *ReleaseEventList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReleaseEventList) DeepCopyObject

func (in *ReleaseEventList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReleaseEventPhase

type ReleaseEventPhase string

ReleaseEventPhase describes the current phase of this ReleaseEvent.

const (
	// EventStatusPending means no PipelineRun has been created yet.
	EventStatusPending ReleaseEventPhase = "Pending"
	// EventStatusRunning means there is at least one PipelineRun Running.
	EventStatusRunning ReleaseEventPhase = "Running"
	// EventStatusCompleted means all the PipelineRuns have Completed.
	EventStatusCompleted ReleaseEventPhase = "Completed"
	// EventStatusSkipped means there is nothing left to run for this event
	// and some steps are skipped. This should be treated same as Completed.
	EventStatusSkipped ReleaseEventPhase = "Skipped"
	// EventStatusCancelled means the last PipelineRun is Cancelled.
	EventStatusCancelled ReleaseEventPhase = "Cancelled"
	// EventStatusFailed means the last PipelineRun is Failed.
	EventStatusFailed ReleaseEventPhase = "Failed"
)

type ReleaseEventPipelineRun

type ReleaseEventPipelineRun struct {
	// Name is the name of PipelineRun that are created.
	Name string `json:"name"`
	// Cluster denotes where the PipelineRun is created.
	Cluster string `json:"cluster,omitempty"`
	// Pipeline is the name of Pipeline stage (as specified from ReleaseCalendar).
	Pipeline string `json:"pipeline"`
	// StartTime describes the start time of this PipelineRun.
	StartTime *metav1.Time `json:"startTime,omitempty"`
	// CompletionTime describes the completion time of this PipelineRun.
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`
	// Status describes the PipelineRun status.
	Status ReleaseEventPipelineRunStatus `json:"status"`
	// Results describes the PipelineRun results.
	Results map[string]string `json:"results,omitempty"`
}

ReleaseEventPipelineRun describes a specific PipelineRun status in current ReleaseEvent.

func (*ReleaseEventPipelineRun) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseEventPipelineRun.

func (*ReleaseEventPipelineRun) DeepCopyInto

func (in *ReleaseEventPipelineRun) DeepCopyInto(out *ReleaseEventPipelineRun)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseEventPipelineRunStatus

type ReleaseEventPipelineRunStatus string

ReleaseEventPipelineRunStatus describes the PipelineRun status.

const (
	// PipelineRunStatusPending means this PipelineRun is waiting to be executed.
	PipelineRunStatusPending ReleaseEventPipelineRunStatus = "Pending"
	// PipelineRunStatusRunning means this PipelineRun is being executed.
	PipelineRunStatusRunning ReleaseEventPipelineRunStatus = "Running"
	// PipelineRunStatusCompleted means this PipelineRun is completed.
	PipelineRunStatusCompleted ReleaseEventPipelineRunStatus = "Completed"
	// PipelineRunStatusCancelled means this PipelineRun is cancalled.
	PipelineRunStatusCancelled ReleaseEventPipelineRunStatus = "Cancelled"
	// PipelineRunStatusFailed means this PipelineRun is failed.
	PipelineRunStatusFailed ReleaseEventPipelineRunStatus = "Failed"
	// PipelineRunStatusRollback means this PipelineRun is failed and Rollback is triggered.
	PipelineRunStatusRollback ReleaseEventPipelineRunStatus = "Rollback"
	// PipelineRunStatusUnknown means the status is currently unknown.
	PipelineRunStatusUnknown ReleaseEventPipelineRunStatus = "Unknown"
)

type ReleaseEventRunAfter

type ReleaseEventRunAfter struct {
	// Name is name of the event it should wait for.
	Name string `json:"name"`
	// Pipeline is the name of pipeline it should wait for.
	Pipeline string `json:"pipeline,omitempty"`
	// TimeOffset specifies when this event should start. There are two
	// formats supported:
	// 1. "6h": This means 6 hours after.
	// 2. "24h,10:00": This means 10:00 at the next day.
	// This must be a future time (A positive time duration).
	// Note: The offset is relative to the status.time of another release event.
	TimeOffset string `json:"timeOffset,omitempty"`
}

ReleaseEventRunAfter specifies how the current event should run after another one.

func (*ReleaseEventRunAfter) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseEventRunAfter.

func (*ReleaseEventRunAfter) DeepCopyInto

func (in *ReleaseEventRunAfter) DeepCopyInto(out *ReleaseEventRunAfter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseEventSpec

type ReleaseEventSpec struct {
	// Calendar is the name of ReleaseCalendar this event belongs to.
	Calendar string `json:"calendar"`
	// Paused when set to true, the execution of this Event should stop. All
	// the running PipelineRuns will still run till completion.
	Paused bool `json:"paused,omitempty"`
	// Time is the execution time scheduled for this event.
	Time *metav1.Time `json:"time,omitempty"`
	// Params is a list of Name-Value pairs that should be passed to all of
	// PipelineRuns.
	Params []Param `json:"params,omitempty"`
	// Note is additional information that people can put on.
	Note string `json:"note,omitempty"`
	// Group is a name to identify the group this event belongs to. If there
	// are multiple events belong to the same group, a leader will be elected.
	Group string `json:"group,omitempty"`
	// RunAfter declares a list of precedent events this event should run
	// after. This supersedes the After field.
	RunAfter []ReleaseEventRunAfter `json:"runAfter,omitempty"`
}

ReleaseEventSpec describes the ReleaseEvent details.

func (*ReleaseEventSpec) DeepCopy

func (in *ReleaseEventSpec) DeepCopy() *ReleaseEventSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseEventSpec.

func (*ReleaseEventSpec) DeepCopyInto

func (in *ReleaseEventSpec) DeepCopyInto(out *ReleaseEventSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReleaseEventStatus

type ReleaseEventStatus struct {
	// Phase describes the current event phase.
	Phase ReleaseEventPhase `json:"phase,omitempty"`
	// Time is the estimated or actual (if the event is already Running)
	// execution time for this event.
	Time *metav1.Time `json:"time,omitempty"`
	// Leader is the name of release event which acts as the group leader.
	Leader string `json:"leader,omitempty"`
	// PipelineRuns describes all the executed PipelineRun status.
	PipelineRuns []ReleaseEventPipelineRun `json:"pipelineRuns,omitempty"`
}

ReleaseEventStatus describes the current status of this ReleaseEvent.

func (*ReleaseEventStatus) DeepCopy

func (in *ReleaseEventStatus) DeepCopy() *ReleaseEventStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseEventStatus.

func (*ReleaseEventStatus) DeepCopyInto

func (in *ReleaseEventStatus) DeepCopyInto(out *ReleaseEventStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TemplateRef

type TemplateRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`
	Kind      string `json:"kind,omitempty"`
}

TemplateRef is about where we can read all the PipelineRun templates.

func (*TemplateRef) DeepCopy

func (in *TemplateRef) DeepCopy() *TemplateRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateRef.

func (*TemplateRef) DeepCopyInto

func (in *TemplateRef) DeepCopyInto(out *TemplateRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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