analysis

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackgroundLabels

func BackgroundLabels(podHash, instanceID string) map[string]string

BackgroundLabels returns a map[string]string of common labels for the background analysis

func BuildArgumentsForRolloutAnalysisRun

func BuildArgumentsForRolloutAnalysisRun(args []v1alpha1.AnalysisRunArgument, stableRS, newRS *appsv1.ReplicaSet) []v1alpha1.Argument

BuildArgumentsForRolloutAnalysisRun builds the arguments for a analysis base created by a rollout

func CreateWithCollisionCounter

func CreateWithCollisionCounter(logCtx *log.Entry, analysisRunIf argoprojclient.AnalysisRunInterface, run v1alpha1.AnalysisRun) (*v1alpha1.AnalysisRun, error)

CreateWithCollisionCounter attempts to create the given analysisrun and if an AlreadyExists error is encountered, and the existing run is semantically equal and running, returns the exiting run.

func FilterAnalysisRuns

func FilterAnalysisRuns(ars []*v1alpha1.AnalysisRun, cond func(ar *v1alpha1.AnalysisRun) bool) ([]*v1alpha1.AnalysisRun, []*v1alpha1.AnalysisRun)

func FilterAnalysisRunsByName

func FilterAnalysisRunsByName(analysisRuns []*v1alpha1.AnalysisRun, name string) *v1alpha1.AnalysisRun

FilterAnalysisRunsByName returns the analysisRuns with the name provided

func FilterAnalysisRunsByRolloutType

func FilterAnalysisRunsByRolloutType(analysisRuns []*v1alpha1.AnalysisRun, typeFilter string) []*v1alpha1.AnalysisRun

FilterAnalysisRunsByRolloutType returns a list of analysisRuns that have the rollout-type of the typeFilter

func FilterAnalysisRunsToDelete

func FilterAnalysisRunsToDelete(ars []*v1alpha1.AnalysisRun, olderRSs []*appsv1.ReplicaSet) []*v1alpha1.AnalysisRun

FilterAnalysisRunsToDelete returns a list of analysis runs that should be deleted in the cases where: 1. The analysis run has no pod hash label, 2. There is no ReplicaSet with the same pod hash as the analysis run 3. The ReplicaSet that has the same pod hash as the analysis run has a deletiontimestamp. Note: It is okay to use pod hash for filtering since the analysis run's pod hash is originally derived from the new RS. Even if there is a library change during the lifetime of the analysis run, the ReplicaSet's pod hash that the analysis run references does not change.

func FilterCurrentRolloutAnalysisRuns

func FilterCurrentRolloutAnalysisRuns(analysisRuns []*v1alpha1.AnalysisRun, r *v1alpha1.Rollout) ([]*v1alpha1.AnalysisRun, []*v1alpha1.AnalysisRun)

FilterCurrentRolloutAnalysisRuns returns analysisRuns that match the analysisRuns listed in the rollout status

func GetCurrentBackgroundAnalysisRun

func GetCurrentBackgroundAnalysisRun(currentArs []*v1alpha1.AnalysisRun) *v1alpha1.AnalysisRun

GetCurrentBackgroundAnalysisRun filters the currentArs and returns the background based analysis run

func GetCurrentStepAnalysisRun

func GetCurrentStepAnalysisRun(currentArs []*v1alpha1.AnalysisRun) *v1alpha1.AnalysisRun

GetCurrentStepAnalysisRun filters the currentArs and returns the step based analysis run

func GetInstanceID added in v0.7.0

func GetInstanceID(obj runtime.Object) string

GetInstanceID takes an object and returns the controller instance id if it has one

func GetResult

func GetResult(run *v1alpha1.AnalysisRun, metricName string) *v1alpha1.MetricResult

GetResult returns the metric result by name

func IsSemanticallyEqual

func IsSemanticallyEqual(left, right v1alpha1.AnalysisRunSpec) bool

IsSemanticallyEqual checks to see if two analysis runs are semantically equal

func IsTerminating

func IsTerminating(run *v1alpha1.AnalysisRun) bool

IsTerminating returns whether or not the analysis run is terminating, either because a terminate was requested explicitly, or because a metric has already measured Failed, Error, or Inconclusive which causes the run to end prematurely.

func IsWorse

func IsWorse(current, new v1alpha1.AnalysisPhase) bool

IsWorse returns whether or not the new health status code is a worser condition than the current. Both statuses must be already completed

func LastMeasurement

func LastMeasurement(run *v1alpha1.AnalysisRun, metricName string) *v1alpha1.Measurement

LastMeasurement returns the last measurement started or completed for a specific metric

func MergeArgs

func MergeArgs(incomingArgs, templateArgs []v1alpha1.Argument) ([]v1alpha1.Argument, error)

MergeArgs merges two lists of arguments, the incoming and the templates. If there are any unresolved arguments that have no value, raises an error.

func MetricCompleted

func MetricCompleted(run *v1alpha1.AnalysisRun, metricName string) bool

MetricCompleted returns whether or not a metric was completed or not

func NewAnalysisRunFromTemplate

func NewAnalysisRunFromTemplate(template *v1alpha1.AnalysisTemplate, args []v1alpha1.Argument, name, generateName, namespace string) (*v1alpha1.AnalysisRun, error)

func SetResult

func SetResult(run *v1alpha1.AnalysisRun, result v1alpha1.MetricResult)

SetResult updates the metric result

func SortAnalysisRunByPodHash

func SortAnalysisRunByPodHash(ars []*v1alpha1.AnalysisRun) map[string][]*v1alpha1.AnalysisRun

SortAnalysisRunByPodHash returns map with a podHash as a key and an array of analysisRuns with that pod hash

func StepLabels

func StepLabels(index int32, podHash, instanceID string) map[string]string

StepLabels returns a map[string]string of common labels for analysisruns created from an analysis step

func TerminateRun

func TerminateRun(analysisRunIf argoprojclient.AnalysisRunInterface, name string) error

TerminateRun terminates an analysis run

func ValidateMetric

func ValidateMetric(metric v1alpha1.Metric) error

ValidateMetric validates a single metric spec

func ValidateMetrics

func ValidateMetrics(metrics []v1alpha1.Metric) error

ValidateMetrics validates an analysis template spec

func Worst

func Worst(left, right v1alpha1.AnalysisPhase) v1alpha1.AnalysisPhase

Worst returns the worst of the two statuses

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL