Skip to content

Commit e3eb5fa

Browse files
committed
fix(k8scluster): remove persistent storage if addons
Signed-off-by: Chris Snow <[email protected]>
1 parent c7e6d90 commit e3eb5fa

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

hpecp/k8s_cluster.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,6 @@ def create(
406406
"service_network_range": service_network_range,
407407
"pod_dns_domain": pod_dns_domain,
408408
"addons": addons,
409-
"persistent_storage": {
410-
"local": persistent_storage_local,
411-
"nimble_csi": persistent_storage_nimble_csi,
412-
},
413409
"k8shosts_config": [c.to_dict() for c in k8shosts_config],
414410
}
415411
if description is not None:
@@ -423,6 +419,15 @@ def create(
423419
if datafabric:
424420
data["datafabric"] = True
425421
data["datafabric_name"] = datafabric_name
422+
if len(addons) == 0:
423+
# TODO persistent storage was deprecated in 5.x?
424+
# check server version rather than addons
425+
data["persistent_storage"] = (
426+
{
427+
"local": persistent_storage_local,
428+
"nimble_csi": persistent_storage_nimble_csi,
429+
},
430+
)
426431

427432
response = self.client._request(
428433
url="/api/v2/k8scluster",

0 commit comments

Comments
 (0)