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 #67 error handling for non existent file paths #69

Merged
merged 2 commits into from
Dec 30, 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
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
Loading