Skip to content

Commit

Permalink
chore: add logger to packager2 list (#3154)
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
  • Loading branch information
mkcp authored Oct 29, 2024
1 parent affdb5b commit d61d099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ var packageListCmd = &cobra.Command{
})
}

// NOTE(mkcp): Renders table with message.
header := []string{"Package", "Version", "Components"}
// HACK(mkcp): Similar to `package inspect`, we do want to use message here but we have to make sure our feature
// flagging doesn't disable this. Nothing happens after this so it's safe, but still very hacky.
message.InitializePTerm(logger.DestinationDefault)
message.Table(header, packageData)

// Print out any unmarshalling errors
Expand Down
3 changes: 3 additions & 0 deletions src/pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

"github.com/avast/retry-go/v4"

"github.com/zarf-dev/zarf/src/pkg/logger"
"github.com/zarf-dev/zarf/src/pkg/message"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/tools/clientcmd"
Expand All @@ -40,8 +41,10 @@ type Cluster struct {

// NewClusterWithWait creates a new Cluster instance and waits for the given timeout for the cluster to be ready.
func NewClusterWithWait(ctx context.Context) (*Cluster, error) {
l := logger.From(ctx)
spinner := message.NewProgressSpinner("Waiting for cluster connection")
defer spinner.Stop()
l.Info("waiting for cluster connection")

c, err := NewCluster()
if err != nil {
Expand Down

0 comments on commit d61d099

Please sign in to comment.