mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-19 04:06:24 +00:00
Make log-counter respect ENABLE_JOURNALD
This commit is contained in:
@@ -21,6 +21,9 @@ RUN clean-install libsystemd0 bash
|
||||
RUN test -h /etc/localtime && rm -f /etc/localtime && cp /usr/share/zoneinfo/UTC /etc/localtime || true
|
||||
|
||||
ADD ./bin/node-problem-detector /node-problem-detector
|
||||
|
||||
# Below command depends on ENABLE_JOURNAL=1.
|
||||
ADD ./bin/log-counter /home/kubernetes/bin/log-counter
|
||||
|
||||
ADD config /config
|
||||
ENTRYPOINT ["/node-problem-detector", "--system-log-monitors=/config/kernel-monitor.json"]
|
||||
|
||||
@@ -84,12 +84,16 @@ version:
|
||||
@echo $(VERSION)
|
||||
|
||||
./bin/log-counter: $(PKG_SOURCES)
|
||||
ifeq ($(ENABLE_JOURNALD), 1)
|
||||
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GO111MODULE=on go build \
|
||||
-mod vendor \
|
||||
-o bin/log-counter \
|
||||
-ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \
|
||||
-tags "$(BUILD_TAGS)" \
|
||||
cmd/logcounter/log_counter.go
|
||||
else
|
||||
echo "Warning: log-counter requires journald, skipping."
|
||||
endif
|
||||
|
||||
./bin/node-problem-detector: $(PKG_SOURCES)
|
||||
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GO111MODULE=on go build \
|
||||
@@ -101,6 +105,11 @@ version:
|
||||
|
||||
Dockerfile: Dockerfile.in
|
||||
sed -e 's|@BASEIMAGE@|$(BASEIMAGE)|g' $< >$@
|
||||
ifneq ($(ENABLE_JOURNALD), 1)
|
||||
sed -i '/Below command depends on ENABLE_JOURNAL=1/,+2d' $@
|
||||
echo "Warning: log-counter requires journald, skipping."
|
||||
endif
|
||||
|
||||
|
||||
test: vet fmt
|
||||
GO111MODULE=on go test -mod vendor -timeout=1m -v -race -short -tags "$(BUILD_TAGS)" ./...
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// +build journald
|
||||
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors All rights reserved.
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// +build journald
|
||||
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors All rights reserved.
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// +build journald
|
||||
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors All rights reserved.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user