Skip to content

Commit

Permalink
reana-dev: fix client-setup-environemt with custom instance name/name…
Browse files Browse the repository at this point in the history
…space
  • Loading branch information
mdonadoni committed Jun 14, 2023
1 parent d6baf74 commit f2ec336
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Version 0.9.1 (UNRELEASED)
- Fixes ``ingress.enabled`` option to correctly enable or disable the creation of Ingresses.
- Adds new configuration options ``login`` and ``secrets.login`` for configuring Keycloak SSO login with third-party authentication services.
- Developers:
- Fixes ``cluster-deploy`` and ``cluster-undeploy`` commands when using custom instance name or kubernetes namespace.
- Fixes ``cluster-deploy``, ``cluster-undeploy`` and ``client-setup-environment`` commands when using custom instance name or kubernetes namespace.

Version 0.9.0 (2023-01-26)
--------------------------
Expand Down
12 changes: 9 additions & 3 deletions reana/reana_dev/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2020, 2022 CERN.
# Copyright (C) 2020, 2022, 2023 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -47,7 +47,13 @@ def client_uninstall(): # noqa: D301
@client_commands.command(name="client-setup-environment")
@click.option("--server-hostname", help="Set customized REANA Server hostname.")
@click.option("--insecure-url", is_flag=True, help="REANA Server URL with HTTP.")
def client_setup_environment(server_hostname, insecure_url): # noqa: D301
@click.option(
"--namespace", "-n", default="default", help="Kubernetes namespace [default]"
)
@click.option("--instance-name", default="reana", help="REANA instance name")
def client_setup_environment(
server_hostname, insecure_url, namespace, instance_name
): # noqa: D301
"""Display commands to set up shell environment for local cluster.
Display commands how to set up REANA_SERVER_URL and REANA_ACCESS_TOKEN
Expand All @@ -63,7 +69,7 @@ def client_setup_environment(server_hostname, insecure_url): # noqa: D301
env_var_value=server_hostname or "https://localhost:30443",
)
)
get_access_token_cmd = "kubectl get secret -o json reana-admin-access-token"
get_access_token_cmd = f"kubectl get secret -n {namespace} -o json {instance_name}-admin-access-token"
secret_json = json.loads(
subprocess.check_output(get_access_token_cmd, shell=True).decode()
)
Expand Down

0 comments on commit f2ec336

Please sign in to comment.