summaryrefslogtreecommitdiffstats
path: root/src/kube2msb/kube2msb.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/kube2msb/kube2msb.go')
-rw-r--r--src/kube2msb/kube2msb.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/kube2msb/kube2msb.go b/src/kube2msb/kube2msb.go
index 2d39b77..4dac06d 100644
--- a/src/kube2msb/kube2msb.go
+++ b/src/kube2msb/kube2msb.go
@@ -36,6 +36,7 @@ import (
var (
argMSBUrl = flag.String("msb_url", "", "URL to MSB backend")
argKubeMasterUrl = flag.String("kube_master_url", "", "Url to reach kubernetes master. Env variables in this flag will be expanded.")
+ argAuthToken = flag.String("auth_token", "", "Auth token for accessing Kube master.")
addMap = make(map[string]*kapi.Pod)
deleteMap = make(map[string]*kapi.Pod)
nodeSelector = klabels.Everything()
@@ -92,7 +93,10 @@ func newKubeClient() (*kclient.Client, error) {
overrides := &kclientcmd.ConfigOverrides{}
overrides.ClusterInfo.Server = masterUrl
- if token, present := os.LookupEnv("AUTH_TOKEN"); present {
+ if *argAuthToken != "" {
+ overrides.AuthInfo.Token = *argAuthToken
+ overrides.ClusterInfo.InsecureSkipTLSVerify = true
+ } else if token, present := os.LookupEnv("AUTH_TOKEN"); present {
overrides.AuthInfo.Token = token
overrides.ClusterInfo.InsecureSkipTLSVerify = true
}