Skip to content

Commit

Permalink
fix: WERF_KUBE_CONFIG and WERF_KUBECONFIG environment variables not w…
Browse files Browse the repository at this point in the history
…orking

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Feb 22, 2022
1 parent e87261b commit b0615b0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 19 deletions.
9 changes: 5 additions & 4 deletions cmd/werf/bundle/apply/apply.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions cmd/werf/common/helm.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/werf/dismiss/dismiss.go
Expand Up @@ -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"
Expand Down
9 changes: 5 additions & 4 deletions cmd/werf/helm/helm.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
})
Expand Down
9 changes: 5 additions & 4 deletions cmd/werf/helm/migrate2to3.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/werf/render/render.go
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -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=
Expand Down

0 comments on commit b0615b0

Please sign in to comment.