From 84cbb8bd91730bd377559101d7c57b57134170fc Mon Sep 17 00:00:00 2001 From: Matt Welke Date: Thu, 9 May 2024 18:59:28 -0400 Subject: [PATCH] Made changes for path and error handling from PR review. Signed-off-by: Matt Welke --- pkg/devspace/configure/deployment.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/devspace/configure/deployment.go b/pkg/devspace/configure/deployment.go index d6b620f76..440ddb6ed 100644 --- a/pkg/devspace/configure/deployment.go +++ b/pkg/devspace/configure/deployment.go @@ -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 } @@ -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