Added greater granularity for boolean environment variables (#511)

* Added greater granularity for boolean environment variables

* Improved solution as reviewed
This commit is contained in:
Alessandro Detta
2024-02-22 11:35:53 +01:00
committed by GitHub
parent 3d7f907a33
commit b5bed10571
7 changed files with 73 additions and 11 deletions

View File

@@ -3,7 +3,6 @@ package objects
import (
"context"
"encoding/json"
"os"
"strings"
"sync"
"time"
@@ -11,6 +10,7 @@ import (
"io"
"github.com/joomcode/errorx"
"github.com/komodorio/helm-dashboard/pkg/dashboard/utils"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"helm.sh/helm/v3/pkg/action"
@@ -193,7 +193,7 @@ func (d *DataLayer) nsForCtx(ctx string) string {
}
func (d *DataLayer) PeriodicTasks(ctx context.Context) {
if os.Getenv("HD_NO_AUTOUPDATE") == "" {
if !utils.EnvAsBool("HD_NO_AUTOUPDATE", false) {
// auto-update repos
go d.loopUpdateRepos(ctx, 10*time.Minute) // TODO: parameterize interval?
}