diff --git a/cmd/commands/project.go b/cmd/commands/project.go index 56c77277..e6dcac8d 100644 --- a/cmd/commands/project.go +++ b/cmd/commands/project.go @@ -6,7 +6,7 @@ import ( "fmt" "io" "os" - "path/filepath" + "path" "strings" "text/tabwriter" @@ -306,7 +306,7 @@ func generateProjectManifests(o *GenerateProjectOptions) (projectYAML, appSetYAM Revision: o.Revision, Files: []argocdv1alpha1.GitFileGeneratorItem{ { - Path: filepath.Join(o.InstallationPath, store.Default.AppsDir, "**", o.Name, "config.json"), + Path: path.Join(o.InstallationPath, store.Default.AppsDir, "**", o.Name, "config.json"), }, }, RequeueAfterSeconds: &DefaultApplicationSetGeneratorInterval, @@ -318,7 +318,7 @@ func generateProjectManifests(o *GenerateProjectOptions) (projectYAML, appSetYAM Revision: o.Revision, Files: []argocdv1alpha1.GitFileGeneratorItem{ { - Path: filepath.Join(o.InstallationPath, store.Default.AppsDir, "**", o.Name, "config_dir.json"), + Path: path.Join(o.InstallationPath, store.Default.AppsDir, "**", o.Name, "config_dir.json"), }, }, RequeueAfterSeconds: &DefaultApplicationSetGeneratorInterval, diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index ebb6815f..90848650 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -6,7 +6,7 @@ import ( "fmt" "net/url" "os" - "path/filepath" + "path" "strings" "time" @@ -20,8 +20,8 @@ import ( "github.com/argoproj-labs/argocd-autopilot/pkg/store" "github.com/argoproj-labs/argocd-autopilot/pkg/util" - argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" argocdcommon "github.com/argoproj/argo-cd/v2/common" + argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" argocdsettings "github.com/argoproj/argo-cd/v2/util/settings" "github.com/ghodss/yaml" "github.com/go-git/go-billy/v5/memfs" @@ -552,7 +552,7 @@ func buildBootstrapManifests(namespace, appSpecifier string, cloneOpts *git.Clon namespace: namespace, repoURL: cloneOpts.URL(), revision: cloneOpts.Revision(), - srcPath: filepath.Join(cloneOpts.Path(), store.Default.BootsrtrapDir), + srcPath: path.Join(cloneOpts.Path(), store.Default.BootsrtrapDir), labels: bootstrapAppsLabels, }) if err != nil { @@ -564,7 +564,7 @@ func buildBootstrapManifests(namespace, appSpecifier string, cloneOpts *git.Clon namespace: namespace, repoURL: cloneOpts.URL(), revision: cloneOpts.Revision(), - srcPath: filepath.Join(cloneOpts.Path(), store.Default.ProjectsDir), + srcPath: path.Join(cloneOpts.Path(), store.Default.ProjectsDir), labels: bootstrapAppsLabels, }) if err != nil { @@ -576,7 +576,7 @@ func buildBootstrapManifests(namespace, appSpecifier string, cloneOpts *git.Clon namespace: namespace, repoURL: cloneOpts.URL(), revision: cloneOpts.Revision(), - srcPath: filepath.Join(cloneOpts.Path(), store.Default.BootsrtrapDir, store.Default.ArgoCDName), + srcPath: path.Join(cloneOpts.Path(), store.Default.BootsrtrapDir, store.Default.ArgoCDName), noFinalizer: true, labels: argocdLabels, }) @@ -595,7 +595,7 @@ func buildBootstrapManifests(namespace, appSpecifier string, cloneOpts *git.Clon destServer: "{{server}}", prune: false, preserveResourcesOnDeletion: true, - srcPath: filepath.Join(cloneOpts.Path(), store.Default.BootsrtrapDir, store.Default.ClusterResourcesDir, "{{name}}"), + srcPath: path.Join(cloneOpts.Path(), store.Default.BootsrtrapDir, store.Default.ClusterResourcesDir, "{{name}}"), generators: []argocdv1alpha1.ApplicationSetGenerator{ { Git: &argocdv1alpha1.GitGenerator{ @@ -603,12 +603,7 @@ func buildBootstrapManifests(namespace, appSpecifier string, cloneOpts *git.Clon Revision: cloneOpts.Revision(), Files: []argocdv1alpha1.GitFileGeneratorItem{ { - Path: filepath.Join( - cloneOpts.Path(), - store.Default.BootsrtrapDir, - store.Default.ClusterResourcesDir, - "*.json", - ), + Path: path.Join(cloneOpts.Path(), store.Default.BootsrtrapDir, store.Default.ClusterResourcesDir, "*.json"), }, }, RequeueAfterSeconds: &DefaultApplicationSetGeneratorInterval, @@ -735,7 +730,7 @@ func createBootstrapKustomization(namespace, appSpecifier string, cloneOpts *git k.ConfigMapGenerator = append(k.ConfigMapGenerator, kusttypes.ConfigMapArgs{ GeneratorArgs: kusttypes.GeneratorArgs{ - Name: "argocd-tls-certs-cm", + Name: "argocd-tls-certs-cm", Behavior: kusttypes.BehaviorMerge.String(), KvPairSources: kusttypes.KvPairSources{ LiteralSources: []string{ diff --git a/pkg/application/application.go b/pkg/application/application.go index 1c52de33..9208fc7d 100644 --- a/pkg/application/application.go +++ b/pkg/application/application.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "os" + "path" "path/filepath" "reflect" @@ -294,7 +295,7 @@ func newKustApp(o *CreateOptions, projectName, repoURL, targetRevision, repoRoot DestNamespace: o.DestNamespace, DestServer: o.DestServer, SrcRepoURL: repoURL, - SrcPath: filepath.Join(repoRoot, store.Default.AppsDir, o.AppName, store.Default.OverlaysDir, projectName), + SrcPath: path.Join(repoRoot, store.Default.AppsDir, o.AppName, store.Default.OverlaysDir, projectName), SrcTargetRevision: targetRevision, Labels: o.Labels, Annotations: o.Annotations,