cli: improve error handling for validator

This commit is contained in:
Nils Hanke 2023-03-22 16:53:01 +01:00 committed by Malte Poll
parent e130188ecd
commit 63d938d9a4
3 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ func UpdateInitMeasurements(config config.AttestationCfg, ownerID, clusterID str
// the current implementation does not support it, but can be changed if we decide to add support in the future // the current implementation does not support it, but can be changed if we decide to add support in the future
return updateMeasurementTDX(m, uint32(measurements.TDXIndexClusterID), clusterID) return updateMeasurementTDX(m, uint32(measurements.TDXIndexClusterID), clusterID)
default: default:
return fmt.Errorf("UpdateInitMeasurements: unknown attestation variant") return fmt.Errorf("selecting attestation variant: unknown attestation variant")
} }
} }

View File

@ -144,7 +144,7 @@ func (i *initCmd) initialize(cmd *cobra.Command, newDialer func(validator atls.V
i.log.Debugf("Creating aTLS Validator for %s", conf.GetAttestationConfig().GetVariant()) i.log.Debugf("Creating aTLS Validator for %s", conf.GetAttestationConfig().GetVariant())
validator, err := cloudcmd.NewValidator(cmd, conf.GetAttestationConfig(), i.log) validator, err := cloudcmd.NewValidator(cmd, conf.GetAttestationConfig(), i.log)
if err != nil { if err != nil {
return err return fmt.Errorf("creating new validator: %w", err)
} }
i.log.Debugf("Created a new validator") i.log.Debugf("Created a new validator")
serviceAccURI, err := i.getMarshaledServiceAccountURI(provider, conf, fileHandler) serviceAccURI, err := i.getMarshaledServiceAccountURI(provider, conf, fileHandler)

View File

@ -101,7 +101,7 @@ func (r *recoverCmd) recover(
r.log.Debugf("Creating aTLS Validator for %s", conf.GetAttestationConfig().GetVariant()) r.log.Debugf("Creating aTLS Validator for %s", conf.GetAttestationConfig().GetVariant())
validator, err := cloudcmd.NewValidator(cmd, conf.GetAttestationConfig(), r.log) validator, err := cloudcmd.NewValidator(cmd, conf.GetAttestationConfig(), r.log)
if err != nil { if err != nil {
return err return fmt.Errorf("creating new validator: %w", err)
} }
r.log.Debugf("Created a new validator") r.log.Debugf("Created a new validator")
doer.setDialer(newDialer(validator), flags.endpoint) doer.setDialer(newDialer(validator), flags.endpoint)