mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-30 02:28:48 -04:00
AB#2061 Self Documenting Config File (#143)
Move firewall up into root config, remove VPC config & autogenerate comments in config file.
This commit is contained in:
parent
cdfd962fcc
commit
b905c28515
20 changed files with 538 additions and 348 deletions
|
@ -6,7 +6,7 @@ import (
|
|||
"github.com/edgelesssys/constellation/internal/file"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cobra"
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/talos-systems/talos/pkg/machinery/config/encoder"
|
||||
)
|
||||
|
||||
func newConfigGenerateCmd() *cobra.Command {
|
||||
|
@ -38,7 +38,12 @@ func configGenerate(cmd *cobra.Command, fileHandler file.Handler) error {
|
|||
}
|
||||
|
||||
if flags.file == "-" {
|
||||
return yaml.NewEncoder(cmd.OutOrStdout()).Encode(config.Default())
|
||||
content, err := encoder.NewEncoder(config.Default()).Encode()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = cmd.OutOrStdout().Write(content)
|
||||
return err
|
||||
}
|
||||
|
||||
return fileHandler.WriteYAML(flags.file, config.Default(), 0o644)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue