Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(reana_dev): customize kind image version (#811) #811

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions reana/reana_dev/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@
is_flag=True,
help="Disable default CNI and use e.g. Calico.",
)
@click.option(
"--kind-node-version",
help="Which kindest/node image version to use?",
)
@cluster_commands.command(name="cluster-create")
def cluster_create(mounts, mode, worker_nodes, disable_default_cni): # noqa: D301
def cluster_create(
mounts, mode, worker_nodes, disable_default_cni, kind_node_version
): # noqa: D301
"""Create new REANA cluster.

\b
Expand Down Expand Up @@ -169,9 +175,14 @@
kind_provider = "KIND_EXPERIMENTAL_PROVIDER=podman"

# create cluster
cluster_create = "cat <<EOF | {kind_provider} kind create cluster --config=-\n{cluster_config}\nEOF"
cluster_create = cluster_create.format(
kind_provider=kind_provider, cluster_config=yaml.dump(cluster_config)
image_flag = ""
if kind_node_version is not None:
image_flag = f"--image kindest/node:{kind_node_version}"

Check warning on line 180 in reana/reana_dev/cluster.py

View check run for this annotation

Codecov / codecov/patch

reana/reana_dev/cluster.py#L178-L180

Added lines #L178 - L180 were not covered by tests

cluster_create = "cat <<EOF | {kind_provider} kind create cluster {image_flag} --config=-\n{cluster_config}\nEOF".format(

Check warning on line 182 in reana/reana_dev/cluster.py

View check run for this annotation

Codecov / codecov/patch

reana/reana_dev/cluster.py#L182

Added line #L182 was not covered by tests
kind_provider=kind_provider,
image_flag=image_flag,
cluster_config=yaml.dump(cluster_config),
)
run_command(cluster_create, "reana")

Expand Down
Loading