diff --git a/src/cmd/connect.go b/src/cmd/connect.go index 8600d703a3..358a9e1ac3 100644 --- a/src/cmd/connect.go +++ b/src/cmd/connect.go @@ -11,6 +11,7 @@ import ( "github.com/zarf-dev/zarf/src/config/lang" "github.com/zarf-dev/zarf/src/pkg/cluster" + "github.com/zarf-dev/zarf/src/pkg/logger" "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) @@ -25,6 +26,8 @@ var connectCmd = &cobra.Command{ Short: lang.CmdConnectShort, Long: lang.CmdConnectLong, RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() + l := logger.From(ctx) target := "" if len(args) > 0 { target = args[0] @@ -38,8 +41,6 @@ var connectCmd = &cobra.Command{ return err } - ctx := cmd.Context() - var tunnel *cluster.Tunnel if target == "" { tunnel, err = c.ConnectTunnelInfo(ctx, zt) @@ -61,14 +62,12 @@ var connectCmd = &cobra.Command{ defer tunnel.Close() - // Dump the tunnel URL to the console for other tools to use. - fmt.Print(tunnel.FullURL()) - if cliOnly { spinner.Updatef(lang.CmdConnectEstablishedCLI, tunnel.FullURL()) + l.Info("Tunnel established, waiting for user to interrupt (ctrl-c to end)", "url", tunnel.FullURL()) } else { spinner.Updatef(lang.CmdConnectEstablishedWeb, tunnel.FullURL()) - + l.Info("Tunnel established, opening your default web browser (ctrl-c to end)", "url", tunnel.FullURL()) if err := exec.LaunchURL(tunnel.FullURL()); err != nil { return err } @@ -98,6 +97,9 @@ var connectListCmd = &cobra.Command{ if err != nil { return err } + // HACK: Re-initializing PTerm with a stderr writer isn't great, but it lets us render these + // tables for backwards compatibility + message.InitializePTerm(logger.DestinationDefault) message.PrintConnectStringTable(connections) return nil }, diff --git a/src/pkg/packager/prepare.go b/src/pkg/packager/prepare.go index 9dffa529b7..2a25239189 100644 --- a/src/pkg/packager/prepare.go +++ b/src/pkg/packager/prepare.go @@ -218,7 +218,7 @@ func (p *Packager) findImages(ctx context.Context) (map[string][]string, error) for idx, k := range manifest.Kustomizations { // Generate manifests from kustomizations and place in the package kname := fmt.Sprintf("kustomization-%s-%d.yaml", manifest.Name, idx) - // Use the temp folder because if "helpers.CreatePathAndCopy" is provider with the same path it will result in the file being empty + // Use the temp folder because if "helpers.CreatePathAndCopy" is provided with the same path it will result in the file being empty destination := filepath.Join(componentPaths.Temp, kname) if err := kustomize.Build(k, destination, manifest.KustomizeAllowAnyDirectory); err != nil { return nil, fmt.Errorf("unable to build the kustomization for %s: %w", k, err)