generators

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArgoCDSecretTypeLabel   = "argocd.argoproj.io/secret-type"
	ArgoCDSecretTypeCluster = "cluster"
)
View Source
const (
	DefaultPullRequestRequeueAfterSeconds = 30 * time.Minute
)
View Source
const (
	DefaultRequeueAfterSeconds = 3 * time.Minute
)

DefaultRequeueAfterSeconds is used when GetRequeueAfter is not specified, it is the default time to wait before the next reconcile loop

View Source
const (
	DefaultSCMProviderRequeueAfterSeconds = 30 * time.Minute
)

Variables

View Source
var (
	ErrMoreThanTwoGenerators      = errors.New("found more than two generators, Matrix support only two")
	ErrLessThanTwoGenerators      = errors.New("found less than two generators, Matrix support only two")
	ErrMoreThenOneInnerGenerators = errors.New("found more than one generator in matrix.Generators")
)
View Source
var (
	ErrLessThanTwoGeneratorsInMerge = errors.New("found less than two generators, Merge requires two or more")
	ErrNoMergeKeys                  = errors.New("no merge keys were specified, Merge requires at least one")
	ErrNonUniqueParamSets           = errors.New("the parameters from a generator were not unique by the given mergeKeys, Merge requires all param sets to be unique")
)
View Source
var EmptyAppSetGeneratorError = errors.New("ApplicationSet is empty")
View Source
var NoRequeueAfter time.Duration

Functions

This section is empty.

Types

type ClusterGenerator

type ClusterGenerator struct {
	client.Client
	// contains filtered or unexported fields
}

ClusterGenerator generates Applications for some or all clusters registered with ArgoCD.

func (*ClusterGenerator) GenerateParams

func (*ClusterGenerator) GetRequeueAfter

func (g *ClusterGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

func (*ClusterGenerator) GetTemplate

type DuckTypeGenerator

type DuckTypeGenerator struct {
	// contains filtered or unexported fields
}

DuckTypeGenerator generates Applications for some or all clusters registered with ArgoCD.

func (*DuckTypeGenerator) GenerateParams

func (*DuckTypeGenerator) GetRequeueAfter

func (g *DuckTypeGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

func (*DuckTypeGenerator) GetTemplate

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]string, error)

	// GetRequeueAfter is the 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 NewClusterGenerator(c client.Client, ctx context.Context, clientset kubernetes.Interface, namespace string) Generator

func NewDuckTypeGenerator

func NewDuckTypeGenerator(ctx context.Context, dynClient dynamic.Interface, clientset kubernetes.Interface, namespace string) Generator

func NewGitGenerator

func NewGitGenerator(repos services.Repos) Generator

func NewListGenerator

func NewListGenerator() Generator

func NewMatrixGenerator

func NewMatrixGenerator(supportedGenerators map[string]Generator) Generator

func NewMergeGenerator

func NewMergeGenerator(supportedGenerators map[string]Generator) Generator

NewMergeGenerator returns a MergeGenerator which allows the given supportedGenerators as child generators.

func NewPullRequestGenerator

func NewPullRequestGenerator(client client.Client) Generator

func NewSCMProviderGenerator

func NewSCMProviderGenerator(client client.Client) Generator

type GitGenerator

type GitGenerator struct {
	// contains filtered or unexported fields
}

func (*GitGenerator) GenerateParams

func (*GitGenerator) GetRequeueAfter

func (g *GitGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

type ListGenerator

type ListGenerator struct {
}

func (*ListGenerator) GenerateParams

func (*ListGenerator) GetRequeueAfter

func (g *ListGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

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]string, error)

func (*MatrixGenerator) GetRequeueAfter

func (m *MatrixGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

func (*MatrixGenerator) GetTemplate

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]string, error)

GenerateParams gets the params produced by the MergeGenerator.

func (*MergeGenerator) GetRequeueAfter

func (m *MergeGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

func (*MergeGenerator) GetTemplate

GetTemplate gets the Template field for the MergeGenerator.

type PullRequestGenerator

type PullRequestGenerator struct {
	// contains filtered or unexported fields
}

func (*PullRequestGenerator) GenerateParams

func (g *PullRequestGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]string, error)

func (*PullRequestGenerator) GetRequeueAfter

func (g *PullRequestGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

func (*PullRequestGenerator) GetTemplate

type SCMProviderGenerator

type SCMProviderGenerator struct {
	// contains filtered or unexported fields
}

func (*SCMProviderGenerator) GenerateParams

func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]string, error)

func (*SCMProviderGenerator) GetRequeueAfter

func (g *SCMProviderGenerator) GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration

func (*SCMProviderGenerator) GetTemplate

type TransformResult

type TransformResult struct {
	Params   []map[string]string
	Template argoprojiov1alpha1.ApplicationSetTemplate
}

func Transform

Transform a spec generator to list of paramSets and a template

Jump to

Keyboard shortcuts

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