Skip to content
Permalink
Browse files
fix: WERF_KUBE_CONFIG and WERF_KUBECONFIG environment variables not w…
…orking

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Feb 22, 2022
1 parent e87261b commit b0615b0ab583a9788d39c786a31cc251336fe945
Showing with 25 additions and 19 deletions.
  1. +5 −4 cmd/werf/bundle/apply/apply.go
  2. +5 −4 cmd/werf/common/helm.go
  3. +1 −1 cmd/werf/dismiss/dismiss.go
  4. +5 −4 cmd/werf/helm/helm.go
  5. +5 −4 cmd/werf/helm/migrate2to3.go
  6. +1 −1 cmd/werf/render/render.go
  7. +1 −1 go.mod
  8. +2 −0 go.sum
@@ -8,7 +8,7 @@ import (

uuid "github.com/satori/go.uuid"
"github.com/spf13/cobra"
"helm.sh/helm/v3/cmd/helm"
helm_v3 "helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart/loader"
"helm.sh/helm/v3/pkg/cli/values"
@@ -150,9 +150,10 @@ func runApply() error {
StatusProgressPeriod: time.Duration(*commonCmdData.StatusProgressPeriodSeconds) * time.Second,
HooksStatusProgressPeriod: time.Duration(*commonCmdData.HooksStatusProgressPeriodSeconds) * time.Second,
KubeConfigOptions: kube.KubeConfigOptions{
Context: *commonCmdData.KubeContext,
ConfigPath: *commonCmdData.KubeConfig,
ConfigDataBase64: *commonCmdData.KubeConfigBase64,
Context: *commonCmdData.KubeContext,
ConfigPath: *commonCmdData.KubeConfig,
ConfigDataBase64: *commonCmdData.KubeConfigBase64,
ConfigPathMergeList: *commonCmdData.KubeConfigPathMergeList,
},
ReleasesHistoryMax: *commonCmdData.ReleasesHistoryMax,
}); err != nil {
@@ -4,7 +4,7 @@ import (
"context"
"time"

"helm.sh/helm/v3/cmd/helm"
helm_v3 "helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/pkg/action"

"github.com/werf/kubedog/pkg/kube"
@@ -40,9 +40,10 @@ func NewActionConfig(ctx context.Context, kubeInitializer helm.KubeInitializer,
StatusProgressPeriod: time.Duration(*commonCmdData.StatusProgressPeriodSeconds) * time.Second,
HooksStatusProgressPeriod: time.Duration(*commonCmdData.HooksStatusProgressPeriodSeconds) * time.Second,
KubeConfigOptions: kube.KubeConfigOptions{
Context: *commonCmdData.KubeContext,
ConfigPath: *commonCmdData.KubeConfig,
ConfigDataBase64: *commonCmdData.KubeConfigBase64,
Context: *commonCmdData.KubeContext,
ConfigPath: *commonCmdData.KubeConfig,
ConfigDataBase64: *commonCmdData.KubeConfigBase64,
ConfigPathMergeList: *commonCmdData.KubeConfigPathMergeList,
},
ReleasesHistoryMax: *commonCmdData.ReleasesHistoryMax,
}); err != nil {
@@ -6,7 +6,7 @@ import (
"time"

"github.com/spf13/cobra"
"helm.sh/helm/v3/cmd/helm"
helm_v3 "helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/pkg/action"

"github.com/werf/kubedog/pkg/kube"
@@ -7,7 +7,7 @@ import (
"time"

"github.com/spf13/cobra"
"helm.sh/helm/v3/cmd/helm"
helm_v3 "helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chart/loader"
@@ -148,9 +148,10 @@ func NewCmd() *cobra.Command {
StatusProgressPeriod: time.Duration(*_commonCmdData.StatusProgressPeriodSeconds) * time.Second,
HooksStatusProgressPeriod: time.Duration(*_commonCmdData.HooksStatusProgressPeriodSeconds) * time.Second,
KubeConfigOptions: kube.KubeConfigOptions{
Context: *_commonCmdData.KubeContext,
ConfigPath: *_commonCmdData.KubeConfig,
ConfigDataBase64: *_commonCmdData.KubeConfigBase64,
Context: *_commonCmdData.KubeContext,
ConfigPath: *_commonCmdData.KubeConfig,
ConfigPathMergeList: *_commonCmdData.KubeConfigPathMergeList,
ConfigDataBase64: *_commonCmdData.KubeConfigBase64,
},
ReleasesHistoryMax: *_commonCmdData.ReleasesHistoryMax,
})
@@ -6,7 +6,7 @@ import (
"os"

"github.com/spf13/cobra"
"helm.sh/helm/v3/cmd/helm"
helm_v3 "helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/pkg/action"

"github.com/werf/kubedog/pkg/kube"
@@ -125,9 +125,10 @@ func runMigrate2To3(ctx context.Context) error {
}

kubeConfigOptions := kube.KubeConfigOptions{
Context: *migrate2To3CommonCmdData.KubeContext,
ConfigPath: *migrate2To3CommonCmdData.KubeConfig,
ConfigDataBase64: *migrate2To3CommonCmdData.KubeConfigBase64,
Context: *migrate2To3CommonCmdData.KubeContext,
ConfigPath: *migrate2To3CommonCmdData.KubeConfig,
ConfigDataBase64: *migrate2To3CommonCmdData.KubeConfigBase64,
ConfigPathMergeList: *migrate2To3CommonCmdData.KubeConfigPathMergeList,
}

helmRegistryClientHandler, err := common.NewHelmRegistryClientHandle(ctx, &migrate2To3CommonCmdData)
@@ -8,7 +8,7 @@ import (
"path/filepath"

"github.com/spf13/cobra"
"helm.sh/helm/v3/cmd/helm"
helm_v3 "helm.sh/helm/v3/cmd/helm"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chart/loader"
2 go.mod
@@ -72,7 +72,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/theupdateframework/notary v0.6.1 // indirect
github.com/tonistiigi/go-rosetta v0.0.0-20200727161949-f79598599c5d // indirect
github.com/werf/kubedog v0.6.3-0.20211020172441-2ae4bcd3d36f
github.com/werf/kubedog v0.6.4-0.20220222141823-4ca722ade0ef
github.com/werf/lockgate v0.0.0-20200729113342-ec2c142f71ea
github.com/werf/logboek v0.5.4
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
2 go.sum
@@ -1991,6 +1991,8 @@ github.com/werf/helm/v3 v3.0.0-20211112190515-e733b755e5af h1:MakPeB2Rpww0G9wYd4
github.com/werf/helm/v3 v3.0.0-20211112190515-e733b755e5af/go.mod h1:3eOeBD3Z+O/ELiuu19zynZSN8jP1ErXLuyP21SZeMq8=
github.com/werf/kubedog v0.6.3-0.20211020172441-2ae4bcd3d36f h1:TTJxZTkHvsmDQdjjwCHuJ9an2/PshDv75VUxifexC5Y=
github.com/werf/kubedog v0.6.3-0.20211020172441-2ae4bcd3d36f/go.mod h1:QQZtZEKQf9HMKjMkbkrrwX9VDf5XKsn4TVmbWjsHn7M=
github.com/werf/kubedog v0.6.4-0.20220222141823-4ca722ade0ef h1:jidfI8MH4qRvWHlxGw06VKWiKRdBIfGFcjQ3pGwsquc=
github.com/werf/kubedog v0.6.4-0.20220222141823-4ca722ade0ef/go.mod h1:QQZtZEKQf9HMKjMkbkrrwX9VDf5XKsn4TVmbWjsHn7M=
github.com/werf/lockgate v0.0.0-20200729113342-ec2c142f71ea h1:R5tJUhL5a3YfHTrHWyuAdJW3h//fmONrpHJjjAZ79e4=
github.com/werf/lockgate v0.0.0-20200729113342-ec2c142f71ea/go.mod h1:/CeY6KDiBSCU9PUmjt7zGhqpzp8FAPg/wNVfLZHQGWI=
github.com/werf/logboek v0.5.1/go.mod h1:1RKvhO4ulmpD5sUN/9a2XsRjt+Xh8CxJjMbmya85YVA=

0 comments on commit b0615b0

Please sign in to comment.