Skip to content

Commit

Permalink
fix for etcd min disk size
Browse files Browse the repository at this point in the history
  • Loading branch information
Gevorg-Khachatryaan authored and Gevorg-Khachatryaan committed Apr 13, 2023
1 parent 4249867 commit fb30a68
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/module_utils/karbon/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def validate_resources(resources, resource_type):
min_cpu = 4
min_memory = 8
min_disk_size = 120
min_etcd_disk_size = 40
err = "{0} cannot be less then {1}"
if (
resource_type == "master"
Expand All @@ -176,6 +177,10 @@ def validate_resources(resources, resource_type):
return None, err.format("cpu", min_cpu)
if resources["memory_gb"] < min_memory:
return None, err.format("memory_gb", min_memory)
if resources["disk_gb"] < min_disk_size:
return None, err.format("disk_gb", min_disk_size)
if resource_type == "etcd":
if resources["disk_gb"] < min_etcd_disk_size:
return None, err.format("disk_gb", min_etcd_disk_size)
else:
if resources["disk_gb"] < min_disk_size:
return None, err.format("disk_gb", min_disk_size)
return resources, None

0 comments on commit fb30a68

Please sign in to comment.