Skip to content

Commit 7293bf5

Browse files
sharanrajtkangasta
andauthored
feat(database): improve valkey support, remove redis support (#651)
Co-authored-by: Toni Kangas <toni.kangas@upcloud.com>
1 parent 16615a2 commit 7293bf5

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- In `kubernetes create`, allow waiting for cluster and its node-groups to reach running state with `--wait=all` flag. When using `--wait` or `--wait=cluster`, the command will wait only for the cluster to reach running state.
1313
- Add `account billing` command for listing billing details.
14+
- Add support for Valkey to `database show` and `database session list` commands.
15+
16+
### Removed
17+
18+
- Removed support for deprecated Redis service. This is treated as non-breaking change as all users have been migrated to Valkey.
1419

1520
## [3.26.0] - 2025-11-26
1621

internal/commands/base/base.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ func BuildCommands(rootCmd *cobra.Command, conf *config.Config) {
176176
{serviceName: "MySQL", serviceType: "mysql"},
177177
{serviceName: "OpenSearch", serviceType: "opensearch"},
178178
{serviceName: "PostgreSQL", serviceType: "pg"},
179-
{serviceName: "Redis", serviceType: "redis"},
180179
{serviceName: "Valkey", serviceType: "valkey"},
181180
} {
182181
typeCommand := commands.BuildCommand(databaseproperties.DBTypeCommand(i.serviceType, i.serviceName), propertiesCommand.Cobra(), conf)

internal/commands/database/session/list.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func (s *listCommand) Execute(exec commands.Executor, uuid string) (output.Outpu
6565
outputFn = mysql
6666
case upcloud.ManagedDatabaseServiceTypePostgreSQL:
6767
outputFn = pg
68-
case upcloud.ManagedDatabaseServiceTypeRedis: //nolint:staticcheck // To be removed when Redis support has been removed
69-
outputFn = redis
68+
case upcloud.ManagedDatabaseServiceTypeValkey:
69+
outputFn = valkey
7070
default:
7171
return nil, fmt.Errorf("session list not supported for database type %s", db.Type)
7272
}
@@ -156,10 +156,10 @@ func pg(sessions upcloud.ManagedDatabaseSessions) output.Output {
156156
}
157157
}
158158

159-
func redis(sessions upcloud.ManagedDatabaseSessions) output.Output {
159+
func valkey(sessions upcloud.ManagedDatabaseSessions) output.Output {
160160
rows := make([]output.TableRow, 0)
161161

162-
for _, session := range sessions.Redis { //nolint:staticcheck // To be removed when Redis support has been removed
162+
for _, session := range sessions.Valkey {
163163
rows = append(rows, output.TableRow{
164164
session.Id,
165165
session.Query,

internal/commands/database/show.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ func getVersion(db *upcloud.ManagedDatabase) string {
160160
return db.Metadata.OpenSearchVersion
161161
case "pg":
162162
return db.Metadata.PGVersion
163-
case "redis":
164-
return db.Metadata.RedisVersion //nolint:staticcheck // To be removed when Redis support has been removed
163+
case "valkey":
164+
return db.Metadata.ValkeyVersion
165165
}
166166
return ""
167167
}

internal/commands/database/show_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ func TestGetVersion(t *testing.T) {
2828
Type: upcloud.ManagedDatabaseServiceTypePostgreSQL,
2929
Metadata: &upcloud.ManagedDatabaseMetadata{PGVersion: "15"},
3030
},
31+
}, {
32+
name: "valkey",
33+
expected: "8.1.5",
34+
db: &upcloud.ManagedDatabase{
35+
Type: upcloud.ManagedDatabaseServiceTypeValkey,
36+
Metadata: &upcloud.ManagedDatabaseMetadata{ValkeyVersion: "8.1.5"},
37+
},
3138
},
3239
} {
3340
t.Run(test.name, func(t *testing.T) {

0 commit comments

Comments
 (0)