Skip to content

Commit

Permalink
Fix-windows-paths (#405)
Browse files Browse the repository at this point in the history
* replaced Join with JoinPath

Signed-off-by: Noam Gal <[email protected]>
  • Loading branch information
ATGardner authored Jan 29, 2023
1 parent 82cb380 commit f154fca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
6 changes: 3 additions & 3 deletions cmd/commands/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"path"
"strings"
"text/tabwriter"

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
21 changes: 8 additions & 13 deletions cmd/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"net/url"
"os"
"path/filepath"
"path"
"strings"
"time"

Expand All @@ -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"
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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,
})
Expand All @@ -595,20 +595,15 @@ 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{
RepoURL: cloneOpts.URL(),
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,
Expand Down Expand Up @@ -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{
Expand Down
3 changes: 2 additions & 1 deletion pkg/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"os"
"path"
"path/filepath"
"reflect"

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f154fca

Please sign in to comment.