Documentation ¶
Index ¶
- Constants
- Variables
- func CheckInvalidGenerators(applicationSetInfo *argoappsv1.ApplicationSet) error
- func CombineStringMaps(aSI map[string]interface{}, bSI map[string]interface{}) (map[string]string, error)
- func CombineStringMapsAllowDuplicates(aSI map[string]interface{}, bSI map[string]interface{}) (map[string]string, error)
- func ConvertToMapStringInterface(mapStringString map[string]string) map[string]interface{}
- func ConvertToMapStringString(mapStringInterface map[string]interface{}) map[string]string
- func ConvertYAMLToJSON(str string) (string, error)
- func CreateOrUpdate(ctx context.Context, logCtx *log.Entry, c client.Client, ...) (controllerutil.OperationResult, error)
- func DefaultPolicy(appSetSyncPolicy *argov1alpha1.ApplicationSetSyncPolicy, ...) argov1alpha1.ApplicationsSyncPolicy
- func GetTlsConfig(scmRootCAPath string, insecure bool) *tls.Config
- func IsJSONStr(str string) bool
- func ListClusters(ctx context.Context, clientset kubernetes.Interface, namespace string) (*appv1.ClusterList, error)
- func LogPatch(logCtx *log.Entry, patch client.Patch, obj *argov1alpha1.Application)
- func NormalizeBitbucketBasePath(basePath string) string
- func SanitizeName(name string) string
- func SlugifyName(args ...interface{}) string
- func ValidateDestination(ctx context.Context, dest *appv1.ApplicationDestination, ...) error
- type ByKey
- type Render
- func (r *Render) RenderGeneratorParams(gen *argoappsv1.ApplicationSetGenerator, params map[string]interface{}, ...) (*argoappsv1.ApplicationSetGenerator, error)
- func (r *Render) RenderTemplateParams(tmpl *argoappsv1.Application, syncPolicy *argoappsv1.ApplicationSetSyncPolicy, ...) (*argoappsv1.Application, error)
- func (r *Render) Replace(tmpl string, replaceMap map[string]interface{}, useGoTemplate bool, ...) (string, error)
- type Renderer
- type Requirement
- type Selector
Constants ¶
const ( ArgoCDSecretTypeLabel = "argocd.argoproj.io/secret-type" ArgoCDSecretTypeCluster = "cluster" )
Variables ¶
var Policies = map[string]argov1alpha1.ApplicationsSyncPolicy{ "create-only": argov1alpha1.ApplicationsSyncPolicyCreateOnly, "create-update": argov1alpha1.ApplicationsSyncPolicyCreateUpdate, "create-delete": argov1alpha1.ApplicationsSyncPolicyCreateDelete, "sync": argov1alpha1.ApplicationsSyncPolicySync, "": argov1alpha1.ApplicationsSyncPolicySync, }
Policies is a registry of available policies.
Functions ¶
func CheckInvalidGenerators ¶
func CheckInvalidGenerators(applicationSetInfo *argoappsv1.ApplicationSet) error
Log a warning if there are unrecognized generators
func CombineStringMaps ¶
func CombineStringMapsAllowDuplicates ¶
func CombineStringMapsAllowDuplicates(aSI map[string]interface{}, bSI map[string]interface{}) (map[string]string, error)
CombineStringMapsAllowDuplicates merges two maps. Where there are duplicates, take the latter map's value.
func ConvertToMapStringInterface ¶ added in v2.5.0
func ConvertToMapStringString ¶ added in v2.5.0
func ConvertYAMLToJSON ¶ added in v2.8.2
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, logCtx *log.Entry, c client.Client, ignoreAppDifferences argov1alpha1.ApplicationSetIgnoreDifferences, obj *argov1alpha1.Application, f controllerutil.MutateFn) (controllerutil.OperationResult, error)
CreateOrUpdate overrides "sigs.k8s.io/controller-runtime" function in sigs.k8s.io/controller-runtime/pkg/controller/controllerutil/controllerutil.go to add equality for argov1alpha1.ApplicationDestination argov1alpha1.ApplicationDestination has a private variable, so the default implementation fails to compare it.
CreateOrUpdate creates or updates the given object in the Kubernetes cluster. The object's desired state must be reconciled with the existing state inside the passed in callback MutateFn.
The MutateFn is called regardless of creating or updating an object.
It returns the executed operation and an error.
func DefaultPolicy ¶ added in v2.8.0
func DefaultPolicy(appSetSyncPolicy *argov1alpha1.ApplicationSetSyncPolicy, controllerPolicy argov1alpha1.ApplicationsSyncPolicy, enablePolicyOverride bool) argov1alpha1.ApplicationsSyncPolicy
func GetTlsConfig ¶ added in v2.8.0
func ListClusters ¶
func ListClusters(ctx context.Context, clientset kubernetes.Interface, namespace string) (*appv1.ClusterList, error)
func LogPatch ¶ added in v2.9.1
func LogPatch(logCtx *log.Entry, patch client.Patch, obj *argov1alpha1.Application)
func SanitizeName ¶ added in v2.5.0
SanitizeName sanitizes the name in accordance with the below rules 1. contain no more than 253 characters 2. contain only lowercase alphanumeric characters, '-' or '.' 3. start and end with an alphanumeric character
func SlugifyName ¶ added in v2.10.0
func SlugifyName(args ...interface{}) string
SlugifyName generates a URL-friendly slug from the provided name and additional options. The slug is generated in accordance with the following rules: 1. The generated slug will be URL-safe and suitable for use in URLs. 2. The maximum length of the slug can be specified using the `maxSize` argument. 3. Smart truncation can be enabled or disabled using the `EnableSmartTruncate` argument. 4. The input name can be any string value that needs to be converted into a slug.
Args: - args: A variadic number of arguments where:
- The first argument (if provided) is an integer specifying the maximum length of the slug.
- The second argument (if provided) is a boolean indicating whether smart truncation is enabled.
- The last argument (if provided) is the input name that needs to be slugified. If no name is provided, an empty string will be used.
Returns: - string: The generated URL-friendly slug based on the input name and options.
func ValidateDestination ¶
func ValidateDestination(ctx context.Context, dest *appv1.ApplicationDestination, clientset kubernetes.Interface, argoCDNamespace string) error
ValidateDestination checks: if we used destination name we infer the server url if we used both name and server then we return an invalid spec error
Types ¶
type ByKey ¶ added in v2.5.18
type ByKey []Requirement
ByKey sorts requirements by key to obtain deterministic parser
type Render ¶
type Render struct { }
func (*Render) RenderGeneratorParams ¶ added in v2.5.14
func (r *Render) RenderGeneratorParams(gen *argoappsv1.ApplicationSetGenerator, params map[string]interface{}, useGoTemplate bool, goTemplateOptions []string) (*argoappsv1.ApplicationSetGenerator, error)
func (*Render) RenderTemplateParams ¶
func (r *Render) RenderTemplateParams(tmpl *argoappsv1.Application, syncPolicy *argoappsv1.ApplicationSetSyncPolicy, params map[string]interface{}, useGoTemplate bool, goTemplateOptions []string) (*argoappsv1.Application, error)
type Renderer ¶
type Renderer interface { RenderTemplateParams(tmpl *argoappsv1.Application, syncPolicy *argoappsv1.ApplicationSetSyncPolicy, params map[string]interface{}, useGoTemplate bool, goTemplateOptions []string) (*argoappsv1.Application, error) Replace(tmpl string, replaceMap map[string]interface{}, useGoTemplate bool, goTemplateOptions []string) (string, error) }
type Requirement ¶ added in v2.5.18
type Requirement struct {
// contains filtered or unexported fields
}
Requirement contains values, a key, and an operator that relates the key and values. The zero value of Requirement is invalid. Requirement implements both set based match and exact match Requirement should be initialized via NewRequirement constructor for creating a valid Requirement. +k8s:deepcopy-gen=true
type Selector ¶ added in v2.5.18
type Selector interface { // Matches returns true if this selector matches the given set of labels. Matches(labels.Labels) bool // Add adds requirements to the Selector Add(r ...Requirement) Selector }
Selector represents a label selector.
func LabelSelectorAsSelector ¶ added in v2.5.18
func LabelSelectorAsSelector(ps *v1.LabelSelector) (Selector, error)
LabelSelectorAsSelector converts the LabelSelector api type into a struct that implements labels.Selector Note: This function should be kept in sync with the selector methods in pkg/labels/selector.go