From 1cbae8d9f36caa8bd6bdd7f9a9702fde45a354ec Mon Sep 17 00:00:00 2001 From: Oren Gurfinkel Date: Tue, 5 Oct 2021 18:11:57 +0300 Subject: [PATCH] support dir apps with recurse --- cmd/commands/project.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cmd/commands/project.go b/cmd/commands/project.go index d57358e1..28a85e36 100644 --- a/cmd/commands/project.go +++ b/cmd/commands/project.go @@ -20,6 +20,7 @@ import ( "github.com/argoproj-labs/argocd-autopilot/pkg/util" appset "github.com/argoproj-labs/applicationset/api/v1alpha1" + "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/ghodss/yaml" "github.com/go-git/go-billy/v5/memfs" @@ -297,6 +298,27 @@ func generateProjectManifests(o *GenerateProjectOptions) (projectYAML, appSetYAM RequeueAfterSeconds: &DefaultApplicationSetGeneratorInterval, }, }, + { + Git: &appset.GitGenerator{ + RepoURL: o.RepoURL, + Revision: o.Revision, + Files: []appset.GitFileGeneratorItem{ + { + Path: filepath.Join(o.InstallationPath, store.Default.AppsDir, "**", o.Name, "config_dir.json"), + }, + }, + RequeueAfterSeconds: &DefaultApplicationSetGeneratorInterval, + Template: appset.ApplicationSetTemplate{ + Spec: v1alpha1.ApplicationSpec{ + Source: v1alpha1.ApplicationSource{ + Directory: &v1alpha1.ApplicationSourceDirectory{ + Recurse: true, + }, + }, + } , + }, + }, + }, }, }) if err != nil {