Use unified version constant in bootstrapper

This commit is contained in:
katexochen 2022-10-11 18:23:03 +02:00 committed by Paul Meyer
parent 39341e5f6b
commit e3e7fddf76
2 changed files with 3 additions and 4 deletions

View File

@ -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/

View File

@ -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()