From 004ef4cad21228d5593cd89473ec05e03da4982a Mon Sep 17 00:00:00 2001 From: Mohammed Affan Date: Wed, 20 Mar 2024 21:25:05 +0530 Subject: [PATCH] Add go-get-tool function in makefile of KubeArmorOperator Signed-off-by: Mohammed Affan --- pkg/KubeArmorOperator/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/KubeArmorOperator/Makefile b/pkg/KubeArmorOperator/Makefile index 495437ef3c..05a2982bbd 100644 --- a/pkg/KubeArmorOperator/Makefile +++ b/pkg/KubeArmorOperator/Makefile @@ -32,6 +32,15 @@ endif SHELL = /usr/bin/env bash -o pipefail .SHELLFLAGS = -ec +# Define a function to download a go tool if it is not installed. +define go-get-tool +@[ -f $(1) ] || { \ +set -e; \ +echo "Downloading $(2)" ;\ +go install $(2) ;\ +} +endef + .PHONY: all all: get snitch kubearmor-operator