From c52f3e7d90d5a18852d1c189f6c3095395f4ac88 Mon Sep 17 00:00:00 2001 From: okozachenko1203 Date: Mon, 4 Dec 2023 20:46:59 +1100 Subject: [PATCH] fix: set nodeVolumeDetachTimeout property for machines fix https://github.com/vexxhost/magnum-cluster-api/issues/259 --- magnum_cluster_api/resources.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/magnum_cluster_api/resources.py b/magnum_cluster_api/resources.py index 23025ad6..55deb4ce 100644 --- a/magnum_cluster_api/resources.py +++ b/magnum_cluster_api/resources.py @@ -39,6 +39,7 @@ CLUSTER_CLASS_VERSION = pkg_resources.require("magnum_cluster_api")[0].version CLUSTER_CLASS_NAME = f"magnum-v{CLUSTER_CLASS_VERSION}" +CLUSTER_CLASS_NODE_VOLUME_DETACH_TIMEOUT = "300" # seconds CLUSTER_UPGRADE_LABELS = {"kube_tag"} @@ -691,6 +692,7 @@ def get_object(self) -> objects.ClusterClass: }, "spec": { "controlPlane": { + "nodeVolumeDetachTimeout": CLUSTER_CLASS_NODE_VOLUME_DETACH_TIMEOUT, "ref": { "apiVersion": objects.KubeadmControlPlaneTemplate.version, "kind": objects.KubeadmControlPlaneTemplate.kind, @@ -730,6 +732,7 @@ def get_object(self) -> objects.ClusterClass: "machineDeployments": [ { "class": "default-worker", + "nodeVolumeDetachTimeout": CLUSTER_CLASS_NODE_VOLUME_DETACH_TIMEOUT, "template": { "bootstrap": { "ref": { @@ -1671,6 +1674,7 @@ def generate_machine_deployments_for_cluster( return [ { "class": "default-worker", + "nodeVolumeDetachTimeout": CLUSTER_CLASS_NODE_VOLUME_DETACH_TIMEOUT, "name": ng.name, "replicas": utils.get_node_group_min_node_count(ng) if auto_scaling_enabled