Skip to content

Commit

Permalink
Update helm_utils.go
Browse files Browse the repository at this point in the history
Signed-off-by: Ranjith M P <[email protected]>
  • Loading branch information
r1jt authored Oct 23, 2024
1 parent 955ea7f commit 82d8fe0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/helm_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 82d8fe0

Please sign in to comment.