diff --git a/Makefile b/Makefile index fee7568d..25c18612 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ NAMESPACE ?= tailing-sidecar-system RELEASE ?= tailing-sidecar HELM_CHART ?= helm/tailing-sidecar-operator KUTTL_CONFIG ?= kuttl-test.yaml +TAILING_SIDECAR ?= fluentbit all: markdownlint yamllint @@ -26,7 +27,7 @@ login-ecr: e2e: IMG="registry.localhost:5000/sumologic/tailing-sidecar-operator:test" e2e: TAILING_SIDECAR_IMG = "registry.localhost:5000/sumologic/tailing-sidecar:test" e2e: - $(MAKE) -C ./sidecar/fluentbit build TAG=$(TAILING_SIDECAR_IMG) + $(MAKE) -C ./sidecar/$(TAILING_SIDECAR) build-test-image TAG=$(TAILING_SIDECAR_IMG) $(MAKE) -C ./operator docker-build IMG=$(IMG) TAILING_SIDECAR_IMG=$(TAILING_SIDECAR_IMG) kubectl-kuttl test --config $(KUTTL_CONFIG) diff --git a/sidecar/fluentbit/Makefile b/sidecar/fluentbit/Makefile index 3a5f6498..9f466414 100755 --- a/sidecar/fluentbit/Makefile +++ b/sidecar/fluentbit/Makefile @@ -14,6 +14,8 @@ all: build push build: docker build --tag $(TAG) --file Dockerfile . +build-test-image: build + run: build docker run --rm -it \ -v $(DIR_TO_TAIL):/tmp/host \ diff --git a/sidecar/otelcol/Makefile b/sidecar/otelcol/Makefile index fe7f284b..810f52bc 100644 --- a/sidecar/otelcol/Makefile +++ b/sidecar/otelcol/Makefile @@ -5,7 +5,7 @@ GO ?= go OS ?= $(shell uname -s | tr A-Z a-z) ARCH ?= $(shell uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) -LOCALBIN ?= ./bin +LOCALBIN ?= $(shell pwd)/bin GORELEASER ?= $(LOCALBIN)/goreleaser @@ -15,6 +15,8 @@ BUILDER=$(BUILDER_BIN_PATH)/$(BUILDER_BIN_NAME) INSTALLED_VERSION := $(shell $(BUILDER) version 2>&1) +CONTAINER_REGISTRY := ghcr.io/sumologic/tailing-sidecar-otel + # go-get-tool will 'go get' any package $2 and install it to $1. PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) define go-get-tool @@ -57,6 +59,10 @@ endif build: ensure-correct-builder-version install-goreleaser @$(GORELEASER) release --snapshot --clean +.PHONY: build-test-image +build-test-image: build + docker tag $(CONTAINER_REGISTRY):latest-$(ARCH) $(TAG) + .PHONY: generate-sources generate-sources: $(BUILDER_BIN_NAME) \