From 9faef4af8579792a17278edaae99da01f4112682 Mon Sep 17 00:00:00 2001 From: miampf Date: Wed, 20 Mar 2024 16:46:24 +0100 Subject: [PATCH] better logging of measurements in upgradecheck --- cli/internal/cmd/upgradecheck.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli/internal/cmd/upgradecheck.go b/cli/internal/cmd/upgradecheck.go index a4c4dc1b2e..7c8f9de376 100644 --- a/cli/internal/cmd/upgradecheck.go +++ b/cli/internal/cmd/upgradecheck.go @@ -8,6 +8,7 @@ package cmd import ( "context" + "encoding/hex" "errors" "fmt" "io" @@ -364,7 +365,15 @@ func (v *versionCollector) newMeasurements(ctx context.Context, csp cloudprovide } upgrades[shortPath] = measurements } - v.log.Debug(fmt.Sprintf("Compatible image measurements are %v", upgrades)) + compatibleMeasurements := "" + for path, measurements := range upgrades { + compatibleMeasurement := "" + for i, measurement := range measurements { + compatibleMeasurement += fmt.Sprintf("\t\t%d: 0x%s\n", i, hex.EncodeToString(measurement.Expected)) + } + compatibleMeasurements += fmt.Sprintf("\t%q:\n%s", path, compatibleMeasurement) + } + v.log.Debug(fmt.Sprintf("Compatible image measurements are:\n%s", compatibleMeasurements)) return upgrades, nil }