Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] #3919 : Added Output Format Option to flyte single start Command #4300

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 30 additions & 24 deletions cmd/single/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ func startAdmin(ctx context.Context, cfg Admin) error {
})
}

if !cfg.Disabled {
g.Go(func() error {
logger.Infof(ctx, "Starting Admin server...")
registry := plugins.NewAtomicRegistry(plugins.NewRegistry())
return adminServer.Serve(childCtx, registry.Load(), GetConsoleHandlers())
})
}
if !cfg.Disabled {
g.Go(func() error {
l ogger.Infof(ctx, "Starting Admin server...")
registry := plugins.NewAtomicRegistry(plugins.NewRegistry())
// Pass the output format to your function
return adminServer.Serve(childCtx, registry.Load(), GetConsoleHandlers(), outputFormat)
})
}


return g.Wait()
}

Expand Down Expand Up @@ -184,23 +187,26 @@ func startPropeller(ctx context.Context, cfg Propeller) error {
}

var startCmd = &cobra.Command{
Use: "start",
Short: "This command will start Flyte cluster locally",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
g, childCtx := errgroup.WithContext(ctx)
cfg := GetConfig()

if !cfg.Admin.Disabled {
g.Go(func() error {
err := startAdmin(childCtx, cfg.Admin)
if err != nil {
logger.Panicf(childCtx, "Failed to start Admin, err: %v", err)
return err
}
return nil
})
}
Use: "start",
Short: "This command will start Flyte cluster locally",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
g, childCtx := errgroup.WithContext(ctx)
cfg := GetConfig()

// Get the value of the --output flag
outputFormat, _ := cmd.Flags().GetString("output")

if !cfg.Admin.Disabled {
g.Go(func() error {
err := startAdmin(childCtx, cfg.Admin, outputFormat)
if err != nil {
logger.Panicf(childCtx, "Failed to start Admin, err: %v", err)
return err
}
return nil
})
}

if !cfg.Propeller.Disabled {
g.Go(func() error {
Expand Down