mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-04-28 11:55:51 +00:00
✨ Add KUBESHARK_HELM_CHART_PATH
environment variable to set a local path for the Helm chart
This commit is contained in:
parent
4fb179f623
commit
4c2884c40f
@ -2,11 +2,14 @@ package helm
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/kubeshark/kubeshark/config"
|
||||
"github.com/kubeshark/kubeshark/misc"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
"helm.sh/helm/v3/pkg/action"
|
||||
@ -64,6 +67,8 @@ func (h *Helm) Install() (rel *release.Release, err error) {
|
||||
client.Namespace = h.releaseNamespace
|
||||
client.ReleaseName = h.releaseName
|
||||
|
||||
chartPath := os.Getenv(fmt.Sprintf("%s_HELM_CHART_PATH", strings.ToUpper(misc.Program)))
|
||||
if chartPath == "" {
|
||||
var chartURL string
|
||||
chartURL, err = repo.FindChartInRepoURL(h.repo, h.releaseName, "", "", "", "", getter.All(&cli.EnvSettings{}))
|
||||
if err != nil {
|
||||
@ -126,8 +131,10 @@ func (h *Helm) Install() (rel *release.Release, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
chartPath = m.ChartPath
|
||||
}
|
||||
var chart *chart.Chart
|
||||
chart, err = loader.Load(m.ChartPath)
|
||||
chart, err = loader.Load(chartPath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func CheckNewerVersion() {
|
||||
if os.Getenv("KUBESHARK_DISABLE_VERSION_CHECK") != "" {
|
||||
if os.Getenv(fmt.Sprintf("%s_DISABLE_VERSION_CHECK", strings.ToUpper(misc.Program))) != "" {
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user