diff --git a/.golangci.yaml b/.golangci.yaml index a866c5d..a4a6c34 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,4 +1,21 @@ linters-settings: + depguard: + rules: + main: + files: + - $all + - "!$test" + allow: + - $gostd + - github.com/pivotal + - github.com/spf13/cobra + - github.com/vmware-tanzu + - github.com/pkg/errors + - github.com/stern/stern + - github.com/fatih/color + - k8s.io + - knative.dev + - sigs.k8s.io goconst: min-len: 2 min-occurrences: 2 diff --git a/pkg/logs/runner.go b/pkg/logs/runner.go index 7d0224b..3f4f7fd 100644 --- a/pkg/logs/runner.go +++ b/pkg/logs/runner.go @@ -6,10 +6,11 @@ package logs import ( "context" "fmt" + "sync" + "github.com/pkg/errors" "github.com/stern/stern/stern" "k8s.io/client-go/kubernetes" - "sync" ) var tails = make(map[string]*stern.Tail) @@ -91,11 +92,10 @@ func Run(ctx context.Context, clientSet *kubernetes.Clientset, config *stern.Con if tail, ok := getTail(targetID); ok { if tail.IsActive() { continue - } else { - // fmt.Printf("::endgroup::\n") - tail.Close() - clearTail(targetID) } + // fmt.Printf("::endgroup::\n") + tail.Close() + clearTail(targetID) } // fmt.Printf("::group::%s\n", p.Container)