This commit is contained in:
admju
2024-09-09 14:17:02 +00:00
parent 550675a4aa
commit 13025746e6
32 changed files with 1597 additions and 664 deletions

View File

@@ -3,22 +3,25 @@ package helm
import (
"fmt"
"strings"
"errors"
"os/exec"
"errors"
log "oc-deploy/log_wrapper"
)
func (this RealHelmCommand) Status(name string) (string, error) {
// type HelmData struct {
// Name string
// }
func (this HelmCommand) Status(data HelmChart) (string, error) {
helm_bin := this.Bin
msg := fmt.Sprintf("%s status %s --show-resources -o json", helm_bin, name)
msg := fmt.Sprintf("%s status %s --show-resources -o json", helm_bin, data.Name)
log.Log().Debug().Msg(msg)
cmd_args := strings.Split(msg, " ")
cmd := exec.Command(cmd_args[0], cmd_args[1:]...)
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
stdout, err := cmd.CombinedOutput()
if err != nil {
log.Log().Debug().Msg(string(stdout))
@@ -27,4 +30,3 @@ func (this RealHelmCommand) Status(name string) (string, error) {
return string(stdout), nil
}