Build with minimum Go version 1.18
Upgrade fsnotify to v1.5.4
Build tests:
Build all configmap-reload binaries
$ make clean cross out/configmap-reload
rm -rf out
GOARCH=amd64 GOOS=linux \
go build --installsuffix cgo -ldflags="-s -w -extldflags '-static'" -a \
-o out/configmap-reload-linux-amd64 configmap-reload.go
GOARCH=arm GOOS=linux \
go build --installsuffix cgo -ldflags="-s -w -extldflags '-static'" -a \
-o out/configmap-reload-linux-arm configmap-reload.go
GOARCH=arm64 GOOS=linux \
go build --installsuffix cgo -ldflags="-s -w -extldflags '-static'" -a \
-o out/configmap-reload-linux-arm64 configmap-reload.go
GOARCH=ppc64le GOOS=linux \
go build --installsuffix cgo -ldflags="-s -w -extldflags '-static'" -a \
-o out/configmap-reload-linux-ppc64le configmap-reload.go
GOARCH=s390x GOOS=linux \
go build --installsuffix cgo -ldflags="-s -w -extldflags '-static'" -a \
-o out/configmap-reload-linux-s390x configmap-reload.go
GOARCH=amd64 GOOS=darwin \
go build --installsuffix cgo -ldflags="-s -w -extldflags '-static'" -a \
-o out/configmap-reload-darwin-amd64 configmap-reload.go
GOARCH=amd64 GOOS=windows \
go build --installsuffix cgo -ldflags="-s -w -extldflags '-static'" -a \
-o out/configmap-reload-windows-amd64.exe configmap-reload.go
cp out/configmap-reload-linux-amd64 out/configmap-reload
Check binary
$ ./out/configmap-reload
2022/10/06 22:27:12 Missing volume-dir
2022/10/06 22:27:12
Usage of ./out/configmap-reload:
-volume-dir value
the config map volume directory to watch for updates; may be used multiple times
-web.listen-address string
Address to listen on for web interface and telemetry. (default ":9533")
-web.telemetry-path string
Path under which to expose metrics. (default "/metrics")
-webhook-method string
the HTTP method url to use to send the webhook (default "POST")
-webhook-retries int
the amount of times to retry the webhook reload request (default 1)
-webhook-status-code int
the HTTP status code indicating successful triggering of reload (default 200)
-webhook-url value
the url to send a request to when the specified config map volume directory has been updated
Publish docker image
$ make docker GOOS=linux GOARCH=amd64 DOCKER_IMAGE_TAG=v0.7.1-go118
docker build --build-arg BASEIMAGE=amd64/busybox:stable --build-arg BINARY=configmap-reload-linux-amd64 -t jimmidyson/configmap-reload:v0.7.1-go118-amd64 .
Sending build context to Docker daemon 69.31MB
...
Successfully built 800f3b3854ad
Successfully tagged jimmidyson/configmap-reload:v0.7.1-go118-amd64
Build with minimum Go version 1.18 Upgrade fsnotify to v1.5.4
Build tests:
Build all configmap-reload binaries
Check binary
Publish docker image
Functional tests
Downloaded prometheus helm charts to deploy on a K8s cluster https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus/templates/server/cm.yaml
Updated prometheus server config to point to the new configmap-reload docker image
Successfully deployed prometheus server with new docker image
Verified configmaps are updated inside the container when configmap is modified
Verified Go version
Follow-up PR could include: