From 34b6d8473167eacef4b4f1653798011d36819f77 Mon Sep 17 00:00:00 2001 From: Leo Loch Date: Wed, 8 Jul 2026 16:20:00 +0200 Subject: [PATCH 1/3] fix(kms): add delete-at field --- cmd/kms/key/key_show.go | 5 ++++- go.sum | 2 ++ pkg/output/outputter.go | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/kms/key/key_show.go b/cmd/kms/key/key_show.go index 4755321e8..74f918763 100644 --- a/cmd/kms/key/key_show.go +++ b/cmd/kms/key/key_show.go @@ -22,7 +22,8 @@ type KeyShowOutput struct { Rotation string `json:"rotation" validate:"required"` Usage string `json:"usage" validate:"required"` Source v3.GetKmsKeyResponseSource `json:"source" validate:"required"` - Description string `json:"description" validate:"required"` + Description string `json:"description,omitempty"` + DeleteAt time.Time `json:"delete-at,omitempty"` } func (o *KeyShowOutput) Type() string { return "KMS key" } @@ -80,7 +81,9 @@ func (c *KeyShowCmd) CmdRun(_ *cobra.Command, _ []string) error { Usage: string(resp.Usage), Source: resp.Source, Description: resp.Description, + DeleteAt: resp.DeleteAT, } + return c.OutputFunc(&out, nil) } diff --git a/go.sum b/go.sum index 4920c9865..0c036c8d7 100644 --- a/go.sum +++ b/go.sum @@ -175,6 +175,8 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/exoscale/egoscale/v3 v3.1.40 h1:OyDrJF8VpMrgcVJuiCrMoTxONnoVwYLF1pfJ5biqKKo= +github.com/exoscale/egoscale/v3 v3.1.40/go.mod h1:DUTgeubl5msPAo3SKFed04AxNhyTNOrCTJHZDRYLR10= github.com/exoscale/egoscale/v3 v3.1.42 h1:KlFDdm2ga1RdCdKuKlzJxLmgJjWVcDbJxF0t6FDswzw= github.com/exoscale/egoscale/v3 v3.1.42/go.mod h1:DUTgeubl5msPAo3SKFed04AxNhyTNOrCTJHZDRYLR10= github.com/exoscale/openapi-cli-generator v1.2.0 h1:xgTff1bInBP+JZCauD7Jq9GNBFoKK31Cnv5FIAcxtrk= diff --git a/pkg/output/outputter.go b/pkg/output/outputter.go index 683df1517..f1cf33f6f 100644 --- a/pkg/output/outputter.go +++ b/pkg/output/outputter.go @@ -8,6 +8,7 @@ import ( "reflect" "strings" "text/template" + "time" "github.com/exoscale/cli/table" v3 "github.com/exoscale/egoscale/v3" @@ -209,6 +210,11 @@ func Table(o interface{}) { label = l } + // If the field is a zero-value time.Time, skip displaying it entirely. + if ts, ok := v.Field(i).Interface().(time.Time); ok && ts.IsZero() { + continue + } + switch v.Field(i).Kind() { case reflect.Slice: // If the field value is a slice and is empty, print "n/a" instead of 0. From e47e63230a576c2a616ffe1de025eb3299423ad9 Mon Sep 17 00:00:00 2001 From: Leo Loch Date: Wed, 15 Jul 2026 11:54:11 +0200 Subject: [PATCH 2/3] always show delete-at field --- cmd/kms/key/key_show.go | 2 +- pkg/output/outputter.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/kms/key/key_show.go b/cmd/kms/key/key_show.go index 74f918763..677ca6fff 100644 --- a/cmd/kms/key/key_show.go +++ b/cmd/kms/key/key_show.go @@ -78,7 +78,7 @@ func (c *KeyShowCmd) CmdRun(_ *cobra.Command, _ []string) error { ReplicasStatus: formatReplicaStatus(resp.ReplicasStatus), Material: formatKeyMaterial(resp.Material), Rotation: formatKeyRotationConfig(resp.Rotation), - Usage: string(resp.Usage), + Usage: resp.Usage, Source: resp.Source, Description: resp.Description, DeleteAt: resp.DeleteAT, diff --git a/pkg/output/outputter.go b/pkg/output/outputter.go index f1cf33f6f..fe770dac3 100644 --- a/pkg/output/outputter.go +++ b/pkg/output/outputter.go @@ -210,8 +210,9 @@ func Table(o interface{}) { label = l } - // If the field is a zero-value time.Time, skip displaying it entirely. + // If the field is a zero-value time.Time, print "n/a". if ts, ok := v.Field(i).Interface().(time.Time); ok && ts.IsZero() { + tab.Append([]string{label, "n/a"}) continue } From 8fa16712d026b67ea780cae1547288a94acf5434 Mon Sep 17 00:00:00 2001 From: Leo Loch Date: Fri, 17 Jul 2026 09:53:16 +0200 Subject: [PATCH 3/3] fix go.sum --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 0c036c8d7..4920c9865 100644 --- a/go.sum +++ b/go.sum @@ -175,8 +175,6 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/exoscale/egoscale/v3 v3.1.40 h1:OyDrJF8VpMrgcVJuiCrMoTxONnoVwYLF1pfJ5biqKKo= -github.com/exoscale/egoscale/v3 v3.1.40/go.mod h1:DUTgeubl5msPAo3SKFed04AxNhyTNOrCTJHZDRYLR10= github.com/exoscale/egoscale/v3 v3.1.42 h1:KlFDdm2ga1RdCdKuKlzJxLmgJjWVcDbJxF0t6FDswzw= github.com/exoscale/egoscale/v3 v3.1.42/go.mod h1:DUTgeubl5msPAo3SKFed04AxNhyTNOrCTJHZDRYLR10= github.com/exoscale/openapi-cli-generator v1.2.0 h1:xgTff1bInBP+JZCauD7Jq9GNBFoKK31Cnv5FIAcxtrk=