Documentation
¶
Index ¶
- Constants
- func GetComponent(ctx context.Context, c client.Client, obj client.Object) (*choreov1.Component, error)
- func GetComponentName(obj client.Object) string
- func GetDeployableArtifact(ctx context.Context, c client.Client, obj client.Object) (*choreov1.DeployableArtifact, error)
- func GetDeployableArtifactName(obj client.Object) string
- func GetDeployment(ctx context.Context, c client.Client, obj client.Object) (*choreov1.Deployment, error)
- func GetDeploymentByEnvironment(ctx context.Context, c client.Client, obj client.Object, envName string) (*choreov1.Deployment, error)
- func GetDeploymentByName(ctx context.Context, c client.Client, obj client.Object, deploymentName string) (*choreov1.Deployment, error)
- func GetDeploymentName(obj client.Object) string
- func GetDeploymentPipeline(ctx context.Context, c client.Client, obj client.Object, dpName string) (*choreov1.DeploymentPipeline, error)
- func GetDeploymentTrack(ctx context.Context, c client.Client, obj client.Object) (*choreov1.DeploymentTrack, error)
- func GetDeploymentTrackName(obj client.Object) string
- func GetDescription(obj client.Object) string
- func GetDisplayName(obj client.Object) string
- func GetEnvironment(ctx context.Context, c client.Client, obj client.Object) (*choreov1.Environment, error)
- func GetEnvironmentByName(ctx context.Context, c client.Client, obj client.Object, envName string) (*choreov1.Environment, error)
- func GetEnvironmentName(obj client.Object) string
- func GetName(obj client.Object) string
- func GetOrganizationName(obj client.Object) string
- func GetProject(ctx context.Context, c client.Client, obj client.Object) (*choreov1.Project, error)
- func GetProjectName(obj client.Object) string
- func IgnoreHierarchyNotFoundError(err error) error
- func NeedConditionUpdate(currentConditions, updatedConditions []metav1.Condition) bool
- func NewCondition(conditionType ConditionType, status metav1.ConditionStatus, ...) metav1.Condition
- func NewHierarchyNotFoundError(obj client.Object, parentObj client.Object, ...) error
- func UpdateCondition(ctx context.Context, c client.StatusWriter, resource client.Object, ...) error
- func UpdateStatusConditions[T ConditionedObject](ctx context.Context, c client.Client, current, updated T) error
- func UpdateStatusConditionsAndRequeue[T ConditionedObject](ctx context.Context, c client.Client, current, updated T) (ctrl.Result, error)
- func UpdateStatusConditionsAndRequeueAfter[T ConditionedObject](ctx context.Context, c client.Client, current, updated T, ...) (ctrl.Result, error)
- func UpdateStatusConditionsAndReturn[T ConditionedObject](ctx context.Context, c client.Client, current, updated T) (ctrl.Result, error)
- func UpdateStatusConditionsAndReturnError[T ConditionedObject](ctx context.Context, c client.Client, current, updated T, err error) (ctrl.Result, error)
- type ConditionReason
- type ConditionType
- type ConditionedObject
- type HierarchyNotFoundError
Constants ¶
const ( AnnotationKeyDisplayName = "core.choreo.dev/display-name" AnnotationKeyDescription = "core.choreo.dev/description" )
const ( TypeAccepted = "Accepted" TypeProgressing = "Progressing" TypeAvailable = "Available" TypeCreated = "Created" TypeReady = "Ready" )
States for conditions
Variables ¶
This section is empty.
Functions ¶
func GetComponent ¶
func GetComponentName ¶
GetComponentName returns the component name that the object belongs to.
func GetDeployableArtifact ¶
func GetDeployableArtifactName ¶
GetDeployableArtifactName returns the deployable artifact name that the object belongs to.
func GetDeployment ¶
func GetDeploymentByName ¶
func GetDeploymentName ¶
GetDeploymentName returns the deployment name that the object belongs to.
func GetDeploymentPipeline ¶
func GetDeploymentTrack ¶
func GetDeploymentTrackName ¶
GetDeploymentTrackName returns the deployment track name that the object belongs to.
func GetDescription ¶
GetDescription returns the description of the object.
func GetDisplayName ¶
GetDisplayName returns the display name of the object.
func GetEnvironment ¶
func GetEnvironmentByName ¶
func GetEnvironmentName ¶
GetEnvironmentName returns the environment name that the object belongs to.
func GetName ¶
GetName returns the name of the object. This is specific to the Choreo, and it is not the Kubernetes object name.
func GetOrganizationName ¶
GetOrganizationName returns the organization name that the object belongs to.
func GetProject ¶
func GetProjectName ¶
GetProjectName returns the project name that the object belongs to.
func IgnoreHierarchyNotFoundError ¶
IgnoreHierarchyNotFoundError returns nil if the given error is a HierarchyNotFoundError. This is useful during the reconciliation process to ignore the error if the parent object is not found and avoid retrying.
func NeedConditionUpdate ¶
NeedConditionUpdate checks if the conditions need to be updated based on the current and updated conditions.
func NewCondition ¶
func NewCondition(conditionType ConditionType, status metav1.ConditionStatus, reason ConditionReason, message string, observedGeneration int64) metav1.Condition
NewCondition creates a new condition with the last transition time set to the current time.
func NewHierarchyNotFoundError ¶
func NewHierarchyNotFoundError(obj client.Object, parentObj client.Object, parentHierarchyObjs ...client.Object) error
NewHierarchyNotFoundError creates a new error with the given object and parent object details. The parentObj is the immediate parent of the obj The parentHierarchyObjs are the hierarchy of objects from the parentObj to the top level object starting from the top level object. Example: NewHierarchyNotFoundError(deployment, deploymentTrack, organization, project, component)
func UpdateCondition ¶
func UpdateCondition( ctx context.Context, c client.StatusWriter, resource client.Object, conditions *[]metav1.Condition, conditionType string, status metav1.ConditionStatus, reason, message string, ) error
UpdateCondition updates or adds a condition to any resource that has a Status with Conditions
func UpdateStatusConditions ¶
func UpdateStatusConditions[T ConditionedObject]( ctx context.Context, c client.Client, current, updated T, ) error
UpdateStatusConditions will compare the current and updated conditions and update the status conditions if needed.
func UpdateStatusConditionsAndRequeue ¶
func UpdateStatusConditionsAndRequeue[T ConditionedObject]( ctx context.Context, c client.Client, current, updated T, ) (ctrl.Result, error)
UpdateStatusConditionsAndRequeue updates status conditions and requests a requeue. This indicates that the controller should requeue the request for further processing. It returns an error if the status update fails.
func UpdateStatusConditionsAndRequeueAfter ¶
func UpdateStatusConditionsAndRequeueAfter[T ConditionedObject]( ctx context.Context, c client.Client, current, updated T, duration time.Duration, ) (ctrl.Result, error)
UpdateStatusConditionsAndRequeueAfter updates status conditions and requeues after the specified duration. It returns an error if the status update fails.
func UpdateStatusConditionsAndReturn ¶
func UpdateStatusConditionsAndReturn[T ConditionedObject]( ctx context.Context, c client.Client, current, updated T, ) (ctrl.Result, error)
UpdateStatusConditionsAndReturn updates status conditions without requeuing. It returns an error if the update fails.
func UpdateStatusConditionsAndReturnError ¶
func UpdateStatusConditionsAndReturnError[T ConditionedObject]( ctx context.Context, c client.Client, current, updated T, err error, ) (ctrl.Result, error)
UpdateStatusConditionsAndReturnError updates status conditions and returns the given error. It returns an update error if the conditions update fails. It prioritizes the status update error over the provided error, if any.
Types ¶
type ConditionReason ¶
type ConditionReason string
ConditionReason represents the machine-readable reason for a condition's status. Use CamelCase format (e.g., MinimumReplicasUnavailable, MinimumReplicasMet).
type ConditionType ¶
type ConditionType string
ConditionType represents the type of condition describing a specific state of the resource. Use CamelCase format (e.g., Ready, Available).
func (ConditionType) String ¶
func (c ConditionType) String() string
String returns the string representation of the condition type.
type ConditionedObject ¶
type ConditionedObject interface { client.Object GetConditions() []metav1.Condition SetConditions(conditions []metav1.Condition) }
ConditionedObject describes a Kubernetes resource that has a mutable Conditions field in its Status
type HierarchyNotFoundError ¶
type HierarchyNotFoundError struct {
// contains filtered or unexported fields
}
HierarchyNotFoundError is an error type that is used to indicate that a parent object in the hierarchy is not found.
func (*HierarchyNotFoundError) Error ¶
func (e *HierarchyNotFoundError) Error() string