From: garciadeblas Date: Wed, 6 Nov 2024 09:35:20 +0000 (+0100) Subject: Add bootstrap flag for cluster creation and registration X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=bd7c1f6cf9daf3e4dc54d9a213aa1d95d8e592b5;p=osm%2Fosmclient.git Add bootstrap flag for cluster creation and registration Change-Id: I775cef617e91ef97ef4e5bc3c94f6d2f9239b4ae Signed-off-by: garciadeblas --- 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 @@ logger = logging.getLogger("osmclient") 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 @@ def cluster_create( description, region_name, resource_group, + bootstrap, **kwargs ): """creates a K8s cluster @@ -74,6 +81,7 @@ def cluster_create( 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 @@ def cluster_get_kubeconfig(ctx, name, **kwargs): "--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 @@ def cluster_register( vim_account, creds, description, + bootstrap, ): """registers a K8s cluster to OSM @@ -232,4 +247,5 @@ def cluster_register( # cluster["namespace"] = namespace # if cni: # cluster["cni"] = yaml.safe_load(cni) + cluster["bootstrap"] = bootstrap ctx.obj.cluster.register(name, cluster)