Skip to content

Commit

Permalink
Adding a new binary for iSCSI node prep to trident, as well as the bu…
Browse files Browse the repository at this point in the history
…ilding of it in the Makefile and the packaging of it in the Dockerfile
  • Loading branch information
emmahardison committed Aug 27, 2024
1 parent 510fe83 commit 72acd71
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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 \
Expand Down
7 changes: 7 additions & 0 deletions cmd/node_prep/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2024 NetApp, Inc. All Rights Reserved.

package main

func main() {
println("Executing trident node prep")
}

0 comments on commit 72acd71

Please sign in to comment.