diff --git a/cmd/ftl-controller/main.go b/cmd/ftl-controller/main.go index 50059394d7..86601ca847 100644 --- a/cmd/ftl-controller/main.go +++ b/cmd/ftl-controller/main.go @@ -41,6 +41,7 @@ func main() { kong.UsageOnError(), kong.Vars{"version": ftl.Version, "timestamp": time.Unix(t, 0).Format(time.RFC3339)}, ) + cli.ControllerConfig.SetDefaults() ctx := log.ContextWithLogger(context.Background(), log.Configure(os.Stderr, cli.LogConfig)) err = observability.Init(ctx, "ftl-controller", ftl.Version, cli.ObservabilityConfig) kctx.FatalIfErrorf(err, "failed to initialize observability") diff --git a/cmd/ftl/cmd_box_run.go b/cmd/ftl/cmd_box_run.go index 01528c8d4e..6197accdec 100644 --- a/cmd/ftl/cmd_box_run.go +++ b/cmd/ftl/cmd_box_run.go @@ -6,7 +6,6 @@ import ( "net/url" "time" - "github.com/alecthomas/kong" "github.com/jpillora/backoff" "golang.org/x/sync/errgroup" @@ -44,9 +43,7 @@ func (b *boxRunCmd) Run(ctx context.Context, projConfig projectconfig.Config) er Key: model.NewLocalControllerKey(0), DSN: b.DSN, } - if err := kong.ApplyDefaults(&config); err != nil { - return err - } + config.SetDefaults() // Start the controller. runnerPortAllocator, err := bind.NewBindAllocator(b.RunnerBase) diff --git a/cmd/ftl/cmd_serve.go b/cmd/ftl/cmd_serve.go index 1f985915fe..117712cd0a 100644 --- a/cmd/ftl/cmd_serve.go +++ b/cmd/ftl/cmd_serve.go @@ -14,7 +14,6 @@ import ( "time" "connectrpc.com/connect" - "github.com/alecthomas/kong" "github.com/alecthomas/types/optional" "golang.org/x/sync/errgroup" @@ -124,9 +123,7 @@ func (s *serveCmd) run(ctx context.Context, projConfig projectconfig.Config, ini Key: model.NewLocalControllerKey(i), DSN: dsn, } - if err := kong.ApplyDefaults(&config); err != nil { - return err - } + config.SetDefaults() config.ModuleUpdateFrequency = time.Second * 1 scope := fmt.Sprintf("controller%d", i)