Skip to content

Commit 626ad82

Browse files
progress
1 parent cfb2d33 commit 626ad82

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

linode_api4/objects/lke.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Region,
1515
Type,
1616
)
17+
from linode_api4.objects.base import _flatten_request_body_recursive
1718
from linode_api4.util import drop_null_keys
1819

1920

@@ -193,6 +194,9 @@ class LKENodePool(DerivedBase):
193194
"tags": Property(mutable=True, unordered=True),
194195
"labels": Property(mutable=True),
195196
"taints": Property(mutable=True),
197+
# Enterprise-specific properties
198+
"k8s_version": Property(mutable=True),
199+
"update_strategy": Property(mutable=True),
196200
}
197201

198202
def _parse_raw_node(
@@ -404,6 +408,10 @@ def node_pool_create(
404408
node_count: int,
405409
labels: Optional[Dict[str, str]] = None,
406410
taints: List[Union[LKENodePoolTaint, Dict[str, Any]]] = None,
411+
k8s_version: Optional[
412+
Union[str, KubeVersion, TieredKubeVersion]
413+
] = None,
414+
update_strategy: Optional[str] = None,
407415
**kwargs,
408416
):
409417
"""
@@ -418,7 +426,13 @@ def node_pool_create(
418426
:param labels: A dict mapping labels to their values to apply to this pool.
419427
:type labels: Dict[str, str]
420428
:param taints: A list of taints to apply to this pool.
421-
:type taints: List of :any:`LKENodePoolTaint` or dict
429+
:type taints: List of :any:`LKENodePoolTaint` or dict.
430+
:param k8s_version: The Kubernetes version to use for this pool.
431+
NOTE: This field is specific to enterprise clusters.
432+
:type k8s_version: str, KubeVersion, or TieredKubeVersion
433+
:param update_strategy: The strategy to use when updating this node pool.
434+
NOTE: This field is specific to enterprise clusters.
435+
:type update_strategy: str
422436
:param kwargs: Any other arguments to pass to the API. See the API docs
423437
for possible values.
424438
@@ -428,6 +442,10 @@ def node_pool_create(
428442
params = {
429443
"type": node_type,
430444
"count": node_count,
445+
"labels": labels,
446+
"taints": taints,
447+
"k8s_version": k8s_version,
448+
"update_strategy": update_strategy,
431449
}
432450

433451
if labels is not None:
@@ -439,7 +457,9 @@ def node_pool_create(
439457
params.update(kwargs)
440458

441459
result = self._client.post(
442-
"{}/pools".format(LKECluster.api_endpoint), model=self, data=params
460+
"{}/pools".format(LKECluster.api_endpoint),
461+
model=self,
462+
data=drop_null_keys(_flatten_request_body_recursive(params)),
443463
)
444464
self.invalidate()
445465

test/unit/paths/tier_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from test.unit.base import ClientBaseCase
22

33

4-
54
class LKETierPathTest(ClientBaseCase):
65
"""
76
Tests methods of the LKETierPath

0 commit comments

Comments
 (0)