Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisRunBuilder ¶
type AnalysisRunBuilder struct {
// contains filtered or unexported fields
}
AnalysisRunBuilder constructs AnalysisRun objects with consistent configuration.
func NewAnalysisRunBuilder ¶
func NewAnalysisRunBuilder(c client.Client, cfg Config) *AnalysisRunBuilder
NewAnalysisRunBuilder creates a new AnalysisRunBuilder with the provided client and configuration.
func (*AnalysisRunBuilder) Build ¶
func (b *AnalysisRunBuilder) Build( ctx context.Context, namespace string, cfg *kargoapi.Verification, opt ...AnalysisRunOption, ) (*rolloutsapi.AnalysisRun, error)
Build creates a new AnalysisRun from the provided verification and options.
type AnalysisRunOption ¶
type AnalysisRunOption interface {
ApplyToAnalysisRun(*AnalysisRunOptions)
}
AnalysisRunOption is an option for configuring the build of an AnalysisRun.
type AnalysisRunOptions ¶
type AnalysisRunOptions struct {
NamePrefix string
NameSuffix string
ExtraLabels map[string]string
ExtraAnnotations map[string]string
Owners []Owner
ExpressionConfig *ArgumentEvaluationConfig
}
AnalysisRunOptions holds the options for building an AnalysisRun.
func (*AnalysisRunOptions) Apply ¶
func (o *AnalysisRunOptions) Apply(opts ...AnalysisRunOption)
Apply applies the given options to the AnalysisRunOptions.
type ArgumentEvaluationConfig ¶
type ArgumentEvaluationConfig struct {
// Env is a (nested) map of variables that can be used in the expressions.
// The keys are the variable names, and the values are the variable values.
// When the value itself is a map, it is considered a nested variable and
// can be accessed using dot notation. e.g. `${{ foo.bar }}`.
//
// Note: The Env map can be modified by the builder to add additional
// information. For example, to add any evaluated Vars.
Env map[string]any
// Vars are the variables that can be used in the expressions. They are
// evaluated in the order they are defined. After the evaluation of the
// variables, they are available in the Env map as `${{ vars.<name>}}`.
Vars []kargoapi.ExpressionVariable
// Options are the options for the expression evaluation. It can be used to
// configure the behavior of the expression evaluation and the functions
// available.
Options []expr.Option
}
ArgumentEvaluationConfig holds the configuration for the evaluation of expressions in the AnalysisRun arguments. It contains the environment variables, the variables, and the options for the expression evaluation.
Note: The builder may modify the Env map to add additional information. For example, to add any evaluated Vars. Because of this, it is recommended not to reuse the same ArgumentEvaluationConfig or Env map for multiple builds without making use of a deep copy.
type Config ¶
type Config struct {
// ControllerInstanceID is the unique identifier for the Argo Rollouts
// controller instance. If set, any AnalysisRun created by the builder
// will have this value set as a label.
ControllerInstanceID string
}
Config holds the configuration for the AnalysisRunBuilder.
type Owner ¶
type Owner struct {
APIVersion string
Kind string
Reference types.NamespacedName
BlockDeletion bool
}
Owner represents a reference to an owner object.
type WithArgumentEvaluationConfig ¶
type WithArgumentEvaluationConfig ArgumentEvaluationConfig
WithArgumentEvaluationConfig sets the argument evaluation configuration for the AnalysisRun. By default, the environment is empty, and only the builtin functions are available.
func (WithArgumentEvaluationConfig) ApplyToAnalysisRun ¶
func (o WithArgumentEvaluationConfig) ApplyToAnalysisRun(opts *AnalysisRunOptions)
type WithExtraAnnotations ¶
WithExtraAnnotations sets the extra labels for the AnalysisRun. It can be passed multiple times to add more annotations.
func (WithExtraAnnotations) ApplyToAnalysisRun ¶
func (o WithExtraAnnotations) ApplyToAnalysisRun(opts *AnalysisRunOptions)
type WithExtraLabels ¶
WithExtraLabels sets the extra labels for the AnalysisRun. It can be passed multiple times to add more labels.
func (WithExtraLabels) ApplyToAnalysisRun ¶
func (o WithExtraLabels) ApplyToAnalysisRun(opts *AnalysisRunOptions)
type WithNamePrefix ¶
type WithNamePrefix string
WithNamePrefix sets the name prefix for the AnalysisRun. If it is longer than maxNamePrefixLength, it will be truncated.
func (WithNamePrefix) ApplyToAnalysisRun ¶
func (o WithNamePrefix) ApplyToAnalysisRun(opts *AnalysisRunOptions)
type WithNameSuffix ¶
type WithNameSuffix string
WithNameSuffix sets the name suffix for the AnalysisRun. If it is longer than maxNameSuffixLength, it will be truncated.
func (WithNameSuffix) ApplyToAnalysisRun ¶
func (o WithNameSuffix) ApplyToAnalysisRun(opts *AnalysisRunOptions)
type WithOwner ¶
type WithOwner Owner
WithOwner sets the owner for the AnalysisRun. It can be passed multiple times to add more owners.
func (WithOwner) ApplyToAnalysisRun ¶
func (o WithOwner) ApplyToAnalysisRun(opts *AnalysisRunOptions)