Documentation ¶
Index ¶
- Constants
- Variables
- func InterpolateGenerator(requestedGenerator *argoprojiov1alpha1.ApplicationSetGenerator, ...) (argoprojiov1alpha1.ApplicationSetGenerator, error)
- type AppsGenerator
- type ClusterGenerator
- func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.ApplicationSetGenerator, ...) ([]map[string]interface{}, error)
- func (g *ClusterGenerator) GetRequeueAfter(_ *argoappsetv1alpha1.ApplicationSetGenerator) time.Duration
- func (g *ClusterGenerator) GetTemplate(appSetGenerator *argoappsetv1alpha1.ApplicationSetGenerator) *argoappsetv1alpha1.ApplicationSetTemplate
- type Generator
- func GetRelevantGenerators(requestedGenerator *argoprojiov1alpha1.ApplicationSetGenerator, ...) []Generator
- func NewClusterGenerator(c client.Client, ctx context.Context, clientset kubernetes.Interface, ...) Generator
- func NewListGenerator() Generator
- func NewMatrixGenerator(supportedGenerators map[string]Generator) Generator
- func NewMergeGenerator(supportedGenerators map[string]Generator) Generator
- type ListGenerator
- func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, ...) ([]map[string]interface{}, error)
- func (g *ListGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration
- func (g *ListGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
- type MatrixGenerator
- func (m *MatrixGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, ...) ([]map[string]interface{}, error)
- func (m *MatrixGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration
- func (m *MatrixGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
- type MergeGenerator
- func (m *MergeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, ...) ([]map[string]interface{}, error)
- func (m *MergeGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration
- func (m *MergeGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
- type TransformResult
Constants ¶
const ( ArgoCDSecretTypeLabel = "argocd.argoproj.io/secret-type" ArgoCDSecretTypeCluster = "cluster" )
Variables ¶
var ( ErrMoreThanTwoGenerators = fmt.Errorf("found more than two generators, Matrix support only two") ErrLessThanTwoGenerators = fmt.Errorf("found less than two generators, Matrix support only two") ErrMoreThenOneInnerGenerators = fmt.Errorf("found more than one generator in matrix.Generators") )
var ( ErrLessThanTwoGeneratorsInMerge = fmt.Errorf("found less than two generators, Merge requires two or more") ErrNoMergeKeys = fmt.Errorf("no merge keys were specified, Merge requires at least one") ErrNonUniqueParamSets = fmt.Errorf("the parameters from a generator were not unique by the given mergeKeys, Merge requires all param sets to be unique") )
var EmptyAppSetGeneratorError = errors.New("ApplicationSet is empty")
var NoRequeueAfter time.Duration
Functions ¶
func InterpolateGenerator ¶
func InterpolateGenerator(requestedGenerator *argoprojiov1alpha1.ApplicationSetGenerator, params map[string]interface{}, useGoTemplate bool, goTemplateOptions []string) (argoprojiov1alpha1.ApplicationSetGenerator, error)
InterpolateGenerator allows interpolating the matrix's 2nd child generator with values from the 1st child generator "params" parameter is an array, where each index corresponds to a generator. Each index contains a map w/ that generator's parameters.
Types ¶
type AppsGenerator ¶
type AppsGenerator interface {
GenerateApplicationSetApps(ctx context.Context, appset argov1alpha1.ApplicationSet, ctr *container.Container) ([]argov1alpha1.Application, error)
}
func New ¶
func New() AppsGenerator
type ClusterGenerator ¶
ClusterGenerator generates Applications for some or all clusters registered with ArgoCD.
func (*ClusterGenerator) GenerateParams ¶
func (g *ClusterGenerator) GenerateParams(appSetGenerator *argoappsetv1alpha1.ApplicationSetGenerator, appSet *argoappsetv1alpha1.ApplicationSet) ([]map[string]interface{}, error)
func (*ClusterGenerator) GetRequeueAfter ¶
func (g *ClusterGenerator) GetRequeueAfter(_ *argoappsetv1alpha1.ApplicationSetGenerator) time.Duration
GetRequeueAfter never requeue the cluster generator because the `clusterSecretEventHandler` will requeue the appsets when the cluster secrets change
func (*ClusterGenerator) GetTemplate ¶
func (g *ClusterGenerator) GetTemplate(appSetGenerator *argoappsetv1alpha1.ApplicationSetGenerator) *argoappsetv1alpha1.ApplicationSetTemplate
type Generator ¶
type Generator interface { // GenerateParams interprets the ApplicationSet and generates all relevant parameters for the application template. // The expected / desired list of parameters is returned, it then will be render and reconciled // against the current state of the Applications in the cluster. GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error) // GetRequeueAfter is the generator can controller the next reconciled loop // In case there is more then one generator the time will be the minimum of the times. // In case NoRequeueAfter is empty, it will be ignored GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration // GetTemplate returns the inline template from the spec if there is any, or an empty object otherwise GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate }
Generator defines the interface implemented by all ApplicationSet generators.
func GetRelevantGenerators ¶
func GetRelevantGenerators(requestedGenerator *argoprojiov1alpha1.ApplicationSetGenerator, generators map[string]Generator) []Generator
func NewClusterGenerator ¶
func NewListGenerator ¶
func NewListGenerator() Generator
func NewMatrixGenerator ¶
func NewMergeGenerator ¶
NewMergeGenerator returns a MergeGenerator which allows the given supportedGenerators as child generators.
type ListGenerator ¶
type ListGenerator struct { }
func (*ListGenerator) GenerateParams ¶
func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error)
func (*ListGenerator) GetRequeueAfter ¶
func (g *ListGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration
func (*ListGenerator) GetTemplate ¶
func (g *ListGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
type MatrixGenerator ¶
type MatrixGenerator struct {
// contains filtered or unexported fields
}
func (*MatrixGenerator) GenerateParams ¶
func (m *MatrixGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error)
func (*MatrixGenerator) GetRequeueAfter ¶
func (m *MatrixGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration
func (*MatrixGenerator) GetTemplate ¶
func (m *MatrixGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
type MergeGenerator ¶
type MergeGenerator struct {
// contains filtered or unexported fields
}
func (*MergeGenerator) GenerateParams ¶
func (m *MergeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, appSet *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error)
GenerateParams gets the params produced by the MergeGenerator.
func (*MergeGenerator) GetRequeueAfter ¶
func (m *MergeGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration
func (*MergeGenerator) GetTemplate ¶
func (m *MergeGenerator) GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
GetTemplate gets the Template field for the MergeGenerator.
type TransformResult ¶
type TransformResult struct { Params []map[string]interface{} Template argoprojiov1alpha1.ApplicationSetTemplate }
func Transform ¶
func Transform(requestedGenerator argoprojiov1alpha1.ApplicationSetGenerator, allGenerators map[string]Generator, baseTemplate argoprojiov1alpha1.ApplicationSetTemplate, appSet *argoprojiov1alpha1.ApplicationSet, genParams map[string]interface{}) ([]TransformResult, error)
Transform a spec generator to list of paramSets and a template