mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 07:45:27 -04:00
AB#2512 Config secrets via env var & config refactoring (#544)
* refactor measurements to use consistent types and less byte pushing * refactor: only rely on a single multierr dependency * extend config creation with envar support * document changes Signed-off-by: Fabian Kammel <fk@edgeless.systems>
This commit is contained in:
parent
80a801629e
commit
bb76a4e4c8
42 changed files with 932 additions and 791 deletions
28
cli/internal/cmd/configvalidation.go
Normal file
28
cli/internal/cmd/configvalidation.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
Copyright (c) Edgeless Systems GmbH
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"go.uber.org/multierr"
|
||||
)
|
||||
|
||||
func displayConfigValidationErrors(errWriter io.Writer, configError error) error {
|
||||
errs := multierr.Errors(configError)
|
||||
if errs != nil {
|
||||
fmt.Fprintln(errWriter, "Problems validating config file:")
|
||||
for _, err := range errs {
|
||||
fmt.Fprintln(errWriter, "\t"+err.Error())
|
||||
}
|
||||
fmt.Fprintln(errWriter, "Fix the invalid entries or generate a new configuration using `constellation config generate`")
|
||||
return errors.New("invalid configuration")
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue