cli: fix constellation verify depending on an initialized constellation-state.yaml file (#3184)

* Ignore missing state file if flags are provided
* Update verify docs to include requirement for config file

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2024-06-21 10:09:01 +02:00 committed by GitHub
parent e71819eb62
commit 09d19fec22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 5 deletions

View file

@ -138,10 +138,7 @@ func (c *verifyCmd) verify(cmd *cobra.Command, verifyClient verifyClient, config
stateFile, err := state.ReadFromFile(c.fileHandler, constants.StateFilename)
if err != nil {
return fmt.Errorf("reading state file: %w", err)
}
if err := stateFile.Validate(state.PostInit, conf.GetAttestationConfig().GetVariant()); err != nil {
return fmt.Errorf("validating state file: %w", err)
stateFile = state.New() // A state file is only required if the user has not provided IP or ID flags
}
ownerID, clusterID, err := c.validateIDFlags(cmd, stateFile)