Skip to content

Commit c6c9218

Browse files
author
Oleg Sucharevich
authored
Support Env vars (#11)
* update deps * support reading from environment variables to overwrite kubeconfig and cfconfigpath
1 parent 03f1959 commit c6c9218

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+14695
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "venona",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "Codefresh agent to run on Codefresh's runtime environment and execute pipeline",
55
"main": "index.js",
66
"scripts": {

venonactl/Gopkg.lock

Lines changed: 51 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

venonactl/cmd/root.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323
"path"
2424
"strings"
2525

26+
"github.com/spf13/viper"
27+
2628
"github.com/codefresh-io/venona/venonactl/internal"
2729

2830
"github.com/sirupsen/logrus"
@@ -164,11 +166,16 @@ func Execute() {
164166
}
165167

166168
func init() {
167-
rootCmd.PersistentFlags().String("cfconfig", "", "Config file (default is $HOME/.cfconfig)")
169+
viper.AutomaticEnv()
170+
viper.BindEnv("kubeconfig", "KUBECONFIG")
171+
viper.BindEnv("cfconfig", "CFCONFIG")
172+
173+
rootCmd.PersistentFlags().String("cfconfig", viper.GetString("cfconfig"), "Config file (default is $HOME/.cfconfig) [$CFCONFIG]")
168174
rootCmd.PersistentFlags().String("context", "", "Name of the context from --cfconfig (default is current-context)")
169175
rootCmd.PersistentFlags().String("kube-context-name", "", "Name of the kubernetes context (default is current-context)")
170-
rootCmd.PersistentFlags().String("kube-config-path", "", "Path to kubeconfig file (default is $HOME/.kube/config)")
176+
rootCmd.PersistentFlags().String("kube-config-path", viper.GetString("kubeconfig"), "Path to kubeconfig file (default is $HOME/.kube/config) [$KUBECONFIG]")
171177
rootCmd.PersistentFlags().String("kube-namespace", "default", "Name of the namespace on which venona should be installed")
172178
rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "Print logs")
173179
rootCmd.PersistentFlags().BoolVar(&skipVerionCheck, "skip-version-check", false, "Do not compare current Venona's version with latest")
180+
174181
}

venonactl/vendor/github.com/fsnotify/fsnotify/.editorconfig

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

venonactl/vendor/github.com/fsnotify/fsnotify/.gitignore

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

venonactl/vendor/github.com/fsnotify/fsnotify/.travis.yml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

venonactl/vendor/github.com/fsnotify/fsnotify/AUTHORS

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)