Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the operations v1alpha1 API group +kubebuilder:object:generate=true +groupName=operations.compass
Index ¶
- Variables
- type Condition
- type ConditionType
- type Operation
- func (in *Operation) DeepCopy() *Operation
- func (in *Operation) DeepCopyInto(out *Operation)
- func (in *Operation) DeepCopyObject() runtime.Object
- func (in *Operation) HasPollURL() bool
- func (in *Operation) IsInProgress() bool
- func (in *Operation) NextPollTime(retryInterval *int, timeLayout string) (time.Duration, error)
- func (in *Operation) PollURL() string
- func (in *Operation) RequestObject() (*webhook.ApplicationLifecycleWebhookRequestObject, error)
- func (in *Operation) TimeoutReached(timeout time.Duration) bool
- func (in *Operation) Validate() error
- type OperationList
- type OperationSpec
- type OperationStatus
- type OperationType
- type OperationValidationErr
- type State
- type Webhook
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "operations.compass", 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 ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct { Type ConditionType `json:"type"` Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` Message string `json:"message,omitempty"` }
Condition defines the states which the Operation CR can take
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConditionType ¶
type ConditionType string
+kubebuilder:validation:Enum=Ready;Error
const ( ConditionTypeReady ConditionType = "Ready" ConditionTypeError ConditionType = "Error" )
type Operation ¶
type Operation struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec OperationSpec `json:"spec,omitempty"` Status OperationStatus `json:"status,omitempty"` }
Operation is the Schema for the operations API +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.operation_type` +kubebuilder:printcolumn:name="Resource ID",type=string,JSONPath=`.spec.resource_id` +kubebuilder:printcolumn:name="Resource Type",type=string,JSONPath=`.spec.resource_type` +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase` +kubebuilder:subresource:status
func (*Operation) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Operation.
func (*Operation) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Operation) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Operation) HasPollURL ¶
HasPollURL checks whether the current Operation has been provided with a Poll URL
func (*Operation) IsInProgress ¶
IsInProgress checks if the Operation's Phase is StateInProgress
func (*Operation) NextPollTime ¶
NextPollTime calculates the remaining time until the Poll URL associated with the current Operation can be requested/polled again.
func (*Operation) PollURL ¶
PollURL returns the Poll URL for the current Operation and empty string if a URL has not been provided
func (*Operation) RequestObject ¶
func (in *Operation) RequestObject() (*webhook.ApplicationLifecycleWebhookRequestObject, error)
RequestObject parses and returns the request object associated with the current operation. The request object is essential for the processing of webhook templates as part of the Operation Controller reconcile logic.
func (*Operation) TimeoutReached ¶
TimeoutReached returns whether the current operation has timed-out or not based on the InitializedAt status timestamp of the Operation and the provided timeout duration variable.
type OperationList ¶
type OperationList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Operation `json:"items"` }
OperationList contains a list of Operation
func (*OperationList) DeepCopy ¶
func (in *OperationList) DeepCopy() *OperationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperationList.
func (*OperationList) DeepCopyInto ¶
func (in *OperationList) DeepCopyInto(out *OperationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*OperationList) DeepCopyObject ¶
func (in *OperationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type OperationSpec ¶
type OperationSpec struct { OperationID string `json:"operation_id"` OperationType OperationType `json:"operation_type"` OperationCategory string `json:"operation_category"` ResourceType string `json:"resource_type"` ResourceID string `json:"resource_id"` CorrelationID string `json:"correlation_id"` WebhookIDs []string `json:"webhook_ids"` RequestObject string `json:"request_object"` }
OperationSpec defines the desired state of Operation
func (*OperationSpec) DeepCopy ¶
func (in *OperationSpec) DeepCopy() *OperationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperationSpec.
func (*OperationSpec) DeepCopyInto ¶
func (in *OperationSpec) DeepCopyInto(out *OperationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OperationStatus ¶
type OperationStatus struct { Webhooks []Webhook `json:"webhooks,omitempty"` Conditions []Condition `json:"conditions,omitempty"` Phase State `json:"phase,omitempty"` InitializedAt metav1.Time `json:"initialized_at,omitempty"` ObservedGeneration *int64 `json:"observed_generation,omitempty"` }
OperationStatus defines the observed state of Operation
func (*OperationStatus) DeepCopy ¶
func (in *OperationStatus) DeepCopy() *OperationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperationStatus.
func (*OperationStatus) DeepCopyInto ¶
func (in *OperationStatus) DeepCopyInto(out *OperationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OperationType ¶
type OperationType string
+kubebuilder:validation:Enum=Create;Update;Delete;Unpair
const ( OperationTypeCreate OperationType = "Create" OperationTypeUpdate OperationType = "Update" OperationTypeDelete OperationType = "Delete" )
type OperationValidationErr ¶
type OperationValidationErr struct {
Description string
}
OperationValidationErr represents an operation error potentially occurring during the intialization and validation of the OperationStatus
func (*OperationValidationErr) DeepCopy ¶
func (in *OperationValidationErr) DeepCopy() *OperationValidationErr
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperationValidationErr.
func (*OperationValidationErr) DeepCopyInto ¶
func (in *OperationValidationErr) DeepCopyInto(out *OperationValidationErr)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*OperationValidationErr) Error ¶
func (o *OperationValidationErr) Error() string
Error implements the error interface
type Webhook ¶
type Webhook struct { WebhookID string `json:"webhook_id"` RetriesCount int `json:"retries_count"` WebhookPollURL string `json:"webhook_poll_url"` LastPollTimestamp string `json:"last_poll_timestamp"` State State `json:"state"` }
Webhook is an entity part of the OperationStatus which holds information about the progression of the webhook execution
func (*Webhook) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Webhook.
func (*Webhook) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.