Skip to content

Commit

Permalink
enhance: Unify milvus version def
Browse files Browse the repository at this point in the history
Related to milvus-io#40216

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Feb 27, 2025
1 parent b2769fb commit 952b332
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cmd/milvus/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"go.uber.org/zap"

"github.com/milvus-io/milvus/pkg/v2/common"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/metrics"
"github.com/milvus-io/milvus/pkg/v2/util/hardware"
Expand Down Expand Up @@ -55,12 +56,12 @@ func (c *run) printBanner(w io.Writer) {
fmt.Fprintln(w, " /_/ /_/___/____/___/\\____/___/ ")
fmt.Fprintln(w)
fmt.Fprintln(w, "Welcome to Milvus!")
fmt.Fprintln(w, "Version: "+BuildTags)
fmt.Fprintln(w, "Version: "+common.Version.String())
fmt.Fprintln(w, "Built: "+BuildTime)
fmt.Fprintln(w, "GitCommit: "+GitCommit)
fmt.Fprintln(w, "GoVersion: "+GoVersion)
fmt.Fprintln(w)
metrics.BuildInfo.WithLabelValues(BuildTags, BuildTime, GitCommit).Set(1)
metrics.BuildInfo.WithLabelValues(common.Version.String(), BuildTime, GitCommit).Set(1)
}

func (c *run) printHardwareInfo(w io.Writer) {
Expand All @@ -82,7 +83,7 @@ func (c *run) injectVariablesToEnv() {
zap.Error(err))
}

err = os.Setenv(metricsinfo.GitBuildTagsEnvKey, BuildTags)
err = os.Setenv(metricsinfo.GitBuildTagsEnvKey, common.Version.String())
if err != nil {
log.Warn(fmt.Sprintf("failed to inject %s to environment variable", metricsinfo.GitBuildTagsEnvKey),
zap.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import semver "github.com/blang/semver/v4"
var Version semver.Version

func init() {
Version = semver.MustParse("2.4.2")
Version = semver.MustParse("2.6.0-dev")
}

0 comments on commit 952b332

Please sign in to comment.