diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a3d52af1..4a145adcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ add_custom_target(coordinator ALL # add_custom_target(cli ALL - CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/constellation -buildvcs=false -tags=gcp -ldflags "-buildid='' -X github.com/edgelesssys/constellation/internal/constants.CliVersion=${PROJECT_VERSION}" + CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/constellation -buildvcs=false -tags=gcp -ldflags "-buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${PROJECT_VERSION}" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cli BYPRODUCTS constellation ) diff --git a/activation/cmd/main.go b/activation/cmd/main.go index c369641a1..d0de3bb09 100644 --- a/activation/cmd/main.go +++ b/activation/cmd/main.go @@ -25,7 +25,7 @@ func main() { klog.InitFlags(nil) flag.Parse() - klog.V(2).Infof("\nConstellation Node Activation Service\nVersion: %s\nRunning on: %s", constants.VersionInfo, *provider) + klog.V(2).Infof("\nConstellation Node Activation Service\nVersion: v%s\nRunning on: %s", constants.VersionInfo, *provider) handler := file.NewHandler(afero.NewOsFs()) diff --git a/cli/internal/cmd/version.go b/cli/internal/cmd/version.go index 8966e6de1..c38ae757c 100644 --- a/cli/internal/cmd/version.go +++ b/cli/internal/cmd/version.go @@ -13,7 +13,7 @@ func NewVersionCmd() *cobra.Command { Long: "Display version of this CLI.", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - cmd.Printf("CLI Version: v%s \n", constants.CliVersion) + cmd.Printf("CLI Version: v%s \n", constants.VersionInfo) }, } return cmd diff --git a/cli/internal/cmd/version_test.go b/cli/internal/cmd/version_test.go index 96240753c..00a3def91 100644 --- a/cli/internal/cmd/version_test.go +++ b/cli/internal/cmd/version_test.go @@ -21,5 +21,5 @@ func TestVersionCmd(t *testing.T) { s, err := io.ReadAll(b) assert.NoError(err) - assert.Contains(string(s), constants.CliVersion) + assert.Contains(string(s), constants.VersionInfo) } diff --git a/internal/constants/constants.go b/internal/constants/constants.go index 691de9d4c..096c3da2b 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -85,5 +85,5 @@ const ( WireguardAdminMTU = 1300 ) -// CliVersion is the version of the CLI. Left as a separate variable to allow override during build. -var CliVersion = "0.0.0" +// VersionInfo is the version of a binary. Left as a separate variable to allow override during build. +var VersionInfo = "0.0.0"