Skip to content

Commit

Permalink
Error is logged now instead of returned
Browse files Browse the repository at this point in the history
Signed-off-by: Ashin Sabu <[email protected]>
  • Loading branch information
ashinsabu3 committed Sep 4, 2023
1 parent 8b976b0 commit 722fc96
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions util/app/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ func Discover(ctx context.Context, appPath, repoPath string, enableGenerateManif
if (strings.HasSuffix(base, ".yaml") || strings.HasSuffix(base, ".yml")) && IsManifestGenerationEnabled(v1alpha1.ApplicationSourceTypeDirectory, enableGenerateManifests) {
f, err := os.Open(path)
if err != nil {
return err
log.Errorf("failed to open %s: %v", path, err)
}
defer f.Close()

decoder := yaml.NewDecoder(f)
obj := make(map[string]interface{})
if err := decoder.Decode(&obj); err == nil {
err = decoder.Decode(&obj)
if err != nil {
log.Errorf("failed to decode %s: %v", path, err)
} else {
if obj["kind"] == "Service" || obj["kind"] == "Deployment" {
apps[dir] = string(v1alpha1.ApplicationSourceTypeDirectory)
}
Expand Down

0 comments on commit 722fc96

Please sign in to comment.