summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrank A. Zdarsky <fzdarsky@redhat.com>2018-03-19 19:08:16 +0100
committerFrank A. Zdarsky <fzdarsky@redhat.com>2018-03-19 19:11:14 +0100
commit9ddcc8470c7ed6a2cbddfb079b6396bb58436827 (patch)
tree5e9168dfccda4913096b5a164e5981644bdc52c1 /src
parent1b240633a23aa215872762b1ab0561c70d7f5d43 (diff)
make kube2msb use pod secretv1.1.02.0.0-ONAP2.0.0-ONAP
Issue-ID: OOM-811 Change-Id: I039b6bcc9a301751ba976b77c0f2cc3b904b8e9c Signed-off-by: Frank A. Zdarsky <fzdarsky@redhat.com>
Diffstat (limited to 'src')
-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
}