Documentation
¶
Index ¶
- func AnnotateCurrentTrialChildren(ctx context.Context, c client.Client, namespace string, ...) error
- func AppendChainMember(members []apiv1.ResourceChainMemberStatus, reasons []string, ...) ([]apiv1.ResourceChainMemberStatus, []string)
- func AreVertexReplicasReady(existingUpgradingChildDef *unstructured.Unstructured) (bool, []string, error)
- func AssessAnalysisStatus(ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured, ...) (apiv1.AssessmentResult, error)
- func CalculateScaleMinMaxValues(podsCount int) int64
- func ChainPromoteAnnotationMatches(obj *unstructured.Unstructured) bool
- func ChainPromoteAnnotationValue(name, uid string) string
- func ChainPromoteApplies(obj *unstructured.Unstructured, currentTrialChildName string) bool
- func CheckRidersForDifferences(ctx context.Context, controller progressiveController, ...) (bool, error)
- func CombineAssessmentResults(results []apiv1.AssessmentResult) apiv1.AssessmentResult
- func CombineMemberAssessments(members []apiv1.ResourceChainMemberStatus) apiv1.AssessmentResult
- func ControllerChainFailed(ctx context.Context, c client.Client, namespace string) (bool, error)
- func CreateAnalysisRun(ctx context.Context, analysis apiv1.Analysis, ...) error
- func Discontinue(ctx context.Context, rolloutObject ProgressiveRolloutObject, ...) error
- func DiscontinueTrialOnRecyclableController(ctx context.Context, rolloutObject ProgressiveRolloutObject, ...) (bool, error)
- func ExtractScaleMinMaxAsJSONString(object map[string]any, pathToScale []string) (string, error)
- func ForcePromoteChainApplies(obj *unstructured.Unstructured, currentTrialChildName string) bool
- func GetAnalysisTemplatesFromRefs(ctx context.Context, templateRefs *[]argorolloutsv1.AnalysisTemplateRef, ...) ([]*argorolloutsv1.AnalysisTemplate, []*argorolloutsv1.ClusterAnalysisTemplate, ...)
- func IsPipelineTypePhaseHealthy(ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured) (bool, error)
- func IsUpgradeReplacementRequired(ctx context.Context, rolloutObject ProgressiveRolloutObject, ...) (bool, bool, error)
- func NewChainMember(kind, name, childName string, result apiv1.AssessmentResult) apiv1.ResourceChainMemberStatus
- func OutsideTrialChain(ctx context.Context, c client.Client, rollout ctlrcommon.RolloutObject, ...) (bool, error)
- func PerformAnalysis(ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured, ...) (*apiv1.AnalysisStatus, error)
- func PerformResourceHealthCheckForPipelineType(ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured, ...) (apiv1.AssessmentResult, []string, error)
- func PipelinesOnTrialISB(ctx context.Context, c client.Client, ...) ([]apiv1.ResourceChainMemberStatus, []string, error)
- func ProcessResource(ctx context.Context, rolloutObject ProgressiveRolloutObject, ...) (bool, bool, time.Duration, error)
- func PromotedChildAlreadyOnInstance(ctx context.Context, c client.Client, rollout ctlrcommon.RolloutObject, ...) (childName string, result apiv1.AssessmentResult, onInstance bool, err error)
- func StampForcePromoteChain(ctx context.Context, c client.Client, namespace string, ...) error
- func TrialControllerResourceAssessment(ctx context.Context, c client.Client, namespace string) (apiv1.ResourceChainMemberStatus, bool, string, error)
- func TrialISBServiceResourceAssessment(ctx context.Context, c client.Client, namespace, isbsvcName string) (apiv1.ResourceChainMemberStatus, bool, string, error)
- func UpdateUpgradingChildStatus(rollout ProgressiveRolloutObject, f func(*apiv1.UpgradingChildStatus)) *apiv1.UpgradingChildStatus
- func WorkloadsOnTrialController(ctx context.Context, c client.Client, ...) ([]apiv1.ResourceChainMemberStatus, []string, bool, error)
- type ProgressiveRolloutObject
- type SkipProgressiveAssessmentReason
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateCurrentTrialChildren ¶ added in v1.0.0
func AnnotateCurrentTrialChildren(ctx context.Context, c client.Client, namespace string, members []apiv1.ResourceChainMemberStatus) error
AnnotateCurrentTrialChildren writes the chain-promote annotation onto the trial child of each chain member whose resource assessment is Success. The value records that child's name and UID. A member whose named child is no longer its rollout's trial is skipped.
func AppendChainMember ¶ added in v1.0.0
func AppendChainMember(members []apiv1.ResourceChainMemberStatus, reasons []string, member apiv1.ResourceChainMemberStatus, reason string) ([]apiv1.ResourceChainMemberStatus, []string)
AppendChainMember adds member to the chain. A Failure contributes reason to the chain's failure reasons. Call this only for a member that is part of the chain.
func AreVertexReplicasReady ¶ added in v0.17.0
func AreVertexReplicasReady(existingUpgradingChildDef *unstructured.Unstructured) (bool, []string, error)
AreVertexReplicasReady checks if the number of ready replicas of a vertex matches or exceeds the desired replicas.
Parameters:
- existingUpgradingChildDef: An unstructured object representing the vertex whose replica status is being checked.
Returns:
- A boolean indicating whether the ready replicas are sufficient.
- In the case that ready replicas aren't sufficient, a message providing more information
func AssessAnalysisStatus ¶ added in v0.24.0
func AssessAnalysisStatus( ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured, analysisStatus *apiv1.AnalysisStatus) (apiv1.AssessmentResult, error)
func CalculateScaleMinMaxValues ¶ added in v0.14.0
func ChainPromoteAnnotationMatches ¶ added in v1.0.0
func ChainPromoteAnnotationMatches(obj *unstructured.Unstructured) bool
ChainPromoteAnnotationMatches reports whether obj carries a chain-promote annotation for itself. A replaced child with the same name and a new UID does not match.
func ChainPromoteAnnotationValue ¶ added in v1.0.0
ChainPromoteAnnotationValue identifies the exact child the promotion annotation was written for.
func ChainPromoteApplies ¶ added in v1.0.0
func ChainPromoteApplies(obj *unstructured.Unstructured, currentTrialChildName string) bool
ChainPromoteApplies reports whether obj is still the rollout's current trial child and the annotation was written for this exact object. Promotion then follows the normal path and does not run health checks again. This must happen before a spec change replaces that trial child.
func CheckRidersForDifferences ¶ added in v0.28.3
func CheckRidersForDifferences( ctx context.Context, controller progressiveController, rolloutObject ctlrcommon.RolloutObject, existingChildDef *unstructured.Unstructured, existingChildUpgradeState common.UpgradeState, newUpgradingChildDef *unstructured.Unstructured) (bool, error)
Do any Riders need updating? (including additions, modifications, or deletions) Compare the Riders which would be derived from the latest and greatest Rollout definition with those of either the existing "promoted" child or the existing "upgrading" child
func CombineAssessmentResults ¶ added in v1.0.0
func CombineAssessmentResults(results []apiv1.AssessmentResult) apiv1.AssessmentResult
CombineAssessmentResults folds the assessments of a resource chain into one result. Any Failure fails the chain. Any Unknown or empty result leaves the chain Unknown. The chain is Success only when every member is Success.
func CombineMemberAssessments ¶ added in v1.0.0
func CombineMemberAssessments(members []apiv1.ResourceChainMemberStatus) apiv1.AssessmentResult
CombineMemberAssessments folds ResourceChainMemberStatus assessments into one chain result.
func ControllerChainFailed ¶ added in v1.0.0
ControllerChainFailed reports whether the namespace has a trial NumaflowController, in a Progressive upgrade, whose chain assessment has failed. A new Pipeline, MonoVertex, or ISBService stays Pending until that chain succeeds, is reverted, or is force-promoted. Replacing a failed member moves the chain assessment back to Unknown, so the progressive-chain-failed label on the trial controller keeps the hold until one of those outcomes. A controller marked failed before that label existed is still held by progressive-result-state.
func CreateAnalysisRun ¶ added in v0.19.0
func CreateAnalysisRun(ctx context.Context, analysis apiv1.Analysis, existingUpgradingChildDef *unstructured.Unstructured, analysisRunName string, ownerReference metav1.OwnerReference, client client.Client, promotedChildName string) error
CreateAnalysisRun finds all templates specified in the Analysis field in the spec of a rollout and creates the resulting AnalysisRun in k8s.
Parameters:
- ctx: the context for managing request-scoped values.
- analysis: struct which contains templateRefs to AnalysisTemplates and ClusterAnalysisTemplates and arguments that can be passed and override values already specified in the templates
- existingUpgradingChildDef: the definition of the upgrading child as an unstructured object.
- analysisRunName: name to use for the AnalysisRun
- ownerReference: reference to the upgrading child this AnalysisRun is associated with - ensures cleanup
- client: the client used for interacting with the Kubernetes API.
- promotedChildName - argument we support in templates.
Returns:
- An error if any issues occur during processing.
func Discontinue ¶ added in v0.22.0
func Discontinue(ctx context.Context, rolloutObject ProgressiveRolloutObject, controller progressiveController, c client.Client, ) error
For a given Rollout, stop the Progressive upgrade Essentially, this just means removing any Upgrading children
func DiscontinueTrialOnRecyclableController ¶ added in v1.0.0
func DiscontinueTrialOnRecyclableController(ctx context.Context, rolloutObject ProgressiveRolloutObject, controller progressiveController, c client.Client) (bool, error)
DiscontinueTrialOnRecyclableController discontinues this rollout's trial when that trial is bound to a NumaflowController marked recyclable, such as a reverted trial controller. It returns true if the trial was discontinued. A promoted child is left alone: it moves to the newly promoted controller through a normal progressive upgrade.
func ExtractScaleMinMaxAsJSONString ¶ added in v0.19.0
ExtractScaleMinMaxAsJSONString returns a JSON string of the scale definition including only min and max fields extracted from the given unstructured object. It returns "null" if the pathToScale is not found.
func ForcePromoteChainApplies ¶ added in v1.0.0
func ForcePromoteChainApplies(obj *unstructured.Unstructured, currentTrialChildName string) bool
ForcePromoteChainApplies reports whether obj is still the rollout's current trial child and carries the force-promote-chain label. Like a chain-promote annotation, it must be honored before a spec change replaces that trial child.
func GetAnalysisTemplatesFromRefs ¶ added in v0.19.0
func GetAnalysisTemplatesFromRefs(ctx context.Context, templateRefs *[]argorolloutsv1.AnalysisTemplateRef, namespace string, c client.Client) ([]*argorolloutsv1.AnalysisTemplate, []*argorolloutsv1.ClusterAnalysisTemplate, error)
This function is repurposed from the Argo Rollout codebase here: https://github.com/argoproj/argo-rollouts/blob/f4f7eabd6bfa8c068abe1a7b62579aafeda25a0e/rollout/analysis.go#L469-L514
func IsPipelineTypePhaseHealthy ¶ added in v0.22.1
func IsPipelineTypePhaseHealthy(ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured) (bool, error)
func IsUpgradeReplacementRequired ¶ added in v0.28.3
func IsUpgradeReplacementRequired( ctx context.Context, rolloutObject ProgressiveRolloutObject, controller progressiveController, existingPromotedChildDef, existingUpgradingChildDef *unstructured.Unstructured, c client.Client, ) (bool, bool, error)
IsUpgradeReplacementRequired determines if the current spec requires replacing the Upgrading child. It compares the new spec against both the existing Upgrading child and the Promoted child. Returns: - differentFromExistingUpgrading: true if new spec differs from existing Upgrading child - differentFromPromoted: true if new spec differs from Promoted child - error if any
func NewChainMember ¶ added in v1.0.0
func NewChainMember(kind, name, childName string, result apiv1.AssessmentResult) apiv1.ResourceChainMemberStatus
NewChainMember builds a ResourceChainMemberStatus for a rollout in the chain.
func OutsideTrialChain ¶ added in v1.0.0
func OutsideTrialChain(ctx context.Context, c client.Client, rollout ctlrcommon.RolloutObject, upgrading *apiv1.UpgradingChildStatus) (bool, error)
OutsideTrialChain reports whether a rollout takes no part in the current trial chain: its trial was discontinued, or it has never created a child (a new rollout held Pending while the chain is failed).
func PerformAnalysis ¶ added in v0.24.0
func PerformAnalysis( ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured, rolloutObject ProgressiveRolloutObject, analysis apiv1.Analysis, analysisStatus *apiv1.AnalysisStatus, c client.Client, ) (*apiv1.AnalysisStatus, error)
func PerformResourceHealthCheckForPipelineType ¶ added in v0.24.0
func PerformResourceHealthCheckForPipelineType( ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured, verifyReplicasFunc func(existingUpgradingChildDef *unstructured.Unstructured) (bool, []string, error), ) (apiv1.AssessmentResult, []string, error)
PerformResourceHealthCheckForPipelineType makes an assessment of the upgrading child (either Pipeline or MonoVertex) to determine if it was successful, failed, or still not known Return assessment result along with reason (string) if it failed
Assessment result: Success: phase must be "Running" and all conditions must be True Failure: phase is "Failed" or any condition is False Unknown: neither of the above if met
func PipelinesOnTrialISB ¶ added in v1.0.0
func PipelinesOnTrialISB(ctx context.Context, c client.Client, namespace, isbsvcName, excludeRolloutName string) ([]apiv1.ResourceChainMemberStatus, []string, error)
PipelinesOnTrialISB returns the resource assessments of PipelineRollouts that belong on the trial ISBService isbsvcName, excluding excludeRolloutName. A Pipeline already rolling onto that ISBService contributes its resource assessment. A Pipeline with no upgrading child whose promoted child is already on that ISBService contributes its own health. A Pipeline whose spec uses the same ISBServiceRollout, but whose upgrading child is not on this ISBService yet, contributes Unknown so this Pipeline cannot promote ahead of it.
func ProcessResource ¶ added in v0.13.0
func ProcessResource( ctx context.Context, rolloutObject ProgressiveRolloutObject, existingPromotedChild *unstructured.Unstructured, promotedDifference bool, controller progressiveController, c client.Client, ) (bool, bool, time.Duration, error)
return: - whether the assessment is complete - whether the assessment failed - duration indicating the requeue delay for the controller to use for next reconciliation - error if any
func PromotedChildAlreadyOnInstance ¶ added in v1.0.0
func PromotedChildAlreadyOnInstance( ctx context.Context, c client.Client, rollout ctlrcommon.RolloutObject, instanceID string, ) (childName string, result apiv1.AssessmentResult, onInstance bool, err error)
PromotedChildAlreadyOnInstance reports the rollout's promoted child when that child is already bound to instanceID, and the assessment of the rollout's own health. A direct-applied change can land on the trial controller without creating an upgrading child. onInstance is false when there is no promoted child on instanceID; the caller treats that as not started.
func StampForcePromoteChain ¶ added in v1.0.0
func StampForcePromoteChain(ctx context.Context, c client.Client, namespace string, members []apiv1.ResourceChainMemberStatus) error
StampForcePromoteChain sets the force-promote-chain label on the trial child of each chain member. While a trial NumaflowController exists, a member's trial that is not bound to it is not part of that trial stack and is left alone. Each rollout then promotes its own trial child through the normal promotion path.
func TrialControllerResourceAssessment ¶ added in v1.0.0
func TrialControllerResourceAssessment(ctx context.Context, c client.Client, namespace string) (apiv1.ResourceChainMemberStatus, bool, string, error)
TrialControllerResourceAssessment returns the resource assessment of the trial NumaflowController in namespace, and whether a trial controller is part of the chain. No NumaflowControllerRollout, or no trial child, means the controller is not part of the chain.
func TrialISBServiceResourceAssessment ¶ added in v1.0.0
func TrialISBServiceResourceAssessment(ctx context.Context, c client.Client, namespace, isbsvcName string) (apiv1.ResourceChainMemberStatus, bool, string, error)
TrialISBServiceResourceAssessment returns the resource assessment of the named ISBService when that child is a trial, and whether it is part of the chain. A promoted ISBService is not part of the chain: a Pipeline upgrading on its own does not wait for it.
func UpdateUpgradingChildStatus ¶ added in v0.24.0
func UpdateUpgradingChildStatus(rollout ProgressiveRolloutObject, f func(*apiv1.UpgradingChildStatus)) *apiv1.UpgradingChildStatus
func WorkloadsOnTrialController ¶ added in v1.0.0
func WorkloadsOnTrialController(ctx context.Context, c client.Client, namespace, excludeKind, excludeName string) ([]apiv1.ResourceChainMemberStatus, []string, bool, error)
WorkloadsOnTrialController returns the resource assessments of ISBService, Pipeline, and MonoVertex rollouts in the namespace, excluding the rollout identified by excludeKind and excludeName. present is false when there is no trial controller. A rollout whose upgrading child is not bound to that controller instance contributes Unknown. A rollout outside the trial chain (see OutsideTrialChain) is not a member. A child already promoted onto the instance still counts, so a later workload is not blocked after an earlier one succeeds.
Types ¶
type ProgressiveRolloutObject ¶ added in v0.14.0
type ProgressiveRolloutObject interface {
ctlrcommon.RolloutObject
GetProgressiveStrategy() apiv1.ProgressiveStrategy
GetUpgradingChildStatus() *apiv1.UpgradingChildStatus
GetPromotedChildStatus() *apiv1.PromotedChildStatus
SetUpgradingChildStatus(*apiv1.UpgradingChildStatus)
// note this resets the entire Upgrading status struct which encapsulates the UpgradingChildStatus struct
ResetUpgradingChildStatus(upgradingChild *unstructured.Unstructured) error
SetPromotedChildStatus(*apiv1.PromotedChildStatus)
// note this resets the entire Promoted status struct which encapsulates the PromotedChildStatus struct
ResetPromotedChildStatus(promotedChild *unstructured.Unstructured) error
GetChildMetadata() apiv1.Metadata
}
ProgressiveRolloutObject describes a Rollout instance that supports progressive upgrade
type SkipProgressiveAssessmentReason ¶ added in v0.29.0
type SkipProgressiveAssessmentReason string
const ( SkipProgressiveAssessmentReasonUndefined SkipProgressiveAssessmentReason = "" SkipProgressiveAssessmentReasonForcePromote SkipProgressiveAssessmentReason = "force_promote" SkipProgressiveAssessmentReasonForcePromoteChain SkipProgressiveAssessmentReason = "force_promote_chain" SkipProgressiveAssessmentReasonProgressiveUnsupported SkipProgressiveAssessmentReason = "progressive_unsupported" SkipProgressiveAssessmentReasonNoDataIngestion SkipProgressiveAssessmentReason = "no_data_ingestion" SkipProgressiveAssessmentReasonRolloutConfiguration SkipProgressiveAssessmentReason = "rollout_configuration" )