mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
fixed final issues
fixed format strings for slog
This commit is contained in:
parent
69556e84d9
commit
941889ade7
58 changed files with 191 additions and 2210 deletions
|
@ -84,7 +84,7 @@ func runRecover(cmd *cobra.Command, _ []string) error {
|
|||
if err := r.flags.parse(cmd.Flags()); err != nil {
|
||||
return err
|
||||
}
|
||||
r.log.Debug("Using flags: %+v", r.flags)
|
||||
r.log.Debug(fmt.Sprintf("Using flags: %+v", r.flags))
|
||||
return r.recover(cmd, fileHandler, 5*time.Second, &recoverDoer{log: r.log}, newDialer)
|
||||
}
|
||||
|
||||
|
@ -93,12 +93,12 @@ func (r *recoverCmd) recover(
|
|||
doer recoverDoerInterface, newDialer func(validator atls.Validator) *dialer.Dialer,
|
||||
) error {
|
||||
var masterSecret uri.MasterSecret
|
||||
r.log.Debug("Loading master secret file from %s", r.flags.pathPrefixer.PrefixPrintablePath(constants.MasterSecretFilename))
|
||||
r.log.Debug(fmt.Sprintf("Loading master secret file from %s", r.flags.pathPrefixer.PrefixPrintablePath(constants.MasterSecretFilename)))
|
||||
if err := fileHandler.ReadJSON(constants.MasterSecretFilename, &masterSecret); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r.log.Debug("Loading configuration file from %q", r.flags.pathPrefixer.PrefixPrintablePath(constants.ConfigFilename))
|
||||
r.log.Debug(fmt.Sprintf("Loading configuration file from %q", r.flags.pathPrefixer.PrefixPrintablePath(constants.ConfigFilename)))
|
||||
conf, err := config.New(fileHandler, constants.ConfigFilename, r.configFetcher, r.flags.force)
|
||||
var configValidationErr *config.ValidationError
|
||||
if errors.As(err, &configValidationErr) {
|
||||
|
@ -129,14 +129,14 @@ func (r *recoverCmd) recover(
|
|||
conf.UpdateMAAURL(stateFile.Infrastructure.Azure.AttestationURL)
|
||||
}
|
||||
|
||||
r.log.Debug("Creating aTLS Validator for %s", conf.GetAttestationConfig().GetVariant())
|
||||
r.log.Debug(fmt.Sprintf("Creating aTLS Validator for %s", conf.GetAttestationConfig().GetVariant()))
|
||||
validator, err := choose.Validator(conf.GetAttestationConfig(), warnLogger{cmd: cmd, log: r.log})
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating new validator: %w", err)
|
||||
}
|
||||
r.log.Debug("Created a new validator")
|
||||
doer.setDialer(newDialer(validator), endpoint)
|
||||
r.log.Debug("Set dialer for endpoint %s", endpoint)
|
||||
r.log.Debug(fmt.Sprintf("Set dialer for endpoint %s", endpoint))
|
||||
doer.setURIs(masterSecret.EncodeToURI(), uri.NoStoreURI)
|
||||
r.log.Debug("Set secrets")
|
||||
if err := r.recoverCall(cmd.Context(), cmd.OutOrStdout(), interval, doer); err != nil {
|
||||
|
@ -166,7 +166,7 @@ func (r *recoverCmd) recoverCall(ctx context.Context, out io.Writer, interval ti
|
|||
})
|
||||
}
|
||||
|
||||
r.log.Debug("Encountered error (retriable: %t): %s", retry, err)
|
||||
r.log.Debug(fmt.Sprintf("Encountered error (retriable: %t): %s", retry, err))
|
||||
return retry
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ func (r *recoverCmd) recoverCall(ctx context.Context, out io.Writer, interval ti
|
|||
fmt.Fprintln(out, "Pushed recovery key.")
|
||||
ctr++
|
||||
}
|
||||
r.log.Debug("Retry counter is %d", ctr)
|
||||
r.log.Debug(fmt.Sprintf("Retry counter is %d", ctr))
|
||||
if ctr > 0 {
|
||||
fmt.Fprintf(out, "Recovered %d control-plane nodes.\n", ctr)
|
||||
} else if grpcRetry.ServiceIsUnavailable(err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue