File tree Expand file tree Collapse file tree 5 files changed +18
-0
lines changed Expand file tree Collapse file tree 5 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ RUN clean-install libsystemd0 bash
21
21
RUN test -h /etc/localtime && rm -f /etc/localtime && cp /usr/share/zoneinfo/UTC /etc/localtime || true
22
22
23
23
ADD ./bin/node-problem-detector /node-problem-detector
24
+
25
+ # Below command depends on ENABLE_JOURNAL=1.
24
26
ADD ./bin/log-counter /home/kubernetes/bin/log-counter
27
+
25
28
ADD config /config
26
29
ENTRYPOINT ["/node-problem-detector", "--system-log-monitors=/config/kernel-monitor.json"]
Original file line number Diff line number Diff line change @@ -84,12 +84,16 @@ version:
84
84
@echo $(VERSION )
85
85
86
86
./bin/log-counter : $(PKG_SOURCES )
87
+ ifeq ($(ENABLE_JOURNALD ) , 1)
87
88
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GO111MODULE=on go build \
88
89
-mod vendor \
89
90
-o bin/log-counter \
90
91
-ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \
91
92
-tags "$(BUILD_TAGS)" \
92
93
cmd/logcounter/log_counter.go
94
+ else
95
+ echo "Warning: log-counter requires journald, skipping."
96
+ endif
93
97
94
98
./bin/node-problem-detector : $(PKG_SOURCES )
95
99
CGO_ENABLED=$(CGO_ENABLED ) GOOS=linux GO111MODULE=on go build \
@@ -101,6 +105,11 @@ version:
101
105
102
106
Dockerfile : Dockerfile.in
103
107
sed -e ' s|@BASEIMAGE@|$(BASEIMAGE)|g' $< > $@
108
+ ifneq ($(ENABLE_JOURNALD ) , 1)
109
+ sed -i '/Below command depends on ENABLE_JOURNAL=1/,+2d' $@
110
+ echo "Warning: log-counter requires journald, skipping."
111
+ endif
112
+
104
113
105
114
test : vet fmt
106
115
GO111MODULE=on go test -mod vendor -timeout=1m -v -race -short -tags " $( BUILD_TAGS) " ./...
Original file line number Diff line number Diff line change
1
+ // +build journald
2
+
1
3
/*
2
4
Copyright 2018 The Kubernetes Authors All rights reserved.
3
5
Original file line number Diff line number Diff line change
1
+ // +build journald
2
+
1
3
/*
2
4
Copyright 2018 The Kubernetes Authors All rights reserved.
3
5
Original file line number Diff line number Diff line change
1
+ // +build journald
2
+
1
3
/*
2
4
Copyright 2018 The Kubernetes Authors All rights reserved.
3
5
You can’t perform that action at this time.
0 commit comments