2024-09-09 14:17:02 +00:00
|
|
|
package helm
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (this HelmCommand) GetVersion() (string, error) {
|
|
|
|
|
|
|
|
|
|
cmd := this.Exec(this.Bin, "version", "--short")
|
|
|
|
|
stdout, err := cmd.CombinedOutput()
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res := string(stdout)
|
|
|
|
|
res = strings.TrimSuffix(res, "\n")
|
|
|
|
|
return res, nil
|
|
|
|
|
}
|