diff --git a/apps/helm_utils.go b/apps/helm_utils.go index b01d007..52147e4 100644 --- a/apps/helm_utils.go +++ b/apps/helm_utils.go @@ -8,7 +8,8 @@ import ( "github.com/openebs/openebs-e2e/common" "github.com/openebs/openebs-e2e/common/e2e_config" "os" - + "path/filepath" + logf "sigs.k8s.io/controller-runtime/pkg/log" ) @@ -183,6 +184,11 @@ func GetHelmValues(releaseName, namespace string, filePath string) error { if err != nil { return fmt.Errorf("failed to uninstall release %s with Helm: %v\n%s", releaseName, err, output) } + dir := filepath.Dir(filePath) + err := os.MkdirAll(dir, 0755) // Ensure intermediate directories are created + if err != nil { + return err + } // Write the output to a YAML file. if err := os.WriteFile(filePath, output, 0644); err != nil { return fmt.Errorf("failed to write output to file %s: %v", filePath, err)