From ea5b92514745a62b7c1edbf7673de74e9560d4d2 Mon Sep 17 00:00:00 2001 From: ben Date: Sun, 27 Sep 2020 17:52:23 +1000 Subject: [PATCH] Add buildah script for test container Signed-off-by: Ben Ridley --- .gitignore | 1 - make_container.sh | 7 +++++++ notes.txt | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 make_container.sh create mode 100644 notes.txt diff --git a/.gitignore b/.gitignore index 40c6a429..cb777178 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /data/ -make_container.sh /alertmanager /amtool *.yml diff --git a/make_container.sh b/make_container.sh new file mode 100755 index 00000000..8155d6e9 --- /dev/null +++ b/make_container.sh @@ -0,0 +1,7 @@ +#!/bin/sh +container=$(buildah from prom/alertmanager) +mnt=$(buildah mount $container) +CGO_ENABLED=0 go build -ldflags="-X 'main.Version=benny'" -o alertmanager cmd/alertmanager/main.go +cp -f ./alertmanager "${mnt}/bin/alertmanager" +buildah commit $container ben-am +buildah unmount $container \ No newline at end of file diff --git a/notes.txt b/notes.txt new file mode 100644 index 00000000..ad57096a --- /dev/null +++ b/notes.txt @@ -0,0 +1,2 @@ +- Unmarshalling is weird. Alertmanager has a status page that just marshalls config into a string. When I tried to use my library with it, it blew up because the timeinterval library hides many of its internal fields and thus they can't be marshalled. + I worked around this by creating a 'config.TimeInterval' concept. Real timeintervals can be created from this representation by re-unmarshalling maybe?