From 1483210ad984e99b3ef50fb9174ba6799c6888e6 Mon Sep 17 00:00:00 2001 From: Quirin Vetterl <140174674+qrnvttrl@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:55:18 +0100 Subject: [PATCH] partitions in health check (#289) --- cmd/output/healthprinter.go | 23 +++++++++++++++++++++++ go.mod | 5 ++--- go.sum | 12 ++++-------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/cmd/output/healthprinter.go b/cmd/output/healthprinter.go index 68250d3c..dc3a5741 100644 --- a/cmd/output/healthprinter.go +++ b/cmd/output/healthprinter.go @@ -58,6 +58,29 @@ func (p HealthTablePrinter) PrintServices(services map[string]models.RestHealthR wide := []string{name, status, msg} p.addWideData(wide, s) p.addShortData(wide, s) + + i := 0 + for sname, sresult := range s.Services { + prefix := "├" + if i == len(s.Services)-1 { + prefix = "└" + } + prefix += "─╴" + + status := "unknown" + if sresult.Status != nil && *sresult.Status != "" { + status = *sresult.Status + } + msg := "" + if sresult.Message != nil && *sresult.Message != "" { + msg = *s.Message + } + + wide := []string{prefix + sname, status, msg} + p.addWideData(wide, s) + p.addShortData(wide, s) + i++ + } } p.render() diff --git a/go.mod b/go.mod index 57c90a93..3df29c0c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/fatih/color v1.16.0 github.com/fi-ts/accounting-go v0.9.1 - github.com/fi-ts/cloud-go v0.24.3 + github.com/fi-ts/cloud-go v0.25.0 github.com/gardener/gardener v1.73.2 github.com/gardener/machine-controller-manager v0.50.1 github.com/go-openapi/runtime v0.27.1 @@ -20,7 +20,7 @@ require ( github.com/jinzhu/now v1.1.5 github.com/metal-stack/duros-go v0.4.4 github.com/metal-stack/metal-go v0.28.0 - github.com/metal-stack/metal-lib v0.14.4 + github.com/metal-stack/metal-lib v0.15.0 github.com/metal-stack/updater v1.2.1 github.com/metal-stack/v v1.0.3 github.com/olekukonko/tablewriter v0.0.5 @@ -174,7 +174,6 @@ require ( go.opentelemetry.io/otel/metric v1.23.1 // indirect go.opentelemetry.io/otel/trace v1.23.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect golang.org/x/crypto v0.19.0 // indirect diff --git a/go.sum b/go.sum index 3f499c2b..de4dbc0c 100644 --- a/go.sum +++ b/go.sum @@ -100,8 +100,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fi-ts/accounting-go v0.9.1 h1:NFcsGg6l3tsK87khKgHQCtP242hiLsFYMPtKU+aX+Sg= github.com/fi-ts/accounting-go v0.9.1/go.mod h1:8ga8xix70wTxZNwdb0Ye4cEmL1miY6SeUio4vQLMBaI= -github.com/fi-ts/cloud-go v0.24.3 h1:3cFOzeW2gk+b2Hnkgji/3o8JE9fQZpW3RMXGT2u7KbI= -github.com/fi-ts/cloud-go v0.24.3/go.mod h1:FFod3G37QPbDDL7umk09EBAJocTSe68nY4gF6tOJSko= +github.com/fi-ts/cloud-go v0.25.0 h1:+jDIMoEJ6i8BmRtUrbm3Rgs35Sqe3El5RKKsMzBayMA= +github.com/fi-ts/cloud-go v0.25.0/go.mod h1:FFod3G37QPbDDL7umk09EBAJocTSe68nY4gF6tOJSko= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -307,8 +307,8 @@ github.com/metal-stack/duros-go v0.4.4 h1:fOiJZQRzqORcbG+aWLkEa+OPHSw2JktMUU5c8i github.com/metal-stack/duros-go v0.4.4/go.mod h1:ATc0yw+QWO5i68aJ0Pnc/8IidUZo4DBmFNIIZJrWkYg= github.com/metal-stack/metal-go v0.28.0 h1:rCRmUI0N3sPHHi0PKzqzoo1YiP2nDNDnbCBX7nz8FP8= github.com/metal-stack/metal-go v0.28.0/go.mod h1:Iw4xnzbtcn3qz7YaK0ekCAcLZUyz5E7e0ZCvJ5pX0gU= -github.com/metal-stack/metal-lib v0.14.4 h1:vm2868vcua6khoyWL7d0to8Hq5RayrjMse0FZTyWEec= -github.com/metal-stack/metal-lib v0.14.4/go.mod h1:Z3PAh8dkyWC4B19fXsu6EYwXXee0Lk9JZbjoHPLbDbc= +github.com/metal-stack/metal-lib v0.15.0 h1:3igW229htynXgJw9i7b71ZsW5AVDDOViv5yJzHSm25c= +github.com/metal-stack/metal-lib v0.15.0/go.mod h1:C2y2o2I4VQOc0lXbC2c+6WbL+3lcRfiV1TG/LpnpKrI= github.com/metal-stack/security v0.7.2 h1:kUdWej+a0+YPBGt4fT56Mu8cWX/tOjeKL/FWNlUuoe8= github.com/metal-stack/security v0.7.2/go.mod h1:dTidiZIEzZajwqizrOCTJbmjQSYVbe1tG52IoMlnKZo= github.com/metal-stack/updater v1.2.1 h1:8wWpzx+VHw8Pv6IJ+IUEqMr7g06TrrADvcWAFMZl/ZE= @@ -441,12 +441,8 @@ go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0 go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= go4.org/mem v0.0.0-20220726221520-4f986261bf13 h1:CbZeCBZ0aZj8EfVgnqQcYZgf0lpZ3H9rmp5nkDTAst8= go4.org/mem v0.0.0-20220726221520-4f986261bf13/go.mod h1:reUoABIJ9ikfM5sgtSF3Wushcza7+WeD01VB9Lirh3g= go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=