v1alpha1

package
v0.0.7 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

Overview

Package v1alpha1 contains API Schema definitions for the simple-cicd v1alpha1 API group +kubebuilder:object:generate=true +groupName=simple-cicd.jlsalvador.online

Index

Constants

This section is empty.

Variables

View Source
var (
	LabelWorkflowWebhookRequestNamespace = GroupVersion.Group + "/from-workflowWebhookrequest-namespace"
	LabelWorkflowWebhookRequestName      = GroupVersion.Group + "/from-workflowWebhookrequest-name"
	LabelWorkflowWebhookNamespace        = GroupVersion.Group + "/from-workflowWebhook-namespace"
	LabelWorkflowWebhookName             = GroupVersion.Group + "/from-workflowWebhook-name"
	LabelWorkFlowNamespace               = GroupVersion.Group + "/from-workflow-namespace"
	LabelWorkFlowName                    = GroupVersion.Group + "/from-workflow-name"
	LabelJobNamespace                    = GroupVersion.Group + "/from-job-namespace"
	LabelJobName                         = GroupVersion.Group + "/from-job-name"
)

Label key names

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "simple-cicd.jlsalvador.online", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GetJobLabels added in v0.0.6

func GetJobLabels(
	fromJobNamespace string,
	fromJobName string,
	fromWorkflowNamespace string,
	fromWorkflowName string,
	fromWorkflowWebhookNamespace string,
	fromWorkflowWebhookName string,
	fromWorkflowWebhookRequestNamespace string,
	fromWorkflowWebhookRequestName string,
) map[string]string

func GetWorkflowWebhookRequestLabels added in v0.0.6

func GetWorkflowWebhookRequestLabels(ww *WorkflowWebhook) map[string]string

Types

type ConcurrencyPolicy added in v0.0.6

type ConcurrencyPolicy string

ConcurrencyPolicy specifies how concurrent executions of WorkflowWebhookRequests that refer to this WorkflowWebhook should be treated.

Choose one of the following concurrency policies:

  • "Allow": Allows concurrent WorkflowWebhookRequests.
  • "Forbid": Skips new WorkflowWebhookRequests if previous ones are still in progress.
  • "Replace": Deletes old WorkflowWebhookRequests if new ones arrive before completion.

+kubebuilder:validation:Enum=Allow;Forbid;Replace

const (
	Allow   ConcurrencyPolicy = "Allow"
	Forbid  ConcurrencyPolicy = "Forbid"
	Replace ConcurrencyPolicy = "Replace"
)

type Condition added in v0.0.5

type Condition struct {
	Type               string          `json:"type"`
	Status             ConditionStatus `json:"status"`
	Reason             string          `json:"reason"`
	Message            string          `json:"message"`
	LastTransitionTime metav1.Time     `json:"lastTransitionTime"`
}

func (*Condition) DeepCopy added in v0.0.5

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto added in v0.0.5

func (in *Condition) DeepCopyInto(out *Condition)

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

type ConditionStatus added in v0.0.5

type ConditionStatus string
const (
	ConditionTrue    ConditionStatus = "True"
	ConditionFalse   ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)

These are valid condition statuses. "ConditionTrue" means a resource is in the condition. "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes can't decide if a resource is in the condition or not.

type ConditionType

type ConditionType string
const (
	WorkflowWebhookRequestProgressing ConditionType = "Progressing"
	WorkflowWebhookRequestWaiting     ConditionType = "Waiting"
	WorkflowWebhookRequestDone        ConditionType = "Done"
)

type NamespacedName

type NamespacedName struct {
	// +optional
	Namespace *string `json:"namespace,omitempty"`

	// +required
	Name string `json:"name"`
}

func (NamespacedName) AsType

func (nn NamespacedName) AsType(defaultNamespace string) types.NamespacedName

func (*NamespacedName) DeepCopy

func (in *NamespacedName) DeepCopy() *NamespacedName

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

func (*NamespacedName) DeepCopyInto

func (in *NamespacedName) DeepCopyInto(out *NamespacedName)

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

func (NamespacedName) String

func (nn NamespacedName) String() string

type NextWorkflow

type NextWorkflow struct {
	// Workflow namespace
	// +optional
	Namespace *string `json:"namespace,omitempty"`

	// Workflow name
	// +required
	Name string `json:"name"`

	// Describes the conditions for when a Job will be handled.
	// If not specified, the default behavior is "Always".
	//
	// Possible statuses:
	//   - OnSuccess: The Job will be handled when all previous Jobs were successful.
	//   - OnAnySuccess: The Job will be handled when any previous Job was successful.
	//   - OnFailure: The Job will be handled when all previous Jobs were not successful.
	//   - OnAnyFailure: The Job will be handled when any previous Job was not successful.
	//   - Always: The Job will always be handled.
	//
	// +kubebuilder:default="Always"
	// +optional
	When *When `json:"when,omitempty"`
}

func (NextWorkflow) AsNamespacedName

func (nw NextWorkflow) AsNamespacedName() NamespacedName

func (*NextWorkflow) DeepCopy

func (in *NextWorkflow) DeepCopy() *NextWorkflow

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

func (*NextWorkflow) DeepCopyInto

func (in *NextWorkflow) DeepCopyInto(out *NextWorkflow)

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

func (NextWorkflow) String

func (nw NextWorkflow) String() string

type When

type When string

Describes the conditions for when a Job will be handled. If not specified, the default behavior is "Always".

Possible statuses:

  • OnSuccess: The Job will be handled when all previous Jobs were successful.
  • OnAnySuccess: The Job will be handled when any previous Job was successful.
  • OnFailure: The Job will be handled when all previous Jobs were not successful.
  • OnAnyFailure: The Job will be handled when any previous Job was not successful.
  • Always: The Job will always be handled.

+kubebuilder:validation:Enum=OnSuccess;OnAnySuccess;OnFailure;OnAnyFailure;Always

const (
	// Forbids a Job to be executed when any previous Job was not successful.
	OnSuccess When = "OnSuccess"

	// Allows a Job to be executed when any previous Job was successful.
	OnAnySuccess When = "OnAnySuccess"

	// Forbids a Job to be executed when any previous Job was successful.
	OnFailure When = "OnFailure"

	// Allows a Job to be executed when any previous Job was not successful.
	OnAnyFailure When = "OnAnyFailure"

	// Always allows a Job to be executed.
	Always When = "Always"
)

type Workflow

type Workflow struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec WorkflowSpec `json:"spec,omitempty"`
}

Workflow is the Schema for the workflows API +kubebuilder:resource:shortName=w +kubebuilder:printcolumn:name="Suspend",type="boolean",JSONPath=`.spec.suspend`,description="When is true, the execution of this workflow will be skipped."

func (*Workflow) DeepCopy

func (in *Workflow) DeepCopy() *Workflow

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

func (*Workflow) DeepCopyInto

func (in *Workflow) DeepCopyInto(out *Workflow)

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

func (*Workflow) DeepCopyObject

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

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

type WorkflowList

type WorkflowList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Workflow `json:"items"`
}

WorkflowList contains a list of Workflow

func (*WorkflowList) DeepCopy

func (in *WorkflowList) DeepCopy() *WorkflowList

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

func (*WorkflowList) DeepCopyInto

func (in *WorkflowList) DeepCopyInto(out *WorkflowList)

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

func (*WorkflowList) DeepCopyObject

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

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

type WorkflowSpec

type WorkflowSpec struct {
	// Jobs to be cloned
	// +required
	JobsToBeCloned []NamespacedName `json:"jobsToBeCloned"`

	// Optional list of Workflow to execute next
	// +optional
	Next []NextWorkflow `json:"next,omitempty"`

	// When is true, the execution of this workflow will be skipped, disabling
	// the ability to create new Jobs referred to by this Workflow.
	// Defaults to false.
	//
	// +kubebuilder:default=false
	// +optional
	Suspend *bool `json:"suspend,omitempty" protobuf:"varint,10,opt,name=suspend"`
}

WorkflowSpec defines the desired state of Workflow

func (*WorkflowSpec) DeepCopy

func (in *WorkflowSpec) DeepCopy() *WorkflowSpec

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

func (*WorkflowSpec) DeepCopyInto

func (in *WorkflowSpec) DeepCopyInto(out *WorkflowSpec)

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

type WorkflowWebhook

type WorkflowWebhook struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec WorkflowWebhookSpec `json:"spec,omitempty"`
}

WorkflowWebhook is the Schema for the workflowwebhooks API +kubebuilder:resource:shortName=ww +kubebuilder:printcolumn:name="Suspend",type="boolean",JSONPath=`.spec.suspend`,description="When is true, any refered WorkflowWebhookRequest will be dropped."

func (*WorkflowWebhook) DeepCopy

func (in *WorkflowWebhook) DeepCopy() *WorkflowWebhook

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

func (*WorkflowWebhook) DeepCopyInto

func (in *WorkflowWebhook) DeepCopyInto(out *WorkflowWebhook)

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

func (*WorkflowWebhook) DeepCopyObject

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

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

type WorkflowWebhookList

type WorkflowWebhookList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []WorkflowWebhook `json:"items"`
}

WorkflowWebhookList contains a list of WorkflowWebhook

func (*WorkflowWebhookList) DeepCopy

func (in *WorkflowWebhookList) DeepCopy() *WorkflowWebhookList

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

func (*WorkflowWebhookList) DeepCopyInto

func (in *WorkflowWebhookList) DeepCopyInto(out *WorkflowWebhookList)

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

func (*WorkflowWebhookList) DeepCopyObject

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

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

type WorkflowWebhookRequest

type WorkflowWebhookRequest struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   WorkflowWebhookRequestSpec   `json:"spec,omitempty"`
	Status WorkflowWebhookRequestStatus `json:"status,omitempty"`
}

WorkflowWebhookRequest is the Schema for the workflowwebhookrequests API +kubebuilder:resource:shortName=wwr +kubebuilder:printcolumn:name="Done",type="boolean",JSONPath=`.status.done`,description="True when there are not more Jobs to do." +kubebuilder:printcolumn:name="Iterations",type=string,JSONPath=`.status.iterations`,priority=1,description="How many times CurrentWorkflows have been done." +kubebuilder:printcolumn:name="Successful Jobs",type=string,JSONPath=`.status.successfulJobs`,description="Total number of successful Jobs." +kubebuilder:printcolumn:name="Failed Jobs",type=string,JSONPath=`.status.failedJobs`,description="Total number of failed Jobs." +kubebuilder:printcolumn:name="Current Jobs",type=string,JSONPath=`.status.currentJobs`,priority=1,description="Waiting for these Jobs to be done."

func (*WorkflowWebhookRequest) DeepCopy

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

func (*WorkflowWebhookRequest) DeepCopyInto

func (in *WorkflowWebhookRequest) DeepCopyInto(out *WorkflowWebhookRequest)

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

func (*WorkflowWebhookRequest) DeepCopyObject

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

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

type WorkflowWebhookRequestList

type WorkflowWebhookRequestList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []WorkflowWebhookRequest `json:"items"`
}

WorkflowWebhookRequestList contains a list of WorkflowWebhookRequest

func (*WorkflowWebhookRequestList) DeepCopy

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

func (*WorkflowWebhookRequestList) DeepCopyInto

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

func (*WorkflowWebhookRequestList) DeepCopyObject

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

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

type WorkflowWebhookRequestSpec

type WorkflowWebhookRequestSpec struct {
	// Reference to the WorkflowWebhook.
	// +required
	WorkflowWebhook NamespacedName `json:"workflowWebhook"`

	// Specifies the host on which the URL is sought.
	// +optional
	Host string `json:"host,omitempty"`

	// Specifies the HTTP method (GET, POST, PUT, etc.).
	// +optional
	Method string `json:"method,omitempty"`

	// Specifies the URI being requested.
	// +optional
	Url string `json:"url,omitempty"`

	// Contains headers for the HTTP request.
	// +optional
	Headers map[string][]string `json:"headers,omitempty"`

	// Body of the HTTP request as Base64 encoded data.
	// The serialized form of the Body is a base64 encoded string,
	// representing the arbitrary (possibly non-string) data value.
	// Described in https://tools.ietf.org/html/rfc4648#section-4
	// +optional
	Body []byte `json:"body,omitempty" protobuf:"bytes,2,rep,name=body"`
}

WorkflowWebhookRequestSpec defines the desired state of WorkflowWebhookRequest

func (*WorkflowWebhookRequestSpec) DeepCopy

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

func (*WorkflowWebhookRequestSpec) DeepCopyInto

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

type WorkflowWebhookRequestStatus

type WorkflowWebhookRequestStatus struct {
	// List of Jobs currently running associated with the current WorkflowWebhookRequest.
	// +optional
	CurrentJobs []NamespacedName `json:"currentJobs,omitempty"`

	// List of Workflows currently triggered by this WorkflowWebhookRequest.
	// +optional
	CurrentWorkflows []NamespacedName `json:"currentWorkflows,omitempty"`

	// Count of how many times CurrentWorkflows have been done.
	Iterations int `json:"iterations"`

	// Number of successful Jobs owned by this WorkflowWebhookRequest.
	// +optional
	SuccessfulJobs int `json:"successfulJobs"`

	// Number of failed Jobs owned by this WorkflowWebhookRequest.
	// +optional
	FailedJobs int `json:"failedJobs"`

	// When set to true, instructs the operator to skip
	// this WorkflowWebhookRequest during future reconciliations.
	// +optional
	Done bool `json:"done"`

	// Represents the observations of a WorkflowWebhookRequestStatus's current state.
	// WorkflowWebhookRequestStatus.Status.Conditions.Type are: "Progressing", "Waiting", "Done"
	// WorkflowWebhookRequestStatus.Status.Conditions.Status are one of True, False, Unknown.
	// WorkflowWebhookRequestStatus.Status.Conditions.Reason the value should be a CamelCase string and producers of specific
	// condition types may define expected values and meanings for this field, and whether the values
	// are considered a guaranteed API.
	// WorkflowWebhookRequestStatus.Status.Conditions.Message is a human readable message indicating details about the transition.
	// For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
	//
	// Conditions store the status conditions of the WorkflowWebhookRequestStatus instances
	Conditions []Condition `json:"conditions,omitempty"`
}

WorkflowWebhookRequestStatus defines the observed state of a WorkflowWebhookRequest.

func (*WorkflowWebhookRequestStatus) DeepCopy

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

func (*WorkflowWebhookRequestStatus) DeepCopyInto

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

type WorkflowWebhookSpec

type WorkflowWebhookSpec struct {
	// Specifies the list of Workflows to run.
	//
	// +required
	Workflows []NamespacedName `json:"workflows"`

	// When is true, any WorkflowWebhookRequest that refers to this
	// WorkflowWebhook will be dropped.
	// Defaults to false.
	//
	// +kubebuilder:default=false
	// +optional
	Suspend *bool `json:"suspend,omitempty" protobuf:"varint,10,opt,name=suspend"`

	// ConcurrencyPolicy specifies how concurrent executions of WorkflowWebhookRequests
	// that refer to this WorkflowWebhook should be treated.
	//
	// Choose one of the following concurrency policies:
	//   - "Allow": Allows concurrent WorkflowWebhookRequests.
	//   - "Forbid": Skips new WorkflowWebhookRequests if previous ones are still in progress.
	//   - "Replace": Deletes old WorkflowWebhookRequests if new ones arrive before completion.
	//
	// +kubebuilder:default="Allow"
	// +optional
	ConcurrencyPolicy *ConcurrencyPolicy `json:"concurrencyPolicy,omitempty" protobuf:"bytes,3,opt,name=concurrencyPolicy,casttype=ConcurrencyPolicy"`
}

WorkflowWebhookSpec defines the desired state of WorkflowWebhook

func (*WorkflowWebhookSpec) DeepCopy

func (in *WorkflowWebhookSpec) DeepCopy() *WorkflowWebhookSpec

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

func (*WorkflowWebhookSpec) DeepCopyInto

func (in *WorkflowWebhookSpec) DeepCopyInto(out *WorkflowWebhookSpec)

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