Add buildah script for test container

Signed-off-by: Ben Ridley <benridley29@gmail.com>
This commit is contained in:
ben 2020-09-27 17:52:23 +10:00 committed by Ben Ridley
parent 1d912faab6
commit ea5b925147
3 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
/data/ /data/
make_container.sh
/alertmanager /alertmanager
/amtool /amtool
*.yml *.yml

7
make_container.sh Executable file
View File

@ -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

2
notes.txt Normal file
View File

@ -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?