Skip to content

Conversation

@rammanoj
Copy link
Contributor

📝 Description

What does this PR do and why is this change necessary?

  • Make node_pools argument in cluster_create optional for LKE-E clusters.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

  • Create a standard cluster with below code and ensure that it fails with valueError
from linode_api4 import LinodeClient
from linode_api4.objects import LKECluster, LKENodePool

# creating for a new pool
client = LinodeClient("<token>", "https://api.linode.com/v4beta")
cluster = client.lke.cluster_create(
    label="demo-lke-cluster-pythons",
    region="us-ord",
    kube_version="v1.32",  # optional but recommended
    tier="standard")
print(f"Created cluster with ID: {cluster.id}")

# Output:
(lke-tools) ➜  tmp_python python3 main.py
Traceback (most recent call last):
  File "/Users/rpotla/Desktop/Codebase/test/tmp_python/main.py", line 6, in <module>
    cluster = client.lke.cluster_create(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rpotla/Envs/lke-tools/lib/python3.12/site-packages/linode_api4/groups/lke.py", line 124, in cluster_create
    raise ValueError("LKE standard clusters must have at least one node pool.")
ValueError: LKE standard clusters must have at least one node pool.
  • Create a enterprise cluster with below code and ensure that if suceeds.
from linode_api4 import LinodeClient
from linode_api4.objects import LKECluster, LKENodePool

# creating for a new pool
client = LinodeClient("<token>", "https://api.linode.com/v4beta")
cluster = client.lke.cluster_create(
    label="demo-lke-cluster-pythons",
    region="us-ord",
    kube_version="v1.31.9+lke7",  # optional but recommended
    tier="enterprise")
print(f"Created cluster with ID: {cluster.id}")

# Outputs:
(lke-tools) ➜  tmp_python python3 main.py 
Created cluster with ID: 551042

@rammanoj rammanoj requested a review from a team as a code owner December 30, 2025 17:05
@rammanoj rammanoj requested review from jriddle-linode and vshanthe and removed request for a team December 30, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants