mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: add YAML support to server (#6934)
This commit is contained in:
@ -176,12 +176,12 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
|
||||
defer cancel()
|
||||
|
||||
if cfg.WriteConfig {
|
||||
// TODO: this should output to a file.
|
||||
n, err := opts.ToYAML()
|
||||
n, err := opts.MarshalYAML()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("generate yaml: %w", err)
|
||||
}
|
||||
enc := yaml.NewEncoder(inv.Stderr)
|
||||
enc := yaml.NewEncoder(inv.Stdout)
|
||||
enc.SetIndent(2)
|
||||
err = enc.Encode(n)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("encode yaml: %w", err)
|
||||
@ -193,6 +193,10 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
|
||||
return nil
|
||||
}
|
||||
|
||||
if cfg.Config != "" {
|
||||
cliui.Warnf(inv.Stderr, "YAML support is experimental and offers no compatibility guarantees.")
|
||||
}
|
||||
|
||||
// Print deprecation warnings.
|
||||
for _, opt := range opts {
|
||||
if opt.UseInstead == nil {
|
||||
|
Reference in New Issue
Block a user