Refine build-go.sh and update 'version' output

This commit is contained in:
Tomofumi Hayashi
2022-07-07 01:35:43 +09:00
parent 3cda380ad1
commit 99dd6678d5
5 changed files with 59 additions and 50 deletions

View File

@@ -51,9 +51,11 @@ const (
)
var (
version = "master@git"
commit = "unknown commit"
date = "unknown date"
version = "master@git"
commit = "unknown commit"
date = "unknown date"
gitTreeState = ""
releaseStatus = ""
)
var (
@@ -63,8 +65,7 @@ var (
// PrintVersionString ...
func PrintVersionString() string {
return fmt.Sprintf("multus-cni version:%s, commit:%s, date:%s",
version, commit, date)
return fmt.Sprintf("version:%s(%s%s), commit:%s, date:%s", version, gitTreeState, releaseStatus, commit, date)
}
func saveScratchNetConf(containerID, dataDir string, netconf []byte) error {