Skip to content

Commit

Permalink
better logging of measurements in upgradecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Mar 20, 2024
1 parent daeaf92 commit 9faef4a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cli/internal/cmd/upgradecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package cmd

import (
"context"
"encoding/hex"
"errors"
"fmt"
"io"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 9faef4a

Please sign in to comment.