github.com/argoproj/argo-cd/v2@v2.10.9/applicationset/generators/interface.go (about)

     1  package generators
     2  
     3  import (
     4  	"fmt"
     5  	"time"
     6  
     7  	argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
     8  )
     9  
    10  // Generator defines the interface implemented by all ApplicationSet generators.
    11  type Generator interface {
    12  	// GenerateParams interprets the ApplicationSet and generates all relevant parameters for the application template.
    13  	// The expected / desired list of parameters is returned, it then will be render and reconciled
    14  	// against the current state of the Applications in the cluster.
    15  	GenerateParams(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) ([]map[string]interface{}, error)
    16  
    17  	// GetRequeueAfter is the generator can controller the next reconciled loop
    18  	// In case there is more then one generator the time will be the minimum of the times.
    19  	// In case NoRequeueAfter is empty, it will be ignored
    20  	GetRequeueAfter(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) time.Duration
    21  
    22  	// GetTemplate returns the inline template from the spec if there is any, or an empty object otherwise
    23  	GetTemplate(appSetGenerator *argoprojiov1alpha1.ApplicationSetGenerator) *argoprojiov1alpha1.ApplicationSetTemplate
    24  }
    25  
    26  var EmptyAppSetGeneratorError = fmt.Errorf("ApplicationSet is empty")
    27  var NoRequeueAfter time.Duration
    28  
    29  // DefaultRequeueAfterSeconds is used when GetRequeueAfter is not specified, it is the default time to wait before the next reconcile loop
    30  const (
    31  	DefaultRequeueAfterSeconds = 3 * time.Minute
    32  )