mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 15:55:24 -04:00
attestationconfigapi: revise upload frequency (#3238)
* Add attestationconfigapi compare command * Only upload the lowest version for each verify test --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
a6b0885f18
commit
6c24963570
8 changed files with 153 additions and 50 deletions
|
@ -7,6 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
@ -14,17 +15,17 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func isAttestationVariant(arg int) cobra.PositionalArgs {
|
||||
func arg0isAttestationVariant() cobra.PositionalArgs {
|
||||
return func(_ *cobra.Command, args []string) error {
|
||||
attestationVariant, err := variant.FromString(args[arg])
|
||||
attestationVariant, err := variant.FromString(args[0])
|
||||
if err != nil {
|
||||
return fmt.Errorf("argument %s isn't a valid attestation variant", args[arg])
|
||||
return errors.New("argument 0 isn't a valid attestation variant")
|
||||
}
|
||||
switch attestationVariant {
|
||||
case variant.AWSSEVSNP{}, variant.AzureSEVSNP{}, variant.AzureTDX{}, variant.GCPSEVSNP{}:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("argument %s isn't a supported attestation variant", args[arg])
|
||||
return errors.New("argument 0 isn't a supported attestation variant")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +33,7 @@ func isAttestationVariant(arg int) cobra.PositionalArgs {
|
|||
func isValidKind(arg int) cobra.PositionalArgs {
|
||||
return func(_ *cobra.Command, args []string) error {
|
||||
if kind := kindFromString(args[arg]); kind == unknown {
|
||||
return fmt.Errorf("argument %s isn't a valid kind", args[arg])
|
||||
return fmt.Errorf("argument %s isn't a valid kind: must be one of [%q, %q]", args[arg], attestationReport, guestFirmware)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue