Skip to content

Commit bc154e3

Browse files
authored
Merge pull request #138 from linki/read-only
Avoid writing klogs to the filesystem
2 parents d4bf952 + 4c5bbad commit bc154e3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ require (
1515
k8s.io/api v0.0.0-20190620084959-7cf5895f2711
1616
k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719
1717
k8s.io/client-go v0.0.0-20190620085101-78d2af792bab
18+
k8s.io/klog v0.3.1
1819
k8s.io/utils v0.0.0-20190607212802-c55fbcfc754a // indirect
1920
)

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"io/ioutil"
67
"math/rand"
78
"net/http"
89
_ "net/http/pprof"
@@ -22,6 +23,7 @@ import (
2223
"k8s.io/client-go/kubernetes"
2324
_ "k8s.io/client-go/plugin/pkg/client/auth"
2425
"k8s.io/client-go/tools/clientcmd"
26+
"k8s.io/klog"
2527

2628
"github.com/linki/chaoskube/chaoskube"
2729
"github.com/linki/chaoskube/terminator"
@@ -57,6 +59,7 @@ var (
5759

5860
func init() {
5961
rand.Seed(time.Now().UTC().UnixNano())
62+
klog.SetOutput(ioutil.Discard)
6063

6164
kingpin.Flag("labels", "A set of labels to restrict the list of affected pods. Defaults to everything.").StringVar(&labelString)
6265
kingpin.Flag("annotations", "A set of annotations to restrict the list of affected pods. Defaults to everything.").StringVar(&annString)

0 commit comments

Comments
 (0)