Skip to content

Commit 6acfe63

Browse files
committed
Merge github.com/stern/[email protected] into chore/merge-upstream
2 parents 6b1eea6 + ae7a33d commit 6acfe63

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

.goreleaser.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
builds:
23
- env:
34
- CGO_ENABLED=0

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ build:
55
go build -o dist/tailfin ./cmd/tailfin
66

77
TOOLS_BIN_DIR := $(CURDIR)/hack/tools/bin
8-
GORELEASER_VERSION ?= v1.25.1
8+
GORELEASER_VERSION ?= v2.3.2
99
GORELEASER := $(TOOLS_BIN_DIR)/goreleaser
1010
GOLANGCI_LINT_VERSION ?= v1.63.1
1111
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
1212
GORELEASER_FILTER_VERSION ?= v0.3.0
1313
GORELEASER_FILTER := $(TOOLS_BIN_DIR)/goreleaser-filter
1414

1515
$(GORELEASER):
16-
GOBIN=$(TOOLS_BIN_DIR) go install github.com/goreleaser/goreleaser@$(GORELEASER_VERSION)
16+
GOBIN=$(TOOLS_BIN_DIR) go install github.com/goreleaser/goreleaser/v2@$(GORELEASER_VERSION)
1717

1818
$(GOLANGCI_LINT):
1919
GOBIN=$(TOOLS_BIN_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

cmd/cmd.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ func (o *options) Validate() error {
168168
}
169169

170170
func (o *options) Run(cmd *cobra.Command) error {
171-
if err := o.setVerbosity(); err != nil {
172-
return err
173-
}
174171
if err := o.setColorList(); err != nil {
175172
return err
176173
}
@@ -673,6 +670,11 @@ func NewSternCmd(stream genericclioptions.IOStreams) (*cobra.Command, error) {
673670
Use: "stern pod-query",
674671
Short: "Tail multiple pods and containers from Kubernetes",
675672
RunE: func(cmd *cobra.Command, args []string) error {
673+
// klog's v flag should be initialized before creating a k8s client
674+
if err := o.setVerbosity(); err != nil {
675+
return err
676+
}
677+
676678
// Output version information and exit
677679
if o.version {
678680
outputVersionInfo(o.Out)

cmd/tailfincmd/cmd.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ func (o *options) Validate() error {
129129
}
130130

131131
func (o *options) Run(cmd *cobra.Command) error {
132-
if err := o.setVerbosity(); err != nil {
133-
return err
134-
}
135132
if err := o.setColorList(); err != nil {
136133
return err
137134
}
@@ -579,6 +576,10 @@ func NewTailfinCmd(streams IOStreams) (*cobra.Command, error) {
579576
Use: "tailfin container-query",
580577
Short: "Tail multiple docker containers",
581578
RunE: func(cmd *cobra.Command, args []string) error {
579+
if err := o.setVerbosity(); err != nil {
580+
return err
581+
}
582+
582583
// Output version information and exit
583584
if o.version {
584585
outputVersionInfo(o.Out)

0 commit comments

Comments
 (0)