Skip to content

Commit 4ffa16b

Browse files
committed
support alternative kubeconfig location
1 parent b2cab86 commit 4ffa16b

File tree

2 files changed

+80
-59
lines changed

2 files changed

+80
-59
lines changed

src/apb/cli.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import argparse
55
import pkg_resources
66

7+
from kubernetes.config import kube_config
8+
79
import apb.engine
810

911
SKIP_OPTIONS = ['provision', 'deprovision', 'bind', 'unbind', 'roles']
@@ -709,6 +711,14 @@ def main():
709711
default=os.getcwd()
710712
)
711713

714+
parser.add_argument(
715+
'--kubeconfig',
716+
action='store',
717+
dest='kubeconfig',
718+
help=u'OpenShift/Kubernetes configuration file path.',
719+
default=kube_config.KUBE_CONFIG_DEFAULT_LOCATION
720+
)
721+
712722
parser.add_argument(
713723
'--token',
714724
action='store',
@@ -737,9 +747,9 @@ def main():
737747
print("Version: apb-%s" % version)
738748
sys.exit(0)
739749

740-
try:
741-
getattr(apb.engine,
742-
u'cmdrun_{}'.format(args.subcommand))(**vars(args))
743-
except Exception as e:
744-
print("Exception occurred! %s" % e)
745-
sys.exit(1)
750+
#try:
751+
getattr(apb.engine,
752+
u'cmdrun_{}'.format(args.subcommand))(**vars(args))
753+
#except Exception as e:
754+
# print("Exception occurred! %s" % e)
755+
# sys.exit(1)

0 commit comments

Comments
 (0)