Skip to content

Commit

Permalink
fix: set nodeVolumeDetachTimeout property for machines
Browse files Browse the repository at this point in the history
fix #259
  • Loading branch information
okozachenko1203 committed Dec 5, 2023
1 parent 883968a commit c52f3e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -730,6 +732,7 @@ def get_object(self) -> objects.ClusterClass:
"machineDeployments": [
{
"class": "default-worker",
"nodeVolumeDetachTimeout": CLUSTER_CLASS_NODE_VOLUME_DETACH_TIMEOUT,
"template": {
"bootstrap": {
"ref": {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c52f3e7

Please sign in to comment.