blob: 9bfced1900a6d720f7e80c23fedeea615ef31fd5 [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
EAPI=6
inherit eutils golang-vcs-snapshot toolchain-funcs systemd
EGO_PN="k8s.io/node-problem-detector"
DESCRIPTION="node-problem-detector"
HOMEPAGE="https://github.com/kubernetes/node-problem-detector"
SRC_URI="https://github.com/kubernetes/node-problem-detector/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="*"
IUSE=""
DEPEND="
sys-apps/systemd
"
RDEPEND="
sys-apps/systemd
"
S="${WORKDIR}/${P}/src/${EGO_PN}"
src_compile() {
export GOPATH="${WORKDIR}/${P}"
GO=$(tc-getGO)
export GO
go() {
echo "${GO} $@" 1>&2
"${GO}" "$@"
}
export -f go
emake VERSION="${PV}" bin/node-problem-detector
unset -f go
}
src_install() {
insinto /etc/node_problem_detector
doins "${FILESDIR}"/system-stats-monitor.json
doins "${FILESDIR}"/docker-monitor.json
doins "${FILESDIR}"/kernel-monitor.json
doins "${FILESDIR}"/stackdriver-exporter.json
doins "${FILESDIR}"/boot-disk-size-consistency-monitor.json
doins "${FILESDIR}"/known_modules.json
# add exec permission for to check boot disk size consistency
insopts -m0100
doins "${FILESDIR}"/check_boot_disk_size_consistency.sh
dosbin bin/node-problem-detector
systemd_dounit "${FILESDIR}"/node-problem-detector.service
}