diff --git a/Dockerfile.build b/Dockerfile.build index fb24b09fb..ee5f29ec1 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -25,7 +25,7 @@ FROM build AS build-bootstrapper WORKDIR /constellation/bootstrapper/ ARG PROJECT_VERSION -RUN go build -o bootstrapper -tags=disable_tpm_simulator -buildvcs=false -ldflags "-s -w -buildid='' -X main.version=${PROJECT_VERSION}" ./cmd/bootstrapper/ +RUN go build -o bootstrapper -tags=disable_tpm_simulator -buildvcs=false -ldflags "-s -w -buildid='' -X github.com/edgelesssys/constellation/v2/internal/constants.VersionInfo=${PROJECT_VERSION}" ./cmd/bootstrapper/ FROM build AS build-disk-mapper WORKDIR /constellation/disk-mapper/ diff --git a/bootstrapper/cmd/bootstrapper/run.go b/bootstrapper/cmd/bootstrapper/run.go index 77cae0a87..1cc9b9c90 100644 --- a/bootstrapper/cmd/bootstrapper/run.go +++ b/bootstrapper/cmd/bootstrapper/run.go @@ -17,14 +17,13 @@ import ( "github.com/edgelesssys/constellation/v2/bootstrapper/internal/logging" "github.com/edgelesssys/constellation/v2/bootstrapper/internal/nodelock" "github.com/edgelesssys/constellation/v2/internal/attestation/vtpm" + "github.com/edgelesssys/constellation/v2/internal/constants" "github.com/edgelesssys/constellation/v2/internal/file" "github.com/edgelesssys/constellation/v2/internal/grpc/dialer" "github.com/edgelesssys/constellation/v2/internal/logger" "go.uber.org/zap" ) -var version = "0.0.0" - func run(issuerWrapper initserver.IssuerWrapper, tpm vtpm.TPMOpenFunc, fileHandler file.Handler, kube clusterInitJoiner, metadata metadataAPI, bindIP, bindPort string, log *logger.Logger, @@ -32,7 +31,7 @@ func run(issuerWrapper initserver.IssuerWrapper, tpm vtpm.TPMOpenFunc, fileHandl ) { defer cloudLogger.Close() - log.With(zap.String("version", version)).Infof("Starting bootstrapper") + log.With(zap.String("version", constants.VersionInfo)).Infof("Starting bootstrapper") cloudLogger.Disclose("bootstrapper started running...") uuid, err := getDiskUUID()