Skip to content
Permalink
Browse files

[deploy] Reject auto replace of chart path in helm errors

  • Loading branch information
alexey-igrychev committed Sep 10, 2019
1 parent 3e37326 commit 869ed288ff965c1d0ebb269e38219c25356c6019
Showing with 6 additions and 33 deletions.
  1. +2 −11 pkg/deploy/deploy.go
  2. +2 −11 pkg/deploy/lint.go
  3. +2 −11 pkg/deploy/render.go
@@ -1,9 +1,7 @@
package deploy

import (
"errors"
"fmt"
"strings"
"time"

"github.com/ghodss/yaml"
@@ -88,7 +86,7 @@ func Deploy(projectDir string, imagesRepoManager ImagesRepoManager, release, nam
return logBlockErr
}

if err := helm.WithExtra(werfChart.ExtraAnnotations, werfChart.ExtraLabels, func() error {
return helm.WithExtra(werfChart.ExtraAnnotations, werfChart.ExtraLabels, func() error {
return werfChart.Deploy(release, namespace, helm.ChartOptions{
Timeout: opts.Timeout,
ChartValuesOptions: helm.ChartValuesOptions{
@@ -97,12 +95,5 @@ func Deploy(projectDir string, imagesRepoManager ImagesRepoManager, release, nam
Values: opts.Values,
},
})
}); err != nil {
replaceOld := fmt.Sprintf("%s/", werfChart.Name)
replaceNew := fmt.Sprintf("%s/", ".helm")
errMsg := strings.Replace(err.Error(), replaceOld, replaceNew, -1)
return errors.New(errMsg)
}

return nil
})
}
@@ -1,10 +1,8 @@
package deploy

import (
"errors"
"fmt"
"os"
"strings"

"github.com/flant/logboek"

@@ -55,20 +53,13 @@ func RunLint(projectDir string, werfConfig *config.WerfConfig, opts LintOptions)
}
defer ReleaseTmpWerfChart(werfChart.ChartDir)

if err := helm.Lint(
return helm.Lint(
os.Stdout,
werfChart.ChartDir,
namespace,
append(werfChart.Values, opts.Values...),
append(werfChart.Set, opts.Set...),
append(werfChart.SetString, opts.SetString...),
helm.LintOptions{Strict: true},
); err != nil {
replaceOld := fmt.Sprintf("%s/", werfChart.Name)
replaceNew := fmt.Sprintf("%s/", ".helm")
errMsg := strings.Replace(err.Error(), replaceOld, replaceNew, -1)
return errors.New(errMsg)
}

return nil
)
}
@@ -1,10 +1,8 @@
package deploy

import (
"errors"
"fmt"
"io"
"strings"

"github.com/flant/logboek"

@@ -59,7 +57,7 @@ func RunRender(out io.Writer, projectDir string, werfConfig *config.WerfConfig,
ShowNotes: false,
}

if err := helm.WithExtra(werfChart.ExtraAnnotations, werfChart.ExtraLabels, func() error {
return helm.WithExtra(werfChart.ExtraAnnotations, werfChart.ExtraLabels, func() error {
return helm.Render(
out,
werfChart.ChartDir,
@@ -69,12 +67,5 @@ func RunRender(out io.Writer, projectDir string, werfConfig *config.WerfConfig,
append(werfChart.Set, opts.Set...),
append(werfChart.SetString, opts.SetString...),
renderOptions)
}); err != nil {
replaceOld := fmt.Sprintf("%s/", werfChart.Name)
replaceNew := fmt.Sprintf("%s/", ".helm")
errMsg := strings.Replace(err.Error(), replaceOld, replaceNew, -1)
return errors.New(errMsg)
}

return nil
})
}

0 comments on commit 869ed28

Please sign in to comment.
You can’t perform that action at this time.