fix(cli): refuse to assume a name is free when the search page is full

This commit is contained in:
Hugo Durand
2026-09-22 16:28:51 -04:00
parent 1c5be315e4
commit 12e16f5fcb
2 changed files with 36 additions and 0 deletions
+6
View File
@@ -512,6 +512,12 @@ def find_deployment_by_name(
for resource in listed:
if resource.get("name") == name and resource.get("id"):
return ExistingDeployment(str(resource["id"]), _source_of(resource))
if len(listed) >= MAX_PAGE_SIZE:
raise click.ClickException(
"This workspace has more deployments than the CLI can search, so it "
f"cannot tell whether '{name}' already exists. Pass --deployment-id to "
"update an existing deployment."
)
return None