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

chore: add logger to packager2 list #3154

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
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
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