Skip to content

Commit

Permalink
fix: better error message for invalid Helm Chart path during init
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwelke committed Apr 12, 2024
1 parent 847ada8 commit 980293d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/devspace/configure/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,18 @@ func (m *manager) AddHelmDeployment(deploymentName string) error {
localChartPathRel = localChartPath
}

stat, err := os.Stat(path.Join(localChartPathRel, "Chart.yaml"))
if err != nil || stat.IsDir() {
pathStat, err := os.Stat(localChartPath)
if err != nil {
return err
}

if !pathStat.IsDir() {
m.log.WriteString(logrus.InfoLevel, "\n")
m.log.Errorf("Local path `%s` is not a Helm chart (path is not a directory)", localChartPathRel)
continue
}

if _, err := os.Stat(path.Join(localChartPathRel, "Chart.yaml")); errors.Is(err, os.ErrNotExist) {
m.log.WriteString(logrus.InfoLevel, "\n")
m.log.Errorf("Local path `%s` is not a Helm chart (Chart.yaml missing)", localChartPathRel)
continue
Expand Down

0 comments on commit 980293d

Please sign in to comment.