From 3f03c6a8e68dc4f6cd91baa88a34a71e62ca52f4 Mon Sep 17 00:00:00 2001 From: Toni Kangas Date: Tue, 4 Feb 2025 11:26:16 +0200 Subject: [PATCH] chore(server): add plans section for cloud native plans (#373) --- CHANGELOG.md | 4 ++++ internal/commands/server/plan_list.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b5f01204..6ee70d244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added support for Valkey properties - Add termination_protection to upctl database show output +### Changed + +- List cloud native plans in their own section in human readable `server plans` output. + ## [3.14.0] - 2025-01-08 ### Added diff --git a/internal/commands/server/plan_list.go b/internal/commands/server/plan_list.go index b13661020..4809f8840 100644 --- a/internal/commands/server/plan_list.go +++ b/internal/commands/server/plan_list.go @@ -57,6 +57,7 @@ func (s *planListCommand) ExecuteWithoutArguments(exec commands.Executor) (outpu Value: plans, Output: output.Combined{ planSection("general_purpose", "General purpose", rows["general_purpose"]), + planSection("cloud_native", "Cloud native", rows["cloud_native"]), planSection("high_cpu", "High CPU", rows["high_cpu"]), planSection("high_memory", "High memory", rows["high_memory"]), planSection("developer", "Developer", rows["developer"]), @@ -74,6 +75,9 @@ func planType(p upcloud.Plan) string { if strings.HasPrefix(p.Name, "HIMEM-") { return "high_memory" } + if strings.HasPrefix(p.Name, "CLOUDNATIVE-") { + return "cloud_native" + } return "general_purpose" }