Add bootstrap flag for cluster creation and registration
Change-Id: I775cef617e91ef97ef4e5bc3c94f6d2f9239b4ae
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osmclient/cli_commands/cluster.py b/osmclient/cli_commands/cluster.py
index e486eee..147ce70 100755
--- a/osmclient/cli_commands/cluster.py
+++ b/osmclient/cli_commands/cluster.py
@@ -43,6 +43,12 @@
default=None,
help="resource group in VIM account where the cluster will be created",
)
+@click.option(
+ "--bootstrap/--no-bootstrap",
+ required=False,
+ default=True,
+ help="bootstrap the cluster with Flux (prepare for GitOps) (default=True)",
+)
@click.pass_context
def cluster_create(
ctx,
@@ -54,6 +60,7 @@
description,
region_name,
resource_group,
+ bootstrap,
**kwargs
):
"""creates a K8s cluster
@@ -74,6 +81,7 @@
cluster["region_name"] = region_name
if resource_group:
cluster["resource_group"] = resource_group
+ cluster["bootstrap"] = bootstrap
ctx.obj.cluster.create(name, content_dict=cluster)
@@ -200,6 +208,12 @@
"--creds", prompt=True, help="credentials file, i.e. a valid `.kube/config` file"
)
@click.option("--description", default="", help="human readable description")
+@click.option(
+ "--bootstrap/--no-bootstrap",
+ required=False,
+ default=True,
+ help="bootstrap the cluster with Flux (prepare for GitOps) (default=True)",
+)
@click.pass_context
def cluster_register(
ctx,
@@ -207,6 +221,7 @@
vim_account,
creds,
description,
+ bootstrap,
):
"""registers a K8s cluster to OSM
@@ -232,4 +247,5 @@
# cluster["namespace"] = namespace
# if cni:
# cluster["cni"] = yaml.safe_load(cni)
+ cluster["bootstrap"] = bootstrap
ctx.obj.cluster.register(name, cluster)