Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two additional helm options #35

Merged
merged 6 commits into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)