From 72acd71f9d9ebe12961636baade6e0817d3b52ef Mon Sep 17 00:00:00 2001 From: emmahardison <106281452+emmahardison@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:47:22 -0600 Subject: [PATCH] Adding a new binary for iSCSI node prep to trident, as well as the building of it in the Makefile and the packaging of it in the Dockerfile --- Dockerfile | 2 ++ Makefile | 9 ++++++++- cmd/node_prep/main.go | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 cmd/node_prep/main.go diff --git a/Dockerfile b/Dockerfile index 19df6a4f6..2a5218150 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,9 +22,11 @@ COPY --from=baseimage /nfs-deps/ / ARG BIN=trident_orchestrator ARG CLI_BIN=tridentctl ARG CHWRAP_BIN=chwrap.tar +ARG NODE_PREP_BIN=node_prep COPY ${BIN} /trident_orchestrator COPY ${CLI_BIN} /bin/tridentctl +COPY ${NODE_PREP_BIN} /node_prep ADD ${CHWRAP_BIN} / ENTRYPOINT ["/bin/tridentctl"] diff --git a/Makefile b/Makefile index 1839dedc7..89329563d 100644 --- a/Makefile +++ b/Makefile @@ -187,6 +187,11 @@ chwrap_build = $(call go_build,chwrap,./chwrap,$1,$2)\ && ./chwrap/make-tarball.sh $(call binary_path,chwrap,$1) $(call binary_path,chwrap.tar,$1)\ && rm -f $(call binary_path,chwrap,$1) +# node_prep_build is the go build command that compiles the node_prep binary from the source ./cmd/node_prep for +# the named platform +# usage: $(call node_prep_build,$(platform),$(linker_flags)) +node_prep_build = $(call go_build,node_prep,./cmd/node_prep, $1, $2) + # binaries_for_platform returns a script to build all binaries required for platform. The binaries are tridentctl, # trident_orchestrator, chwrap.tar, and trident_operator. chwrap.tar and trident_operator are only built for linux # plaforms. @@ -195,7 +200,8 @@ binaries_for_platform = $(call go_build,tridentctl,./cli,$1,$2)\ $(if $(findstring darwin,$1),,\ && $(call go_build,trident_orchestrator,.,$1,$2)\ $(if $(findstring linux,$1),\ - && $(call chwrap_build,$1,$2) )) + && $(call chwrap_build,$1,$2) \ + && $(call node_prep_build,$1,$2) )) # build_binaries_for_platforms returns a script to build all binaries for platforms. Attempts to add current directory # as a safe git directory, in case GO_SHELL uses a different user than the source repo. @@ -231,6 +237,7 @@ docker_build_linux = $1 build \ --build-arg ARCH=$(call arch,$2) \ --build-arg BIN=$(call binary_path,trident_orchestrator,$2) \ --build-arg CLI_BIN=$(call binary_path,tridentctl,$2) \ + --build-arg NODE_PREP_BIN=$(call binary_path,node_prep,$2) \ --build-arg CHWRAP_BIN=$(call binary_path,chwrap.tar,$2) \ --tag $3 \ --rm \ diff --git a/cmd/node_prep/main.go b/cmd/node_prep/main.go new file mode 100644 index 000000000..47d97e42d --- /dev/null +++ b/cmd/node_prep/main.go @@ -0,0 +1,7 @@ +// Copyright 2024 NetApp, Inc. All Rights Reserved. + +package main + +func main() { + println("Executing trident node prep") +}