2022-02-10 11:25:03 +02:00
|
|
|
package kubernetes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"io"
|
2022-03-17 18:13:34 +02:00
|
|
|
"net/http"
|
|
|
|
"strings"
|
2022-02-10 11:25:03 +02:00
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
piperhttp "github.com/SAP/jenkins-library/pkg/http"
|
2022-02-10 11:25:03 +02:00
|
|
|
"github.com/SAP/jenkins-library/pkg/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
// HelmExecutor is used for mock
|
|
|
|
type HelmExecutor interface {
|
|
|
|
RunHelmUpgrade() error
|
|
|
|
RunHelmLint() error
|
|
|
|
RunHelmInstall() error
|
|
|
|
RunHelmUninstall() error
|
|
|
|
RunHelmTest() error
|
2022-03-17 18:13:34 +02:00
|
|
|
RunHelmPublish() error
|
2022-03-30 08:18:51 +02:00
|
|
|
RunHelmDependency() error
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// HelmExecute struct
|
|
|
|
type HelmExecute struct {
|
|
|
|
utils DeployUtils
|
|
|
|
config HelmExecuteOptions
|
|
|
|
verbose bool
|
|
|
|
stdout io.Writer
|
|
|
|
}
|
|
|
|
|
|
|
|
// HelmExecuteOptions struct holds common parameters for functions RunHelm...
|
|
|
|
type HelmExecuteOptions struct {
|
|
|
|
AdditionalParameters []string `json:"additionalParameters,omitempty"`
|
|
|
|
ChartPath string `json:"chartPath,omitempty"`
|
|
|
|
DeploymentName string `json:"deploymentName,omitempty"`
|
|
|
|
ForceUpdates bool `json:"forceUpdates,omitempty"`
|
|
|
|
HelmDeployWaitSeconds int `json:"helmDeployWaitSeconds,omitempty"`
|
|
|
|
HelmValues []string `json:"helmValues,omitempty"`
|
|
|
|
Image string `json:"image,omitempty"`
|
|
|
|
KeepFailedDeployments bool `json:"keepFailedDeployments,omitempty"`
|
|
|
|
KubeConfig string `json:"kubeConfig,omitempty"`
|
|
|
|
KubeContext string `json:"kubeContext,omitempty"`
|
|
|
|
Namespace string `json:"namespace,omitempty"`
|
|
|
|
DockerConfigJSON string `json:"dockerConfigJSON,omitempty"`
|
2022-04-14 15:43:47 +02:00
|
|
|
Version string `json:"version,omitempty"`
|
2022-02-10 11:25:03 +02:00
|
|
|
AppVersion string `json:"appVersion,omitempty"`
|
2022-05-18 08:58:01 +02:00
|
|
|
PublishVersion string `json:"publishVersion,omitempty"`
|
2022-03-30 08:18:51 +02:00
|
|
|
Dependency string `json:"dependency,omitempty" validate:"possible-values=build list update"`
|
|
|
|
PackageDependencyUpdate bool `json:"packageDependencyUpdate,omitempty"`
|
2022-02-10 11:25:03 +02:00
|
|
|
DumpLogs bool `json:"dumpLogs,omitempty"`
|
|
|
|
FilterTest string `json:"filterTest,omitempty"`
|
2022-03-17 18:13:34 +02:00
|
|
|
TargetRepositoryURL string `json:"targetRepositoryURL,omitempty"`
|
|
|
|
TargetRepositoryName string `json:"targetRepositoryName,omitempty"`
|
|
|
|
TargetRepositoryUser string `json:"targetRepositoryUser,omitempty"`
|
|
|
|
TargetRepositoryPassword string `json:"targetRepositoryPassword,omitempty"`
|
|
|
|
HelmCommand string `json:"helmCommand,omitempty"`
|
|
|
|
CustomTLSCertificateLinks []string `json:"customTlsCertificateLinks,omitempty"`
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewHelmExecutor creates HelmExecute instance
|
|
|
|
func NewHelmExecutor(config HelmExecuteOptions, utils DeployUtils, verbose bool, stdout io.Writer) HelmExecutor {
|
|
|
|
return &HelmExecute{
|
|
|
|
config: config,
|
|
|
|
utils: utils,
|
|
|
|
verbose: verbose,
|
|
|
|
stdout: stdout,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// runHelmInit is used to set up env for executing helm command
|
|
|
|
func (h *HelmExecute) runHelmInit() error {
|
|
|
|
helmLogFields := map[string]interface{}{}
|
|
|
|
helmLogFields["Chart Path"] = h.config.ChartPath
|
|
|
|
helmLogFields["Namespace"] = h.config.Namespace
|
|
|
|
helmLogFields["Deployment Name"] = h.config.DeploymentName
|
|
|
|
helmLogFields["Context"] = h.config.KubeContext
|
|
|
|
helmLogFields["Kubeconfig"] = h.config.KubeConfig
|
|
|
|
log.Entry().WithFields(helmLogFields).Debug("Calling Helm")
|
|
|
|
|
|
|
|
helmEnv := []string{fmt.Sprintf("KUBECONFIG=%v", h.config.KubeConfig)}
|
|
|
|
|
|
|
|
log.Entry().Debugf("Helm SetEnv: %v", helmEnv)
|
|
|
|
h.utils.SetEnv(helmEnv)
|
|
|
|
h.utils.Stdout(h.stdout)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
// runHelmAdd is used to add a chart repository
|
|
|
|
func (h *HelmExecute) runHelmAdd() error {
|
2022-02-10 11:25:03 +02:00
|
|
|
helmParams := []string{
|
|
|
|
"repo",
|
|
|
|
"add",
|
|
|
|
}
|
2022-03-17 18:13:34 +02:00
|
|
|
if len(h.config.TargetRepositoryName) == 0 {
|
|
|
|
return fmt.Errorf("there is no TargetRepositoryName value. 'helm repo add' command requires 2 arguments")
|
|
|
|
}
|
2022-06-29 10:03:54 +02:00
|
|
|
if len(h.config.TargetRepositoryURL) == 0 {
|
|
|
|
return fmt.Errorf("there is no TargetRepositoryURL value. 'helm repo add' command requires 2 arguments")
|
|
|
|
}
|
2022-04-26 17:50:37 +02:00
|
|
|
if len(h.config.TargetRepositoryUser) != 0 {
|
|
|
|
helmParams = append(helmParams, "--username", h.config.TargetRepositoryUser)
|
|
|
|
}
|
|
|
|
if len(h.config.TargetRepositoryPassword) != 0 {
|
|
|
|
helmParams = append(helmParams, "--password", h.config.TargetRepositoryPassword)
|
|
|
|
}
|
2022-03-17 18:13:34 +02:00
|
|
|
helmParams = append(helmParams, h.config.TargetRepositoryName)
|
|
|
|
helmParams = append(helmParams, h.config.TargetRepositoryURL)
|
2022-02-10 11:25:03 +02:00
|
|
|
if h.verbose {
|
|
|
|
helmParams = append(helmParams, "--debug")
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if err := h.runHelmCommand(helmParams); err != nil {
|
2022-02-10 11:25:03 +02:00
|
|
|
log.Entry().WithError(err).Fatal("Helm add call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RunHelmUpgrade is used to upgrade a release
|
|
|
|
func (h *HelmExecute) RunHelmUpgrade() error {
|
|
|
|
err := h.runHelmInit()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams := []string{
|
|
|
|
"upgrade",
|
|
|
|
h.config.DeploymentName,
|
2022-06-29 10:03:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if len(h.config.ChartPath) == 0 {
|
|
|
|
if err := h.runHelmAdd(); err != nil {
|
|
|
|
return fmt.Errorf("failed to add a chart repository: %v", err)
|
|
|
|
}
|
|
|
|
helmParams = append(helmParams, h.config.TargetRepositoryName)
|
|
|
|
} else {
|
|
|
|
helmParams = append(helmParams, h.config.ChartPath)
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if h.verbose {
|
|
|
|
helmParams = append(helmParams, "--debug")
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, v := range h.config.HelmValues {
|
|
|
|
helmParams = append(helmParams, "--values", v)
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams = append(
|
|
|
|
helmParams,
|
|
|
|
"--install",
|
|
|
|
"--namespace", h.config.Namespace,
|
|
|
|
)
|
|
|
|
|
|
|
|
if h.config.ForceUpdates {
|
|
|
|
helmParams = append(helmParams, "--force")
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams = append(helmParams, "--wait", "--timeout", fmt.Sprintf("%vs", h.config.HelmDeployWaitSeconds))
|
|
|
|
|
|
|
|
if !h.config.KeepFailedDeployments {
|
|
|
|
helmParams = append(helmParams, "--atomic")
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(h.config.AdditionalParameters) > 0 {
|
|
|
|
helmParams = append(helmParams, h.config.AdditionalParameters...)
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if err := h.runHelmCommand(helmParams); err != nil {
|
2022-02-10 11:25:03 +02:00
|
|
|
log.Entry().WithError(err).Fatal("Helm upgrade call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RunHelmLint is used to examine a chart for possible issues
|
|
|
|
func (h *HelmExecute) RunHelmLint() error {
|
|
|
|
err := h.runHelmInit()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams := []string{
|
|
|
|
"lint",
|
|
|
|
h.config.ChartPath,
|
|
|
|
}
|
|
|
|
|
2022-07-05 14:22:49 +02:00
|
|
|
for _, v := range h.config.HelmValues {
|
|
|
|
helmParams = append(helmParams, "--values", v)
|
|
|
|
}
|
|
|
|
|
2022-02-10 11:25:03 +02:00
|
|
|
if h.verbose {
|
|
|
|
helmParams = append(helmParams, "--debug")
|
|
|
|
}
|
|
|
|
|
|
|
|
h.utils.Stdout(h.stdout)
|
|
|
|
log.Entry().Info("Calling helm lint ...")
|
|
|
|
log.Entry().Debugf("Helm parameters: %v", helmParams)
|
|
|
|
if err := h.utils.RunExecutable("helm", helmParams...); err != nil {
|
|
|
|
log.Entry().WithError(err).Fatal("Helm lint call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RunHelmInstall is used to install a chart
|
|
|
|
func (h *HelmExecute) RunHelmInstall() error {
|
|
|
|
if err := h.runHelmInit(); err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams := []string{
|
|
|
|
"install",
|
|
|
|
h.config.DeploymentName,
|
2022-06-29 10:03:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if len(h.config.ChartPath) == 0 {
|
|
|
|
if err := h.runHelmAdd(); err != nil {
|
|
|
|
return fmt.Errorf("failed to add a chart repository: %v", err)
|
|
|
|
}
|
|
|
|
helmParams = append(helmParams, h.config.TargetRepositoryName)
|
|
|
|
} else {
|
|
|
|
helmParams = append(helmParams, h.config.ChartPath)
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
helmParams = append(helmParams, "--namespace", h.config.Namespace)
|
|
|
|
helmParams = append(helmParams, "--create-namespace")
|
|
|
|
if !h.config.KeepFailedDeployments {
|
|
|
|
helmParams = append(helmParams, "--atomic")
|
|
|
|
}
|
|
|
|
helmParams = append(helmParams, "--wait", "--timeout", fmt.Sprintf("%vs", h.config.HelmDeployWaitSeconds))
|
|
|
|
for _, v := range h.config.HelmValues {
|
|
|
|
helmParams = append(helmParams, "--values", v)
|
|
|
|
}
|
|
|
|
if len(h.config.AdditionalParameters) > 0 {
|
|
|
|
helmParams = append(helmParams, h.config.AdditionalParameters...)
|
|
|
|
}
|
|
|
|
if h.verbose {
|
|
|
|
helmParams = append(helmParams, "--debug")
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if h.verbose {
|
|
|
|
helmParamsDryRun := helmParams
|
|
|
|
helmParamsDryRun = append(helmParamsDryRun, "--dry-run")
|
|
|
|
if err := h.runHelmCommand(helmParamsDryRun); err != nil {
|
|
|
|
log.Entry().WithError(err).Error("Helm install --dry-run call failed")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := h.runHelmCommand(helmParams); err != nil {
|
2022-02-10 11:25:03 +02:00
|
|
|
log.Entry().WithError(err).Fatal("Helm install call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RunHelmUninstall is used to uninstall a chart
|
|
|
|
func (h *HelmExecute) RunHelmUninstall() error {
|
|
|
|
err := h.runHelmInit()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams := []string{
|
|
|
|
"uninstall",
|
|
|
|
h.config.DeploymentName,
|
|
|
|
}
|
|
|
|
if len(h.config.Namespace) <= 0 {
|
|
|
|
return fmt.Errorf("namespace has not been set, please configure namespace parameter")
|
|
|
|
}
|
|
|
|
helmParams = append(helmParams, "--namespace", h.config.Namespace)
|
|
|
|
if h.config.HelmDeployWaitSeconds > 0 {
|
|
|
|
helmParams = append(helmParams, "--wait", "--timeout", fmt.Sprintf("%vs", h.config.HelmDeployWaitSeconds))
|
|
|
|
}
|
|
|
|
if h.verbose {
|
|
|
|
helmParams = append(helmParams, "--debug")
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if h.verbose {
|
|
|
|
helmParamsDryRun := helmParams
|
|
|
|
helmParamsDryRun = append(helmParamsDryRun, "--dry-run")
|
|
|
|
if err := h.runHelmCommand(helmParamsDryRun); err != nil {
|
|
|
|
log.Entry().WithError(err).Error("Helm uninstall --dry-run call failed")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := h.runHelmCommand(helmParams); err != nil {
|
2022-02-10 11:25:03 +02:00
|
|
|
log.Entry().WithError(err).Fatal("Helm uninstall call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RunHelmPackage is used to package a chart directory into a chart archive
|
2022-03-30 08:18:51 +02:00
|
|
|
func (h *HelmExecute) runHelmPackage() error {
|
2022-04-14 15:43:47 +02:00
|
|
|
if len(h.config.ChartPath) == 0 {
|
|
|
|
return fmt.Errorf("there is no ChartPath value. The chartPath value is mandatory")
|
|
|
|
}
|
|
|
|
|
2022-02-10 11:25:03 +02:00
|
|
|
err := h.runHelmInit()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams := []string{
|
|
|
|
"package",
|
|
|
|
h.config.ChartPath,
|
|
|
|
}
|
2022-04-14 15:43:47 +02:00
|
|
|
if len(h.config.Version) > 0 {
|
|
|
|
helmParams = append(helmParams, "--version", h.config.Version)
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
2022-03-30 08:18:51 +02:00
|
|
|
if h.config.PackageDependencyUpdate {
|
2022-02-10 11:25:03 +02:00
|
|
|
helmParams = append(helmParams, "--dependency-update")
|
|
|
|
}
|
|
|
|
if len(h.config.AppVersion) > 0 {
|
|
|
|
helmParams = append(helmParams, "--app-version", h.config.AppVersion)
|
|
|
|
}
|
|
|
|
if h.verbose {
|
|
|
|
helmParams = append(helmParams, "--debug")
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if err := h.runHelmCommand(helmParams); err != nil {
|
2022-02-10 11:25:03 +02:00
|
|
|
log.Entry().WithError(err).Fatal("Helm package call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RunHelmTest is used to run tests for a release
|
|
|
|
func (h *HelmExecute) RunHelmTest() error {
|
|
|
|
err := h.runHelmInit()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams := []string{
|
|
|
|
"test",
|
|
|
|
h.config.ChartPath,
|
|
|
|
}
|
|
|
|
if len(h.config.FilterTest) > 0 {
|
|
|
|
helmParams = append(helmParams, "--filter", h.config.FilterTest)
|
|
|
|
}
|
|
|
|
if h.config.DumpLogs {
|
|
|
|
helmParams = append(helmParams, "--logs")
|
|
|
|
}
|
|
|
|
if h.verbose {
|
|
|
|
helmParams = append(helmParams, "--debug")
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if err := h.runHelmCommand(helmParams); err != nil {
|
2022-02-10 11:25:03 +02:00
|
|
|
log.Entry().WithError(err).Fatal("Helm test call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-03-30 08:18:51 +02:00
|
|
|
// RunHelmDependency is used to manage a chart's dependencies
|
|
|
|
func (h *HelmExecute) RunHelmDependency() error {
|
|
|
|
if len(h.config.Dependency) == 0 {
|
|
|
|
return fmt.Errorf("there is no dependency value. Possible values are build, list, update")
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams := []string{
|
|
|
|
"dependency",
|
|
|
|
}
|
|
|
|
|
|
|
|
helmParams = append(helmParams, h.config.Dependency)
|
|
|
|
|
|
|
|
helmParams = append(helmParams, h.config.ChartPath)
|
|
|
|
|
|
|
|
if len(h.config.AdditionalParameters) > 0 {
|
|
|
|
helmParams = append(helmParams, h.config.AdditionalParameters...)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := h.runHelmCommand(helmParams); err != nil {
|
|
|
|
log.Entry().WithError(err).Fatal("Helm dependency call failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
//RunHelmPublish is used to upload a chart to a registry
|
|
|
|
func (h *HelmExecute) RunHelmPublish() error {
|
|
|
|
err := h.runHelmInit()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
2022-03-30 08:18:51 +02:00
|
|
|
err = h.runHelmPackage()
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to execute deployments: %v", err)
|
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if len(h.config.TargetRepositoryURL) == 0 {
|
|
|
|
return fmt.Errorf("there's no target repository for helm chart publishing configured")
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
repoClientOptions := piperhttp.ClientOptions{
|
|
|
|
Username: h.config.TargetRepositoryUser,
|
|
|
|
Password: h.config.TargetRepositoryPassword,
|
|
|
|
TrustedCerts: h.config.CustomTLSCertificateLinks,
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
h.utils.SetOptions(repoClientOptions)
|
|
|
|
|
2022-05-18 08:58:01 +02:00
|
|
|
binary := fmt.Sprintf("%v", h.config.DeploymentName+"-"+h.config.PublishVersion+".tgz")
|
2022-03-17 18:13:34 +02:00
|
|
|
|
|
|
|
targetPath := fmt.Sprintf("%v/%s", h.config.DeploymentName, binary)
|
|
|
|
|
|
|
|
separator := "/"
|
|
|
|
|
|
|
|
if strings.HasSuffix(h.config.TargetRepositoryURL, "/") {
|
|
|
|
separator = ""
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
targetURL := fmt.Sprintf("%s%s%s", h.config.TargetRepositoryURL, separator, targetPath)
|
2022-02-10 11:25:03 +02:00
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
log.Entry().Infof("publishing artifact: %s", targetURL)
|
|
|
|
|
|
|
|
response, err := h.utils.UploadRequest(http.MethodPut, targetURL, binary, "", nil, nil, "binary")
|
2022-02-10 11:25:03 +02:00
|
|
|
if err != nil {
|
2022-03-17 18:13:34 +02:00
|
|
|
return fmt.Errorf("couldn't upload artifact: %w", err)
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
if !(response.StatusCode == 200 || response.StatusCode == 201) {
|
|
|
|
return fmt.Errorf("couldn't upload artifact, received status code %d", response.StatusCode)
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
2022-03-17 18:13:34 +02:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *HelmExecute) runHelmCommand(helmParams []string) error {
|
2022-02-10 11:25:03 +02:00
|
|
|
|
|
|
|
h.utils.Stdout(h.stdout)
|
2022-03-17 18:13:34 +02:00
|
|
|
log.Entry().Infof("Calling helm %v ...", h.config.HelmCommand)
|
2022-02-10 11:25:03 +02:00
|
|
|
log.Entry().Debugf("Helm parameters: %v", helmParams)
|
|
|
|
if err := h.utils.RunExecutable("helm", helmParams...); err != nil {
|
2022-03-17 18:13:34 +02:00
|
|
|
log.Entry().WithError(err).Fatalf("Helm %v call failed", h.config.HelmCommand)
|
|
|
|
return err
|
2022-02-10 11:25:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|