Skip to content

Commit

Permalink
Merge pull request #35 from tjcrone/helm-options
Browse files Browse the repository at this point in the history
Add two additional helm options
  • Loading branch information
yuvipanda authored Dec 1, 2019
2 parents 6f684ad + 6229506 commit 9ab545f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
9 changes: 8 additions & 1 deletion hubploy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ def main():
deploy_parser.add_argument(
'--version',
)
deploy_parser.add_argument(
'--timeout'
)
deploy_parser.add_argument(
'--force',
action='store_true'
)

args = argparser.parse_args()

Expand All @@ -71,4 +78,4 @@ def main():

elif args.command == 'deploy':
auth.cluster_auth(args.deployment)
helm.deploy(args.deployment, args.chart, args.environment, args.namespace, args.set, args.version)
helm.deploy(args.deployment, args.chart, args.environment, args.namespace, args.set, args.version, args.timeout, args.force)
14 changes: 12 additions & 2 deletions hubploy/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def helm_upgrade(
chart,
config_files,
config_overrides,
version
version,
timeout,
force
):
# Clear charts and do a helm dep up before installing
# Clearing charts is important so we don't deploy charts that
Expand All @@ -51,6 +53,10 @@ def helm_upgrade(
]
if version:
cmd += ['--version', version]
if timeout:
cmd += ['--timeout', timeout]
if force:
cmd += ['--force']
cmd += itertools.chain(*[['-f', cf] for cf in config_files])
cmd += itertools.chain(*[['--set', v] for v in config_overrides])
subprocess.check_call(cmd)
Expand All @@ -63,6 +69,8 @@ def deploy(
namespace=None,
helm_config_overrides=None,
version=None,
timeout=None,
force
):
"""
Deploy a JupyterHub.
Expand Down Expand Up @@ -113,5 +121,7 @@ def deploy(
chart,
helm_config_files,
helm_config_overrides,
version
version,
timeout,
force
)

0 comments on commit 9ab545f

Please sign in to comment.