v1

package
v1.0.0-beta.21 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the trace v1 API group +kubebuilder:object:generate=true +groupName=trace.kubeblocks.io

Index

Constants

View Source
const Kind = "ReconciliationTrace"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "trace.kubeblocks.io", Version: "v1"}

	// 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 CELExpression

type CELExpression struct {
	// Expression specifies the CEL expression.
	//
	Expression string `json:"expression"`
}

CELExpression defines a CEL expression.

func (*CELExpression) DeepCopy

func (in *CELExpression) DeepCopy() *CELExpression

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

func (*CELExpression) DeepCopyInto

func (in *CELExpression) DeepCopyInto(out *CELExpression)

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

type DryRun

type DryRun struct {
	// DesiredSpec specifies the desired spec of the TargetObject.
	// The desired spec will be merged into the current spec by a strategic merge patch way to build the final spec,
	// and the reconciliation plan will be calculated by comparing the current spec to the final spec.
	// DesiredSpec should be a valid YAML string.
	//
	DesiredSpec string `json:"desiredSpec"`
}

func (*DryRun) DeepCopy

func (in *DryRun) DeepCopy() *DryRun

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

func (*DryRun) DeepCopyInto

func (in *DryRun) DeepCopyInto(out *DryRun)

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

type DryRunPhase

type DryRunPhase string
const (
	DryRunSucceedPhase DryRunPhase = "Succeed"
	DryRunFailedPhase  DryRunPhase = "Failed"
)

type DryRunResult

type DryRunResult struct {
	// Phase specifies the current phase of the plan generation process.
	// Succeed - the plan is calculated successfully.
	// Failed - the plan can't be generated for some reason described in Reason.
	//
	// +kubebuilder:validation:Enum={Succeed,Failed}
	Phase DryRunPhase `json:"phase,omitempty"`

	// Reason specifies the reason when the Phase is Failed.
	//
	// +optional
	Reason string `json:"reason,omitempty"`

	// Message specifies a description of the failure reason.
	//
	// +optional
	Message string `json:"message,omitempty"`

	// DesiredSpecRevision specifies the revision of the DesiredSpec.
	//
	DesiredSpecRevision string `json:"desiredSpecRevision"`

	// ObservedTargetGeneration specifies the observed generation of the TargetObject.
	//
	ObservedTargetGeneration int64 `json:"observedTargetGeneration"`

	// SpecDiff describes the diff between the current spec and the final spec.
	// The whole spec struct will be compared and an example SpecDiff looks like:
	// {
	//  	Affinity: {
	//  		PodAntiAffinity: "Preferred",
	//  		Tenancy: "SharedNode",
	//  	},
	//  	ComponentSpecs: {
	//  		{
	//  			ComponentDef: "postgresql",
	//  			Name: "postgresql",
	// -			Replicas: 2,
	// +			Replicas: 3,
	//  			Resources:
	//  			{
	//  				Limits:
	//  				{
	// -					CPU: 500m,
	// +					CPU: 800m,
	// -					Memory: 512Mi,
	// +					Memory: 768Mi,
	//  				},
	//  				Requests:
	//  				{
	// -					CPU: 500m,
	// +					CPU: 800m,
	// -					Memory: 512Mi,
	// +					Memory: 768Mi,
	//  				},
	//  			},
	//  		},
	//  	},
	// }
	//
	SpecDiff string `json:"specDiff"`

	// Plan describes the detail reconciliation process if the DesiredSpec is applied.
	//
	Plan ReconciliationCycleState `json:"plan"`
}

DryRunResult defines a dry-run result.

func (*DryRunResult) DeepCopy

func (in *DryRunResult) DeepCopy() *DryRunResult

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

func (*DryRunResult) DeepCopyInto

func (in *DryRunResult) DeepCopyInto(out *DryRunResult)

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

type EventAttributes

type EventAttributes struct {
	// Name of the Event.
	//
	Name string `json:"name"`

	// Type of the Event.
	//
	Type string `json:"type"`

	// Reason of the Event.
	//
	Reason string `json:"reason"`
}

EventAttributes defines attributes of the Event.

func (*EventAttributes) DeepCopy

func (in *EventAttributes) DeepCopy() *EventAttributes

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

func (*EventAttributes) DeepCopyInto

func (in *EventAttributes) DeepCopyInto(out *EventAttributes)

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

type ObjectChange

type ObjectChange struct {
	// ObjectReference specifies the Object this change described.
	//
	ObjectReference corev1.ObjectReference `json:"objectReference"`

	// ChangeType specifies the change type.
	// Event - specifies that this is a Kubernetes Event.
	// Creation - specifies that this is an object creation.
	// Update - specifies that this is an object update.
	// Deletion - specifies that this is an object deletion.
	//
	// +kubebuilder:validation:Enum={Event, Creation, Update, Deletion}
	ChangeType ObjectChangeType `json:"changeType"`

	// EventAttributes specifies the attributes of the event when ChangeType is Event.
	//
	// +optional
	EventAttributes *EventAttributes `json:"eventAttributes,omitempty"`

	// Revision specifies the revision of the object after this change.
	// Revision can be compared globally between all ObjectChanges of all Objects, to build a total order object change sequence.
	//
	Revision int64 `json:"revision"`

	// Timestamp is a timestamp representing the ReconciliationTrace Controller time when this change occurred.
	// It is not guaranteed to be set in happens-before order across separate changes.
	// It is represented in RFC3339 form and is in UTC.
	//
	// +optional
	Timestamp *metav1.Time `json:"timestamp,omitempty"`

	// Description describes the change in a user-friendly way.
	//
	Description string `json:"description"`

	// LocalDescription is the localized version of Description by using the Locale specified in `spec.locale`.
	// Empty if the `spec.locale` is not specified.
	//
	LocalDescription *string `json:"localDescription,omitempty"`
}

ObjectChange defines a detailed change of an object.

func (*ObjectChange) DeepCopy

func (in *ObjectChange) DeepCopy() *ObjectChange

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

func (*ObjectChange) DeepCopyInto

func (in *ObjectChange) DeepCopyInto(out *ObjectChange)

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

type ObjectChangeSummary

type ObjectChangeSummary struct {
	// Added specifies the number of object will be added.
	//
	// +optional
	Added *int32 `json:"added,omitempty"`

	// Updated specifies the number of object will be updated.
	//
	// +optional
	Updated *int32 `json:"updated,omitempty"`

	// Deleted specifies the number of object will be deleted.
	//
	// +optional
	Deleted *int32 `json:"deleted,omitempty"`
}

ObjectChangeSummary defines changes of an object.

func (*ObjectChangeSummary) DeepCopy

func (in *ObjectChangeSummary) DeepCopy() *ObjectChangeSummary

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

func (*ObjectChangeSummary) DeepCopyInto

func (in *ObjectChangeSummary) DeepCopyInto(out *ObjectChangeSummary)

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

type ObjectChangeType

type ObjectChangeType string
const (
	ObjectCreationType ObjectChangeType = "Creation"
	ObjectUpdateType   ObjectChangeType = "Update"
	ObjectDeletionType ObjectChangeType = "Deletion"
	EventType          ObjectChangeType = "Event"
)

type ObjectReference

type ObjectReference struct {
	// Namespace of the referent.
	// Default is same as the ReconciliationTrace object.
	//
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name of the referent.
	// Default is same as the ReconciliationTrace object.
	//
	// +optional
	Name string `json:"name,omitempty"`
}

ObjectReference defines a reference to an object.

func (*ObjectReference) DeepCopy

func (in *ObjectReference) DeepCopy() *ObjectReference

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

func (*ObjectReference) DeepCopyInto

func (in *ObjectReference) DeepCopyInto(out *ObjectReference)

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

type ObjectSummary

type ObjectSummary struct {
	// ObjectType of the object.
	//
	ObjectType ObjectType `json:"objectType"`

	// Total number of the object of type defined by ObjectType.
	//
	Total int32 `json:"total"`

	// ChangeSummary summarizes the change by comparing the final state to the current state of this type.
	// Nil means no change.
	//
	// +optional
	ChangeSummary *ObjectChangeSummary `json:"changeSummary,omitempty"`
}

ObjectSummary defines the total and change of an object.

func (*ObjectSummary) DeepCopy

func (in *ObjectSummary) DeepCopy() *ObjectSummary

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

func (*ObjectSummary) DeepCopyInto

func (in *ObjectSummary) DeepCopyInto(out *ObjectSummary)

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

type ObjectTreeDiffSummary

type ObjectTreeDiffSummary struct {
	// ObjectSummaries summarizes each object type.
	//
	ObjectSummaries []ObjectSummary `json:"objectSummaries"`
}

ObjectTreeDiffSummary defines a summary of the diff of two object tree.

func (*ObjectTreeDiffSummary) DeepCopy

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

func (*ObjectTreeDiffSummary) DeepCopyInto

func (in *ObjectTreeDiffSummary) DeepCopyInto(out *ObjectTreeDiffSummary)

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

type ObjectTreeNode

type ObjectTreeNode struct {
	// Primary specifies reference of the primary object.
	//
	Primary corev1.ObjectReference `json:"primary"`

	// Secondaries describes all the secondary objects of this object, if any.
	//
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	// +optional
	Secondaries []*ObjectTreeNode `json:"secondaries,omitempty"`
}

ObjectTreeNode defines an object tree of the KubeBlocks Cluster.

func (*ObjectTreeNode) DeepCopy

func (in *ObjectTreeNode) DeepCopy() *ObjectTreeNode

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

func (*ObjectTreeNode) DeepCopyInto

func (in *ObjectTreeNode) DeepCopyInto(out *ObjectTreeNode)

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

type ObjectType

type ObjectType struct {
	// APIVersion of the type.
	//
	APIVersion string `json:"apiVersion"`

	// Kind of the type.
	//
	Kind string `json:"kind"`
}

ObjectType defines an object type.

func (*ObjectType) DeepCopy

func (in *ObjectType) DeepCopy() *ObjectType

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

func (*ObjectType) DeepCopyInto

func (in *ObjectType) DeepCopyInto(out *ObjectType)

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

type ReconciliationCycleState

type ReconciliationCycleState struct {
	// Summary summarizes the ObjectTree and Changes.
	//
	Summary ObjectTreeDiffSummary `json:"summary"`

	// ObjectTree specifies the current object tree of the reconciliation cycle.
	// Ideally, ObjectTree should be same as applying Changes to InitialObjectTree.
	//
	ObjectTree *ObjectTreeNode `json:"objectTree"`

	// Changes describes the detail reconciliation process.
	//
	Changes []ObjectChange `json:"changes"`
}

ReconciliationCycleState defines the state of reconciliation cycle.

func (*ReconciliationCycleState) DeepCopy

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

func (*ReconciliationCycleState) DeepCopyInto

func (in *ReconciliationCycleState) DeepCopyInto(out *ReconciliationCycleState)

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

type ReconciliationTrace

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

	Spec   ReconciliationTraceSpec   `json:"spec,omitempty"`
	Status ReconciliationTraceStatus `json:"status,omitempty"`
}

ReconciliationTrace is the Schema for the reconciliationtraces API

func (*ReconciliationTrace) DeepCopy

func (in *ReconciliationTrace) DeepCopy() *ReconciliationTrace

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

func (*ReconciliationTrace) DeepCopyInto

func (in *ReconciliationTrace) DeepCopyInto(out *ReconciliationTrace)

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

func (*ReconciliationTrace) DeepCopyObject

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

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

type ReconciliationTraceList

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

ReconciliationTraceList contains a list of ReconciliationTrace

func (*ReconciliationTraceList) DeepCopy

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

func (*ReconciliationTraceList) DeepCopyInto

func (in *ReconciliationTraceList) DeepCopyInto(out *ReconciliationTraceList)

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

func (*ReconciliationTraceList) DeepCopyObject

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

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

type ReconciliationTraceSpec

type ReconciliationTraceSpec struct {
	// TargetObject specifies the target Cluster object.
	// Default is the Cluster object with same namespace and name as this ReconciliationTrace object.
	//
	// +optional
	TargetObject *ObjectReference `json:"targetObject,omitempty"`

	// DryRun tells the Controller to simulate the reconciliation process with a new desired spec of the TargetObject.
	// And a reconciliation plan will be generated and described in the ReconciliationTraceStatus.
	// The plan generation process will not impact the state of the TargetObject.
	//
	// +optional
	DryRun *DryRun `json:"dryRun,omitempty"`

	// StateEvaluationExpression specifies the state evaluation expression used during reconciliation progress observation.
	// The whole reconciliation process from the creation of the TargetObject to the deletion of it
	// is separated into several reconciliation cycles.
	// The StateEvaluationExpression is applied to the TargetObject,
	// and an evaluation result of true indicates the end of a reconciliation cycle.
	// StateEvaluationExpression overrides the builtin default value.
	//
	// +optional
	StateEvaluationExpression *StateEvaluationExpression `json:"stateEvaluationExpression,omitempty"`

	// Locale specifies the locale to use when localizing the reconciliation trace.
	//
	// +optional
	Locale *string `json:"locale,omitempty"`
}

ReconciliationTraceSpec defines the desired state of ReconciliationTrace

func (*ReconciliationTraceSpec) DeepCopy

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

func (*ReconciliationTraceSpec) DeepCopyInto

func (in *ReconciliationTraceSpec) DeepCopyInto(out *ReconciliationTraceSpec)

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

type ReconciliationTraceStatus

type ReconciliationTraceStatus struct {
	// DryRunResult specifies the dry-run result.
	//
	// +optional
	DryRunResult *DryRunResult `json:"dryRunResult,omitempty"`

	// InitialObjectTree specifies the initial object tree when the latest reconciliation cycle started.
	//
	InitialObjectTree *ObjectTreeNode `json:"initialObjectTree"`

	// CurrentState is the current state of the latest reconciliation cycle,
	// that is the reconciliation process from the end of last reconciliation cycle until now.
	//
	CurrentState ReconciliationCycleState `json:"currentState"`

	// DesiredState is the desired state of the latest reconciliation cycle.
	//
	// +optional
	DesiredState *ReconciliationCycleState `json:"desiredState,omitempty"`
}

ReconciliationTraceStatus defines the observed state of ReconciliationTrace

func (*ReconciliationTraceStatus) DeepCopy

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

func (*ReconciliationTraceStatus) DeepCopyInto

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

type StateEvaluationExpression

type StateEvaluationExpression struct {
	// CELExpression specifies to use CEL to evaluation the object state.
	// The root object used in the expression is the primary object.
	//
	// +optional
	CELExpression *CELExpression `json:"celExpression,omitempty"`
}

StateEvaluationExpression defines an object state evaluation expression. Currently supported types: CEL - Common Expression Language (https://cel.dev/).

func (*StateEvaluationExpression) DeepCopy

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

func (*StateEvaluationExpression) DeepCopyInto

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