Documentation
¶
Index ¶
Constants ¶
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" // ReasonAutoDeployFailed indicates failure to handle autoDeploy (ComponentRelease/ReleaseBinding creation) ReasonAutoDeployFailed controller.ConditionReason = "AutoDeployFailed" )
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" )
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 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.
Types ¶
type Reconciler ¶
type Reconciler struct {
client.Client
// IsGitOpsMode indicates whether the controller is running in GitOps mode
// In GitOps mode, the controller will not create or update resources directly in the cluster,
// but will instead generate the necessary manifests and creates GitCommitRequests to update the Git repository.
IsGitOpsMode bool
Scheme *runtime.Scheme
}
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 embedded ComponentType specification
ComponentType openchoreov1alpha1.ComponentTypeSpec `json:"componentType"`
// Traits maps trait names to their specifications
Traits map[string]openchoreov1alpha1.TraitSpec `json:"traits,omitempty"`
// ComponentProfile contains parameter values and trait configurations
ComponentProfile openchoreov1alpha1.ComponentProfile `json:"componentProfile"`
// 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 BuildReleaseSpec ¶ added in v0.5.0
func BuildReleaseSpec( ct *openchoreov1alpha1.ComponentType, traits []openchoreov1alpha1.Trait, comp *openchoreov1alpha1.Component, workload *openchoreov1alpha1.Workload, ) (*ReleaseSpec, error)
BuildReleaseSpec constructs a ReleaseSpec from the component's related resources. This extracts the immutable snapshot data needed for hashing.
This follows the pattern of building template specs in Kubernetes controllers.