Skip to content

Commit

Permalink
fix(reana_dev): remove default for --kind-node-version (reanahub#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlemesh committed Jul 31, 2024
1 parent 3babe5d commit 335e4ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
3 changes: 0 additions & 3 deletions reana/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@
TIMEOUT = 900
"""Maximum timeout to wait for results when running demo analyses in CI."""

KIND_IMAGE_VERSION = "v1.30.2"
"""Kind Docker image version. Should be compatible with kubeVersion in HELM_VERSION_FILE."""

DOCKER_VERSION_FILE = "Dockerfile"
"""Docker version file."""

Expand Down
19 changes: 9 additions & 10 deletions reana/reana_dev/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
validate_mode_option,
)

from reana.config import (
KIND_IMAGE_VERSION,
)


def volume_mounts_to_list(ctx, param, value):
"""Convert tuple params to dictionary. e.g `(foo:bar)` to `{'foo': 'bar'}`.
Expand Down Expand Up @@ -76,13 +72,12 @@ def cluster_commands():
help="Disable default CNI and use e.g. Calico.",
)
@click.option(
"--kind-version",
default=KIND_IMAGE_VERSION,
help=f"Which kindest/node image version to use? [default={KIND_IMAGE_VERSION}]",
"--kind-node-version",
help=f"Which kindest/node image version to use?",
)
@cluster_commands.command(name="cluster-create")
def cluster_create(
mounts, mode, worker_nodes, disable_default_cni, kind_version
mounts, mode, worker_nodes, disable_default_cni, kind_node_version
): # noqa: D301
"""Create new REANA cluster.
Expand Down Expand Up @@ -175,9 +170,13 @@ def add_volume_mounts(node):
kind_provider = "KIND_EXPERIMENTAL_PROVIDER=podman"

# create cluster
cluster_create = "cat <<EOF | {kind_provider} kind create cluster --image kindest/node:{kind_version} --config=-\n{cluster_config}\nEOF".format(
image_flag = ''
if kind_node_version != None:
image_flag = f"--image kindest/node:{kind_node_version}"

cluster_create = "cat <<EOF | {kind_provider} kind create cluster {image_flag} --config=-\n{cluster_config}\nEOF".format(
kind_provider=kind_provider,
kind_version=kind_version,
image_flag=image_flag,
cluster_config=yaml.dump(cluster_config),
)
run_command(cluster_create, "reana")
Expand Down

0 comments on commit 335e4ab

Please sign in to comment.