Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-windows-paths #405

Merged
merged 2 commits into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will always use /

},
},
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