Documentation
¶
Index ¶
Constants ¶
const ( // ConditionReady indicates that the Component has been successfully reconciled. // When autoDeploy is enabled, this means ComponentRelease and ReleaseBinding are created/updated. // When autoDeploy is disabled, this means the Component has been validated. ConditionReady controller.ConditionType = "Ready" // ConditionFinalizing indicates that the Component is being finalized (deleted). ConditionFinalizing controller.ConditionType = "Finalizing" )
const ( // ReasonReconciled indicates the Component has been successfully validated // Used when autoDeploy is disabled - only validation is performed ReasonReconciled controller.ConditionReason = "Reconciled" // ReasonComponentReleaseReady indicates ComponentRelease and ReleaseBinding are successfully created/updated // Used when autoDeploy is enabled ReasonComponentReleaseReady controller.ConditionReason = "ComponentReleaseReady" // ReasonWorkloadNotFound indicates the referenced Workload doesn't exist ReasonWorkloadNotFound controller.ConditionReason = "WorkloadNotFound" // ReasonComponentTypeNotFound indicates the referenced ComponentType doesn't exist ReasonComponentTypeNotFound controller.ConditionReason = "ComponentTypeNotFound" // ReasonTraitNotFound indicates one or more referenced Traits don't exist ReasonTraitNotFound controller.ConditionReason = "TraitNotFound" // ReasonProjectNotFound indicates the referenced Project doesn't exist ReasonProjectNotFound controller.ConditionReason = "ProjectNotFound" // ReasonDeploymentPipelineNotFound indicates the deployment pipeline is not found ReasonDeploymentPipelineNotFound controller.ConditionReason = "DeploymentPipelineNotFound" // ReasonInvalidConfiguration indicates the Component configuration is invalid ReasonInvalidConfiguration controller.ConditionReason = "InvalidConfiguration" // ReasonWorkflowNotAllowed indicates the referenced Workflow is not in allowedWorkflows ReasonWorkflowNotAllowed controller.ConditionReason = "WorkflowNotAllowed" // ReasonWorkflowNotFound indicates the referenced Workflow doesn't exist ReasonWorkflowNotFound controller.ConditionReason = "WorkflowNotFound" // ReasonAutoDeployFailed indicates failure to handle autoDeploy (ComponentRelease/ReleaseBinding creation) ReasonAutoDeployFailed controller.ConditionReason = "AutoDeployFailed" // ReasonFinalizing indicates the Component is being finalized ReasonFinalizing controller.ConditionReason = "Finalizing" )
const (
// ComponentFinalizer is the finalizer that ensures owned resources are deleted before Component
ComponentFinalizer = "openchoreo.dev/component-cleanup"
)
Variables ¶
This section is empty.
Functions ¶
func ComputeReleaseHash ¶ added in v0.5.0
func ComputeReleaseHash(template *ReleaseSpec, collisionCount *int32) string
ComputeReleaseHash returns a hash value calculated from the release spec and a collisionCount to avoid hash collision. The hash will be safe encoded to avoid bad words.
This is a type-safe wrapper around hash.ComputeHash for ReleaseSpec. This follows the same pattern as Kubernetes controller.ComputeHash.
func EqualReleaseTemplate ¶ added in v0.5.0
func EqualReleaseTemplate(lhs, rhs *ReleaseSpec) bool
EqualReleaseTemplate returns true if lhs and rhs have the same hash. This is used to determine if two release specs are semantically equivalent.
This follows the pattern of EqualRevision in Kubernetes controller_history.go.
func NewComponentFinalizingCondition ¶
NewComponentFinalizingCondition creates a condition indicating the Component is being finalized.
Types ¶
type Reconciler ¶
Reconciler reconciles a Component object
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ReleaseSpec ¶ added in v0.5.0
type ReleaseSpec struct {
// ComponentType is the frozen ComponentType snapshot (kind, name, and spec)
ComponentType openchoreov1alpha1.ComponentReleaseComponentType `json:"componentType"`
// Traits holds the frozen trait specifications, sorted by (Kind, Name) for deterministic hashing.
Traits []openchoreov1alpha1.ComponentReleaseTrait `json:"traits,omitempty"`
// ComponentProfile contains parameter values and trait configurations
ComponentProfile *openchoreov1alpha1.ComponentProfile `json:"componentProfile,omitempty"`
// Workload is the embedded Workload template specification
Workload openchoreov1alpha1.WorkloadTemplateSpec `json:"workload"`
}
ReleaseSpec represents the immutable data that defines a ComponentRelease. This structure is used to compute a hash that uniquely identifies a specific configuration of a component ready for release.
func ReleaseSpecFromComponentReleaseSpec ¶ added in v1.0.0
func ReleaseSpecFromComponentReleaseSpec(spec *openchoreov1alpha1.ComponentReleaseSpec) *ReleaseSpec
ReleaseSpecFromComponentReleaseSpec derives a ReleaseSpec from a ComponentReleaseSpec, excluding the Owner field to preserve hash compatibility. Traits are sorted by (Kind, Name) to ensure the hash is deterministic regardless of the order in which traits were collected.