Skip to content

Commit

Permalink
Merge pull request #69 from puzzle/67-error-handling-for-non-existent…
Browse files Browse the repository at this point in the history
…-file-paths

Fix #67 error handling for non existent file paths
  • Loading branch information
schlapzz authored Dec 30, 2023
2 parents 22c1727 + 49d073a commit b0a09b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions argocd/appSet.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ func RenderApplicationSets(inputDir, outDir string) error {

files := make([]string, 0)
filepath.WalkDir(inputDir, func(path string, d fs.DirEntry, err error) error {

if err != nil {
return err
}

if !d.IsDir() {
files = append(files, path)
}
Expand Down
5 changes: 5 additions & 0 deletions argocd/repoClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ func renderFile(file, repoServerUrl, outputDir string, client apiclient.RepoServ
func findArgoApps(rootDir string) ([]string, error) {
var argoAppFiles []string
err := filepath.Walk(rootDir, func(path string, info fs.FileInfo, err error) error {

if err != nil {
return err
}

if strings.HasSuffix(info.Name(), ".yml") || strings.HasSuffix(info.Name(), ".yaml") {

data, err := os.ReadFile(path)
Expand Down
1 change: 1 addition & 0 deletions kustomize/kustomizationfile/kustomizationfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (k *kustomizationFileContext) GetDirectories(directoryRootPath string) ([]s

directories := make([]string, 0)
err = filepath.Walk(directoryRootPath, func(path string, info os.FileInfo, err error) error {

if err != nil {
return err
}
Expand Down

0 comments on commit b0a09b8

Please sign in to comment.