From 2058edb644349f47186343a7714c95b241c258bf Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Tue, 15 Sep 2026 11:03:07 +0200 Subject: [PATCH] add --postgres-version semver filter flag to 'postgres ls' --- cmd/postgres.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/postgres.go b/cmd/postgres.go index c11fdbea..62de13b6 100644 --- a/cmd/postgres.go +++ b/cmd/postgres.go @@ -356,6 +356,7 @@ postgres=# postgresListCmd.Flags().StringP("tenant", "", "", "tenant to filter [optional]") postgresListCmd.Flags().StringP("project", "", "", "project to filter [optional]") postgresListCmd.Flags().StringP("partition", "", "", "partition to filter [optional]") + postgresListCmd.Flags().StringP("postgres-version", "", "", "postgres version to filter [optional, semver filter]") postgresDemoteToStandbyCmd.Flags().BoolP("disable-loadbalancers", "", false, "disable connections with the public loadbalancer IP [optional]") postgresPromoteToPrimaryCmd.Flags().BoolP("disable-loadbalancers", "", false, "disable connections with the public loadbalancer IP [optional]") @@ -941,7 +942,7 @@ func readPostgresUpdateRequests(filename string) ([]models.V1PostgresUpdateReque } func (c *config) postgresFind() error { - if helper.AtLeastOneViperStringFlagGiven("id", "description", "tenant", "project", "partition") { + if helper.AtLeastOneViperStringFlagGiven("id", "description", "tenant", "project", "partition", "postgres-version") { params := database.NewFindPostgresParams() ifr := &models.V1PostgresFindRequest{} id := helper.ViperString("id") @@ -964,6 +965,10 @@ func (c *config) postgresFind() error { if partitionID != nil { ifr.PartitionID = *partitionID } + versionFilter := helper.ViperString("postgres-version") + if versionFilter != nil { + ifr.Version = *versionFilter + } params.SetBody(ifr) resp, err := c.cloud.Database.FindPostgres(params, nil)