From 02aecf42e0c0ee8b0e8c8d01a1ce9ade55488d31 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Wed, 27 Nov 2024 07:52:21 -0800 Subject: [PATCH] chore: update toolbox build (#929) # Description Fix toolbox build ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --- Makefile | 3 +++ hack/tools/toolbox/go.mod | 4 ++-- hack/tools/toolbox/go.sum | 2 ++ hack/tools/toolbox/main.go | 11 +++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 hack/tools/toolbox/go.sum diff --git a/Makefile b/Makefile index 4868014c62..243edc41ff 100644 --- a/Makefile +++ b/Makefile @@ -341,6 +341,9 @@ kapinger-image: $(IMAGE_REGISTRY)/$(KAPINGER_IMAGE):$(TAG)-linux-amd64 \ $(IMAGE_REGISTRY)/$(KAPINGER_IMAGE):$(TAG)-linux-arm64 +toolbox: + docker buildx build --builder retina --platform linux/amd64 -t $(IMAGE_REGISTRY)/toolbox:$(TAG) -f ./hack/tools/toolbox/Dockerfile ./hack/tools/ --push + proto-gen: ## generate protobuf code docker build --platform=linux/amd64 \ -t $(IMAGE_REGISTRY)/$(RETINA_PROTO_IMAGE):$(RETINA_PLATFORM_TAG) \ diff --git a/hack/tools/toolbox/go.mod b/hack/tools/toolbox/go.mod index 31c4a5b76d..331c511831 100644 --- a/hack/tools/toolbox/go.mod +++ b/hack/tools/toolbox/go.mod @@ -2,6 +2,6 @@ module github.com/microsoft/retina/hack/tools/toolbox go 1.22.5 -replace github.com/microsoft/retina/hack/tools/toolbox/kapinger => ../kapinger +replace github.com/microsoft/retina/hack/tools/kapinger => ../kapinger -require github.com/microsoft/retina/hack/tools/toolbox/kapinger v0.0.0-00010101000000-000000000000 +require github.com/microsoft/retina/hack/tools/kapinger v0.0.0-20241101210114-ecdabdbf715f // indirect diff --git a/hack/tools/toolbox/go.sum b/hack/tools/toolbox/go.sum new file mode 100644 index 0000000000..0dadd120c9 --- /dev/null +++ b/hack/tools/toolbox/go.sum @@ -0,0 +1,2 @@ +github.com/microsoft/retina/hack/tools/kapinger v0.0.0-20241101210114-ecdabdbf715f h1:zoYMjYLS/mdy2cFY8kUGhqVvY/+3YKjUFtu3namXcrY= +github.com/microsoft/retina/hack/tools/kapinger v0.0.0-20241101210114-ecdabdbf715f/go.mod h1:mdq2Z9SePF3lj4VRJV6cfzuSFfp0z7a/zlX2SsVtou4= diff --git a/hack/tools/toolbox/main.go b/hack/tools/toolbox/main.go index 4cca6b50dc..926d4bda8b 100644 --- a/hack/tools/toolbox/main.go +++ b/hack/tools/toolbox/main.go @@ -1,7 +1,14 @@ package main -import "github.com/microsoft/retina/hack/tools/toolbox/kapinger/servers" +import ( + "context" + + "github.com/microsoft/retina/hack/tools/kapinger/config" + "github.com/microsoft/retina/hack/tools/kapinger/servers" +) func main() { - servers.StartAll() + cfg := config.LoadConfigFromEnv() + ctx := context.Background() + servers.StartAll(ctx, cfg) }