From 9d24ac89caf1f8ce0757d4d25996b2f2a897e31e Mon Sep 17 00:00:00 2001 From: Fabian Ruff Date: Tue, 4 Jun 2019 10:01:31 +0200 Subject: [PATCH] Simplify regex --- Dockerfile | 4 ++-- main.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d51e3f47..9f24b0f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11 +FROM golang:1.11 AS builder WORKDIR /go/src/github.com/sapcc/kuberntes-oomkill-exporter ENV GO111MODULE=on \ @@ -16,7 +16,7 @@ FROM alpine:3.8 LABEL maintainer="jan.knipper@sap.com" RUN apk --no-cache add ca-certificates -COPY --from=0 /kubernetes-oomkill-exporter /kubernetes-oomkill-exporter +COPY --from=builder /kubernetes-oomkill-exporter /kubernetes-oomkill-exporter ENTRYPOINT ["/kubernetes-oomkill-exporter"] CMD ["-logtostderr"] diff --git a/main.go b/main.go index c9f2b2c5..27412732 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ import ( ) var ( - kmesgRE = regexp.MustCompile("/pod(\\w+\\-\\w+\\-\\w+\\-\\w+\\-\\w+)/([a-f0-9]+) killed as a result of limit of /kubepods") + kmesgRE = regexp.MustCompile(`/pod(\w+-\w+-\w+-\w+-\w+)/([a-f0-9]+) killed as a result of limit of /kubepods`) ) var (