Skip to content

Commit

Permalink
remove helm template
Browse files Browse the repository at this point in the history
  • Loading branch information
nvanthao committed Jul 4, 2024
1 parent a1180bf commit ac65854
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions cmd/kots/cli/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strings"

Expand Down Expand Up @@ -313,47 +312,5 @@ func pullAndRender(appSlug string, licensePath string, configPath string, localP
fmt.Println(m)
}

// also render helm charts with helm template if any
helmChartsDir := filepath.Join(tempDir, "helm")
if _, err := os.Stat(helmChartsDir); err == nil {
logger.Info("Rendering Helm charts with helm template...")
var chartPath string
var valuesPath string

err := filepath.Walk(helmChartsDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}

if info.IsDir() {
return nil
}

if filepath.Ext(path) == ".tgz" {
chartPath = path
}

if info.Name() == "values.yaml" {
valuesPath = path
}

return nil
})

if err != nil {
return errors.Wrap(err, "failed to walk helm charts directory")
}

if chartPath != "" && valuesPath != "" {
args := []string{"template", "tmp-release", chartPath, "--values", valuesPath}
cmd := exec.Command("helm", args...)
output, err := cmd.CombinedOutput()
if err != nil {
return errors.Wrap(err, "failed to run helm template")
}
fmt.Println(string(output))
}
}

return nil
}

0 comments on commit ac65854

Please sign in to comment.