Skip to content

Commit 45f44e0

Browse files
committed
chore: set up helm debug mode according dtm debug mode
Signed-off-by: Daniel Hu <[email protected]>
1 parent 1a16d9c commit 45f44e0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/util/helm/helm.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"time"
99

1010
helmclient "github.com/mittwald/go-helm-client"
11+
"github.com/spf13/viper"
1112
"helm.sh/helm/v3/pkg/repo"
1213

1314
"github.com/devstream-io/devstream/pkg/util/log"
@@ -29,12 +30,17 @@ type Option func(*Helm)
2930

3031
// NewHelm creates a new Helm
3132
func NewHelm(param *HelmParam, option ...Option) (*Helm, error) {
33+
isDebugMode := viper.GetBool("debug")
34+
if isDebugMode {
35+
log.Info("Helm is running in debug mode.")
36+
}
37+
3238
hClient, err := helmclient.New(
3339
&helmclient.Options{
3440
Namespace: param.Chart.Namespace,
3541
RepositoryCache: repositoryCache,
3642
RepositoryConfig: repositoryConfig,
37-
Debug: true,
43+
Debug: isDebugMode,
3844
},
3945
)
4046
if err != nil {
@@ -155,7 +161,7 @@ func GetAnnotationName() string {
155161
return "meta.helm.sh/release-name"
156162
}
157163

158-
// GetAnnotationName will return label key for service created by helm
164+
// GetLabelName will return label key for service created by helm
159165
func GetLabelName() string {
160166
return "app.kubernetes.io/instance"
161167
}

0 commit comments

Comments
 (0)