Skip to content

Commit

Permalink
support alternative kubeconfig location
Browse files Browse the repository at this point in the history
  • Loading branch information
akostadinov committed Jun 27, 2018
1 parent b2cab86 commit 4ffa16b
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 59 deletions.
22 changes: 16 additions & 6 deletions src/apb/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import argparse
import pkg_resources

from kubernetes.config import kube_config

import apb.engine

SKIP_OPTIONS = ['provision', 'deprovision', 'bind', 'unbind', 'roles']
Expand Down Expand Up @@ -709,6 +711,14 @@ def main():
default=os.getcwd()
)

parser.add_argument(
'--kubeconfig',
action='store',
dest='kubeconfig',
help=u'OpenShift/Kubernetes configuration file path.',
default=kube_config.KUBE_CONFIG_DEFAULT_LOCATION
)

parser.add_argument(
'--token',
action='store',
Expand Down Expand Up @@ -737,9 +747,9 @@ def main():
print("Version: apb-%s" % version)
sys.exit(0)

try:
getattr(apb.engine,
u'cmdrun_{}'.format(args.subcommand))(**vars(args))
except Exception as e:
print("Exception occurred! %s" % e)
sys.exit(1)
#try:
getattr(apb.engine,
u'cmdrun_{}'.format(args.subcommand))(**vars(args))
#except Exception as e:
# print("Exception occurred! %s" % e)
# sys.exit(1)
Loading

0 comments on commit 4ffa16b

Please sign in to comment.