mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
refactor(build): move build metadata to pkg/buildinfo (#4045)
Keep CLI binaries from importing pkg/api/config just for version strings by centralizing Commit/ReleaseTag/BinaryType/GoVersion in a tiny buildinfo package. Update ldflags targets and callers accordingly. Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
This commit is contained in:
+3
-3
@@ -7,7 +7,7 @@ import (
|
||||
distspec "github.com/opencontainers/distribution-spec/specs-go"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"zotregistry.dev/zot/v2/pkg/api/config"
|
||||
"zotregistry.dev/zot/v2/pkg/buildinfo"
|
||||
"zotregistry.dev/zot/v2/pkg/log"
|
||||
)
|
||||
|
||||
@@ -28,8 +28,8 @@ func NewPerfRootCmd() *cobra.Command {
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if showVersion {
|
||||
logger := log.NewLogger("info", "")
|
||||
logger.Info().Str("distribution-spec", distspec.Version).Str("commit", config.Commit).
|
||||
Str("binary-type", config.BinaryType).Str("go version", config.GoVersion).Msg("version")
|
||||
logger.Info().Str("distribution-spec", distspec.Version).Str("commit", buildinfo.Commit).
|
||||
Str("binary-type", buildinfo.BinaryType).Str("go version", buildinfo.GoVersion).Msg("version")
|
||||
}
|
||||
|
||||
if len(args) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user