aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/gctxt.sh
blob: 71d8c89542070cae6db3a0402b4c8bf000016607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

# Simple script to view appcontext
# with no argumnet, it will list all keys under /context/
# with 1 argument, it will show the value of the key provided
# note: assumes emoco services are running in namespace emco
if [ "$#" -ne 1 ] ; then
    kubectl -n emco exec `kubectl get pods -lapp=etcd -n emco --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'` -it -- etcdctl get /context/ --prefix=true --keys-only=true
else
if [ "$1" == "del" ] ; then
    kubectl -n emco exec `kubectl get pods -lapp=etcd -n emco --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'` -it -- etcdctl del /context/ --prefix=true
else
    kubectl -n emco exec `kubectl get pods -lapp=etcd -n emco --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'` -it -- etcdctl get $1 --prefix=true
fi
fi