Skip to content
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
k8s.io/apimachinery v0.33.3
k8s.io/cli-runtime v0.33.3
k8s.io/client-go v0.33.3
k8s.io/klog/v2 v2.140.0
k8s.io/kubectl v0.33.3
)

Expand Down Expand Up @@ -70,7 +71,6 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.33.3 // indirect
k8s.io/component-helpers v0.33.3 // indirect
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
Expand Down
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"hash/fnv"
"log"
"log/slog"
"os"
"os/exec"
"os/signal"
Expand All @@ -32,6 +33,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"

"k8s.io/klog/v2"
"k8s.io/kubectl/pkg/scheme"
)

Expand Down Expand Up @@ -92,7 +94,7 @@ func cmdMount() {
initKubeFlags()
kubeFlags.AddFlags(pflag.CommandLine)

debug := pflag.Bool("debug", false, "print debug data")
debug := pflag.Bool("debug", false, "enable verbose logging")
fsName := pflag.String("fsname", defaultFSName, "filesystem name")
cacheTTL := pflag.Duration("attr-ttl", attrTTL, "TTL for attribute and directory caches")

Expand Down Expand Up @@ -123,6 +125,12 @@ Flags:
pflag.PrintDefaults()
}
pflag.Parse()

if !*debug {
// Suppress client-go/klog output.
klog.SetSlogLogger(slog.New(slog.DiscardHandler))
}

logger = log.New(os.Stderr, *fsName+": ", log.LstdFlags|log.Lmsgprefix)

if pflag.NArg() != 1 {
Expand Down
Loading