diff --git a/command/snapshot/inspect/formatter.go b/command/snapshot/inspect/formatter.go index c8c308b5f9..1258fb8502 100644 --- a/command/snapshot/inspect/formatter.go +++ b/command/snapshot/inspect/formatter.go @@ -48,25 +48,25 @@ func (_ *prettyFormatter) Format(info *OutputFormat) (string, error) { fmt.Fprintf(tw, "\n Term\t%d", info.Meta.Term) fmt.Fprintf(tw, "\n Version\t%d", info.Meta.Version) fmt.Fprintf(tw, "\n") - fmt.Fprintln(tw, "\n Type\tCount\tSize\t") - fmt.Fprintf(tw, " %s\t%s\t%s\t", "----", "----", "----") + fmt.Fprintln(tw, "\n Type\tCount\tSize") + fmt.Fprintf(tw, " %s\t%s\t%s", "----", "----", "----") // For each different type generate new output for _, s := range info.Stats { - fmt.Fprintf(tw, "\n %s\t%d\t%s\t", s.Name, s.Count, ByteSize(uint64(s.Sum))) + fmt.Fprintf(tw, "\n %s\t%d\t%s", s.Name, s.Count, ByteSize(uint64(s.Sum))) } - fmt.Fprintf(tw, "\n %s\t%s\t%s\t", "----", "----", "----") - fmt.Fprintf(tw, "\n Total\t\t%s\t", ByteSize(uint64(info.TotalSize))) + fmt.Fprintf(tw, "\n %s\t%s\t%s", "----", "----", "----") + fmt.Fprintf(tw, "\n Total\t\t%s", ByteSize(uint64(info.TotalSize))) if info.StatsKV != nil { fmt.Fprintf(tw, "\n") - fmt.Fprintln(tw, "\n Key Name\tCount\tSize\t") - fmt.Fprintf(tw, " %s\t%s\t%s\t", "----", "----", "----") + fmt.Fprintln(tw, "\n Key Name\tCount\tSize") + fmt.Fprintf(tw, " %s\t%s\t%s", "----", "----", "----") // For each different type generate new output for _, s := range info.StatsKV { - fmt.Fprintf(tw, "\n %s\t%d\t%s\t", s.Name, s.Count, ByteSize(uint64(s.Sum))) + fmt.Fprintf(tw, "\n %s\t%d\t%s", s.Name, s.Count, ByteSize(uint64(s.Sum))) } - fmt.Fprintf(tw, "\n %s\t%s\t%s\t", "----", "----", "----") - fmt.Fprintf(tw, "\n Total\t\t%s\t", ByteSize(uint64(info.TotalSizeKV))) + fmt.Fprintf(tw, "\n %s\t%s\t%s", "----", "----", "----") + fmt.Fprintf(tw, "\n Total\t\t%s", ByteSize(uint64(info.TotalSizeKV))) } if err := tw.Flush(); err != nil { diff --git a/command/snapshot/inspect/testdata/TestSnapshotInspectCommand.golden b/command/snapshot/inspect/testdata/TestSnapshotInspectCommand.golden index 00b9da4066..fc5af33af8 100644 --- a/command/snapshot/inspect/testdata/TestSnapshotInspectCommand.golden +++ b/command/snapshot/inspect/testdata/TestSnapshotInspectCommand.golden @@ -4,16 +4,16 @@ Term 2 Version 1 - Type Count Size - ---- ---- ---- - Register 3 1.7KB - ConnectCA 1 1.2KB - ConnectCAProviderState 1 1.1KB - Index 12 344B - Autopilot 1 199B - ConnectCAConfig 1 197B - FederationState 1 139B - SystemMetadata 1 68B - ChunkingState 1 12B - ---- ---- ---- + Type Count Size + ---- ---- ---- + Register 3 1.7KB + ConnectCA 1 1.2KB + ConnectCAProviderState 1 1.1KB + Index 12 344B + Autopilot 1 199B + ConnectCAConfig 1 197B + FederationState 1 139B + SystemMetadata 1 68B + ChunkingState 1 12B + ---- ---- ---- Total 5KB diff --git a/command/snapshot/inspect/testdata/TestSnapshotInspectEnhanceCommand.golden b/command/snapshot/inspect/testdata/TestSnapshotInspectEnhanceCommand.golden index 9867d8e5aa..d85f58ab44 100644 --- a/command/snapshot/inspect/testdata/TestSnapshotInspectEnhanceCommand.golden +++ b/command/snapshot/inspect/testdata/TestSnapshotInspectEnhanceCommand.golden @@ -4,15 +4,15 @@ Term 2 Version 1 - Type Count Size - ---- ---- ---- - Register 3 1.8KB - ConnectCA 1 1.2KB - ConnectCAProviderState 1 1.1KB - Index 11 313B - ConnectCAConfig 1 247B - Autopilot 1 199B - SystemMetadata 1 68B - ChunkingState 1 12B - ---- ---- ---- + Type Count Size + ---- ---- ---- + Register 3 1.8KB + ConnectCA 1 1.2KB + ConnectCAProviderState 1 1.1KB + Index 11 313B + ConnectCAConfig 1 247B + Autopilot 1 199B + SystemMetadata 1 68B + ChunkingState 1 12B + ---- ---- ---- Total 5KB diff --git a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommand.golden b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommand.golden index b16f6efd39..2986dcf923 100644 --- a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommand.golden +++ b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommand.golden @@ -4,24 +4,24 @@ Term 2 Version 1 - Type Count Size - ---- ---- ---- - KVS 27 12.3KB - Register 5 3.4KB - Index 11 285B - Autopilot 1 199B - Session 1 199B - CoordinateBatchUpdate 1 166B - Tombstone 2 146B - FederationState 1 139B - ChunkingState 1 12B - ---- ---- ---- - Total 16.8KB + Type Count Size + ---- ---- ---- + KVS 27 12.3KB + Register 5 3.4KB + Index 11 285B + Autopilot 1 199B + Session 1 199B + CoordinateBatchUpdate 1 166B + Tombstone 2 146B + FederationState 1 139B + ChunkingState 1 12B + ---- ---- ---- + Total 16.8KB - Key Name Count Size - ---- ---- ---- - vault/core 16 5.9KB - vault/sys 7 4.4KB - vault/logical 4 2KB - ---- ---- ---- + Key Name Count Size + ---- ---- ---- + vault/core 16 5.9KB + vault/sys 7 4.4KB + vault/logical 4 2KB + ---- ---- ---- Total 12.3KB diff --git a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommandNoDetailsFlag.golden b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommandNoDetailsFlag.golden index a962bd27bb..1ce433c3a3 100644 --- a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommandNoDetailsFlag.golden +++ b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsCommandNoDetailsFlag.golden @@ -4,41 +4,41 @@ Term 2 Version 1 - Type Count Size - ---- ---- ---- - KVS 27 12.3KB - Register 5 3.4KB - Index 11 285B - Autopilot 1 199B - Session 1 199B - CoordinateBatchUpdate 1 166B - Tombstone 2 146B - FederationState 1 139B - ChunkingState 1 12B - ---- ---- ---- - Total 16.8KB + Type Count Size + ---- ---- ---- + KVS 27 12.3KB + Register 5 3.4KB + Index 11 285B + Autopilot 1 199B + Session 1 199B + CoordinateBatchUpdate 1 166B + Tombstone 2 146B + FederationState 1 139B + ChunkingState 1 12B + ---- ---- ---- + Total 16.8KB - Key Name Count Size - ---- ---- ---- - vault/sys/policy 3 3.3KB - vault/logical/0989e79e-06cd-5374-c8c0-4c6d675bc1c9 3 1.8KB - vault/core/leader 1 1.6KB - vault/sys/token 3 1KB - vault/core/mounts 1 675B - vault/core/wrapping 1 633B - vault/core/local-mounts 1 450B - vault/core/auth 1 423B - vault/core/cluster 2 388B - vault/core/keyring 1 320B - vault/core/master 1 237B - vault/core/seal-config 1 211B - vault/logical/5c018b68-3573-41d3-0c33-04bce60cd6b0 1 210B - vault/core/hsm 1 189B - vault/core/local-audit 1 185B - vault/core/local-auth 1 183B - vault/core/audit 1 179B - vault/core/lock 1 170B - vault/core/shamir-kek 1 159B - vault/sys/counters 1 155B - ---- ---- ---- + Key Name Count Size + ---- ---- ---- + vault/sys/policy 3 3.3KB + vault/logical/0989e79e-06cd-5374-c8c0-4c6d675bc1c9 3 1.8KB + vault/core/leader 1 1.6KB + vault/sys/token 3 1KB + vault/core/mounts 1 675B + vault/core/wrapping 1 633B + vault/core/local-mounts 1 450B + vault/core/auth 1 423B + vault/core/cluster 2 388B + vault/core/keyring 1 320B + vault/core/master 1 237B + vault/core/seal-config 1 211B + vault/logical/5c018b68-3573-41d3-0c33-04bce60cd6b0 1 210B + vault/core/hsm 1 189B + vault/core/local-audit 1 185B + vault/core/local-auth 1 183B + vault/core/audit 1 179B + vault/core/lock 1 170B + vault/core/shamir-kek 1 159B + vault/sys/counters 1 155B + ---- ---- ---- Total 12.3KB diff --git a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthCommand.golden b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthCommand.golden index a962bd27bb..1ce433c3a3 100644 --- a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthCommand.golden +++ b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthCommand.golden @@ -4,41 +4,41 @@ Term 2 Version 1 - Type Count Size - ---- ---- ---- - KVS 27 12.3KB - Register 5 3.4KB - Index 11 285B - Autopilot 1 199B - Session 1 199B - CoordinateBatchUpdate 1 166B - Tombstone 2 146B - FederationState 1 139B - ChunkingState 1 12B - ---- ---- ---- - Total 16.8KB + Type Count Size + ---- ---- ---- + KVS 27 12.3KB + Register 5 3.4KB + Index 11 285B + Autopilot 1 199B + Session 1 199B + CoordinateBatchUpdate 1 166B + Tombstone 2 146B + FederationState 1 139B + ChunkingState 1 12B + ---- ---- ---- + Total 16.8KB - Key Name Count Size - ---- ---- ---- - vault/sys/policy 3 3.3KB - vault/logical/0989e79e-06cd-5374-c8c0-4c6d675bc1c9 3 1.8KB - vault/core/leader 1 1.6KB - vault/sys/token 3 1KB - vault/core/mounts 1 675B - vault/core/wrapping 1 633B - vault/core/local-mounts 1 450B - vault/core/auth 1 423B - vault/core/cluster 2 388B - vault/core/keyring 1 320B - vault/core/master 1 237B - vault/core/seal-config 1 211B - vault/logical/5c018b68-3573-41d3-0c33-04bce60cd6b0 1 210B - vault/core/hsm 1 189B - vault/core/local-audit 1 185B - vault/core/local-auth 1 183B - vault/core/audit 1 179B - vault/core/lock 1 170B - vault/core/shamir-kek 1 159B - vault/sys/counters 1 155B - ---- ---- ---- + Key Name Count Size + ---- ---- ---- + vault/sys/policy 3 3.3KB + vault/logical/0989e79e-06cd-5374-c8c0-4c6d675bc1c9 3 1.8KB + vault/core/leader 1 1.6KB + vault/sys/token 3 1KB + vault/core/mounts 1 675B + vault/core/wrapping 1 633B + vault/core/local-mounts 1 450B + vault/core/auth 1 423B + vault/core/cluster 2 388B + vault/core/keyring 1 320B + vault/core/master 1 237B + vault/core/seal-config 1 211B + vault/logical/5c018b68-3573-41d3-0c33-04bce60cd6b0 1 210B + vault/core/hsm 1 189B + vault/core/local-audit 1 185B + vault/core/local-auth 1 183B + vault/core/audit 1 179B + vault/core/lock 1 170B + vault/core/shamir-kek 1 159B + vault/sys/counters 1 155B + ---- ---- ---- Total 12.3KB diff --git a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthFilterCommand.golden b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthFilterCommand.golden index 881a10cfcd..7e048cc6a8 100644 --- a/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthFilterCommand.golden +++ b/command/snapshot/inspect/testdata/TestSnapshotInspectKVDetailsDepthFilterCommand.golden @@ -4,23 +4,23 @@ Term 2 Version 1 - Type Count Size - ---- ---- ---- - KVS 27 12.3KB - Register 5 3.4KB - Index 11 285B - Autopilot 1 199B - Session 1 199B - CoordinateBatchUpdate 1 166B - Tombstone 2 146B - FederationState 1 139B - ChunkingState 1 12B - ---- ---- ---- - Total 16.8KB + Type Count Size + ---- ---- ---- + KVS 27 12.3KB + Register 5 3.4KB + Index 11 285B + Autopilot 1 199B + Session 1 199B + CoordinateBatchUpdate 1 166B + Tombstone 2 146B + FederationState 1 139B + ChunkingState 1 12B + ---- ---- ---- + Total 16.8KB - Key Name Count Size - ---- ---- ---- - vault/logical/0989e79e-06cd-5374-c8c0-4c6d675bc1c9 3 1.8KB - vault/logical/5c018b68-3573-41d3-0c33-04bce60cd6b0 1 210B - ---- ---- ---- + Key Name Count Size + ---- ---- ---- + vault/logical/0989e79e-06cd-5374-c8c0-4c6d675bc1c9 3 1.8KB + vault/logical/5c018b68-3573-41d3-0c33-04bce60cd6b0 1 210B + ---- ---- ---- Total 2KB diff --git a/command/snapshot/inspect/testdata/pretty.golden b/command/snapshot/inspect/testdata/pretty.golden index 2a8d028ff4..a710fb6f98 100644 --- a/command/snapshot/inspect/testdata/pretty.golden +++ b/command/snapshot/inspect/testdata/pretty.golden @@ -4,14 +4,14 @@ Term 4 Version 1 - Type Count Size - ---- ---- ---- - msg 2 1B - ---- ---- ---- - Total 1B + Type Count Size + ---- ---- ---- + msg 2 1B + ---- ---- ---- + Total 1B - Key Name Count Size - ---- ---- ---- - msgKV 2 1B - ---- ---- ---- + Key Name Count Size + ---- ---- ---- + msgKV 2 1B + ---- ---- ---- Total 1B \ No newline at end of file