From 07c160f67c783c9e4f5e952e327de5930f785a41 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Wed, 3 Dec 2025 15:12:32 +0100 Subject: [PATCH] refactor oc runtime server from urfave/cli to spf13/cobra Signed-off-by: Christian Richter --- opencloud/pkg/command/server.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/opencloud/pkg/command/server.go b/opencloud/pkg/command/server.go index 8ed88f065..68f6aa018 100644 --- a/opencloud/pkg/command/server.go +++ b/opencloud/pkg/command/server.go @@ -6,22 +6,22 @@ import ( "github.com/opencloud-eu/opencloud/pkg/config" "github.com/opencloud-eu/opencloud/pkg/config/configlog" "github.com/opencloud-eu/opencloud/pkg/config/parser" - "github.com/urfave/cli/v2" + + "github.com/spf13/cobra" ) // Server is the entrypoint for the server command. -func Server(cfg *config.Config) *cli.Command { - return &cli.Command{ - Name: "server", - Usage: "start a fullstack server (runtime and all services in supervised mode)", - Category: "fullstack", - Before: func(c *cli.Context) error { +func Server(cfg *config.Config) *cobra.Command { + return &cobra.Command{ + Use: "server", + Short: "start a fullstack server (runtime and all services in supervised mode)", + PreRunE: func(cmd *cobra.Command, args []string) error { return configlog.ReturnError(parser.ParseConfig(cfg, false)) }, - Action: func(c *cli.Context) error { + RunE: func(cmd *cobra.Command, args []string) error { // Prefer the in-memory registry as the default when running in single-binary mode r := runtime.New(cfg) - return r.Start(c.Context) + return r.Start(cmd.Context()) }, } }