Feature 10904: Make all deployment methods optional for K8s cluster
Change-Id: Idb900ef102966069cf4a339e9991d397e04bed28
Signed-off-by: Gabriel Cuba <gcuba@whitestack.com>
diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py
index 3ce02df..7af3013 100755
--- a/osmclient/scripts/osm.py
+++ b/osmclient/scripts/osm.py
@@ -3878,6 +3878,24 @@
help='''list of VIM networks, in JSON inline format, where the cluster is
accessible via L3 routing, e.g. "{(k8s_net1:vim_network1) [,(k8s_net2:vim_network2) ...]}"''',
)
+@click.option(
+ "--init-helm2/--skip-helm2",
+ required=False,
+ default=True,
+ help="Initialize helm v2",
+)
+@click.option(
+ "--init-helm3/--skip-helm3",
+ required=False,
+ default=True,
+ help="Initialize helm v3",
+)
+@click.option(
+ "--init-jujubundle/--skip-jujubundle",
+ required=False,
+ default=True,
+ help="Initialize juju-bundle",
+)
@click.option("--description", default=None, help="human readable description")
@click.option(
"--namespace",
@@ -3905,7 +3923,7 @@
# help='do not return the control immediately, but keep it until the operation is completed, or timeout')
@click.pass_context
def k8scluster_add(
- ctx, name, creds, version, vim, k8s_nets, description, namespace, wait, cni
+ ctx, name, creds, version, vim, k8s_nets, init_helm2, init_helm3, init_jujubundle, description, namespace, wait, cni
):
"""adds a K8s cluster to OSM
@@ -3920,6 +3938,10 @@
cluster["k8s_version"] = version
cluster["vim_account"] = vim
cluster["nets"] = yaml.safe_load(k8s_nets)
+ if not (init_helm2 and init_jujubundle and init_helm3):
+ cluster["deployment_methods"] = {"helm-chart": init_helm2,
+ "juju-bundle": init_jujubundle,
+ "helm-chart-v3": init_helm3}
if description:
cluster["description"] = description
if namespace:
@@ -4049,6 +4071,7 @@
"Version",
"VIM",
"K8s-nets",
+ "Deployment methods",
"Operational State",
"Op. state (details)",
"Description",
@@ -4086,6 +4109,7 @@
cluster["k8s_version"],
vim_info,
json.dumps(cluster["nets"]),
+ json.dumps(cluster["deployment_methods"]),
cluster["_admin"]["operationalState"],
op_state_details,
trunc_text(cluster.get("description") or "", 40),