Skip to content

Commit

Permalink
Made changes for path and error handling from PR review.
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Welke <[email protected]>
  • Loading branch information
mattwelke committed May 14, 2024
1 parent b91c7b9 commit 84cbb8b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/devspace/configure/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (m *manager) AddHelmDeployment(deploymentName string) error {
localChartPathRel = localChartPath
}

pathStat, err := os.Stat(localChartPath)
pathStat, err := os.Stat(localChartPathRel)
if err != nil {
return err
}
Expand All @@ -156,10 +156,15 @@ func (m *manager) AddHelmDeployment(deploymentName string) error {
continue
}

if _, err := os.Stat(path.Join(localChartPathRel, "Chart.yaml")); errors.Is(err, os.ErrNotExist) {
if _, err := os.Stat(path.Join(localChartPathRel, "Chart.yaml")); err != nil {
m.log.WriteString(logrus.InfoLevel, "\n")
m.log.Errorf("Local path `%s` is not a Helm chart (Chart.yaml missing)", localChartPathRel)
continue
if errors.Is(err, os.ErrNotExist) {
m.log.Errorf("Local path `%s` is not a Helm chart (Chart.yaml missing)", localChartPathRel)
continue
} else {
m.log.Errorf("Encountered unexpected error checking local path `%s`: %s", localChartPathRel, err.Error())
continue
}
}

helmConfig.Chart.Name = localChartPathRel
Expand Down

0 comments on commit 84cbb8b

Please sign in to comment.