cli: add default value to master-secret flag in recover

This commit is contained in:
Thomas Tendyck 2022-05-09 11:00:16 +02:00 committed by Thomas Tendyck
parent 19bd097864
commit 1872d52a49

View File

@ -34,7 +34,7 @@ func newRecoverCmd() *cobra.Command {
must(cmd.MarkFlagRequired("endpoint")) must(cmd.MarkFlagRequired("endpoint"))
cmd.Flags().String("disk-uuid", "", "disk UUID of the encrypted state disk (required)") cmd.Flags().String("disk-uuid", "", "disk UUID of the encrypted state disk (required)")
must(cmd.MarkFlagRequired("disk-uuid")) must(cmd.MarkFlagRequired("disk-uuid"))
cmd.Flags().String("master-secret", "", "path to base64 encoded master secret") cmd.Flags().String("master-secret", constants.MasterSecretFilename, "path to base64 encoded master secret")
return cmd return cmd
} }
@ -107,9 +107,6 @@ func parseRecoverFlags(cmd *cobra.Command, fileHandler file.Handler) (recoverFla
if err != nil { if err != nil {
return recoverFlags{}, err return recoverFlags{}, err
} }
if masterSecretPath == "" {
masterSecretPath = constants.MasterSecretFilename
}
masterSecret, err := readMasterSecret(fileHandler, masterSecretPath) masterSecret, err := readMasterSecret(fileHandler, masterSecretPath)
if err != nil { if err != nil {
return recoverFlags{}, err return recoverFlags{}, err