Documentation
¶
Index ¶
- func AreVertexReplicasReady(existingUpgradingChildDef *unstructured.Unstructured) (bool, string, error)
- func AssessAnalysisStatus(ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured, ...) (apiv1.AssessmentResult, string, error)
- func CalculateFailureReason(replicasFailureReason, phase string, failedCondition *metav1.Condition) string
- func CalculateScaleMinMaxValues(podsCount int) int64
- func CreateAnalysisRun(ctx context.Context, analysis apiv1.Analysis, ...) error
- func Discontinue(ctx context.Context, rolloutObject ProgressiveRolloutObject, ...) error
- func ExtractScaleMinMax(object map[string]any, pathToScale []string) (*apiv1.ScaleDefinition, error)
- func ExtractScaleMinMaxAsJSONString(object map[string]any, pathToScale []string) (string, error)
- func GetAnalysisTemplatesFromRefs(ctx context.Context, templateRefs *[]argorolloutsv1.AnalysisTemplateRef, ...) ([]*argorolloutsv1.AnalysisTemplate, []*argorolloutsv1.ClusterAnalysisTemplate, ...)
- func IsPipelineTypePhaseHealthy(ctx context.Context, existingUpgradingChildDef *unstructured.Unstructured) (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 ProcessResource(ctx context.Context, rolloutObject ProgressiveRolloutObject, ...) (bool, time.Duration, error)
- func UpdateUpgradingChildStatus(rollout ProgressiveRolloutObject, f func(*apiv1.UpgradingChildStatus)) *apiv1.UpgradingChildStatus
- type ProgressiveRolloutObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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, string, error)
func CalculateFailureReason ¶ added in v0.18.1
func CalculateFailureReason(replicasFailureReason, phase string, failedCondition *metav1.Condition) string
CalculateFailureReason issues a reason for failure; if there are multiple reasons, it returns one of them
func CalculateScaleMinMaxValues ¶ added in v0.14.0
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 ExtractScaleMinMax ¶ added in v0.19.0
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 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 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 ProcessResource ¶ added in v0.13.0
func ProcessResource( ctx context.Context, rolloutObject ProgressiveRolloutObject, existingPromotedChild *unstructured.Unstructured, promotedDifference bool, controller progressiveController, c client.Client, ) (bool, time.Duration, error)
return: - whether we're done - duration indicating the requeue delay for the controller to use for next reconciliation - error if any
func UpdateUpgradingChildStatus ¶ added in v0.24.0
func UpdateUpgradingChildStatus(rollout ProgressiveRolloutObject, f func(*apiv1.UpgradingChildStatus)) *apiv1.UpgradingChildStatus
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 }
ProgressiveRolloutObject describes a Rollout instance that supports progressive upgrade