File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,10 @@ tasks:
6868 -o /{{ .Docker.CurrentStage }}-darwin-amd64
6969 {{ else }}
7070 RUN GOOS=linux GOARCH=amd64 go build -a \
71- -ldflags "-s -w -X {{ index .Variables "versionPath" }}.Name=Client -X {{ index .Variables "versionPath" }}.Tag=none -X {{ index .Variables "versionPath" }}.SH ={{ .Git.SHA }}" \
71+ -ldflags "-s -w -X {{ index .Variables "versionPath" }}.Name=Client -X {{ index .Variables "versionPath" }}.Tag=none -X {{ index .Variables "versionPath" }}.SHA ={{ .Git.SHA }}" \
7272 -o /{{ .Docker.CurrentStage }}-linux-amd64
7373 RUN GOOS=darwin GOARCH=amd64 go build -a \
74- -ldflags "-s -w -X {{ index .Variables "versionPath" }}.Name=Client -X {{ index .Variables "versionPath" }}.Tag=none -X {{ index .Variables "versionPath" }}.SH ={{ .Git.SHA }}" \
74+ -ldflags "-s -w -X {{ index .Variables "versionPath" }}.Name=Client -X {{ index .Variables "versionPath" }}.Tag=none -X {{ index .Variables "versionPath" }}.SHA ={{ .Git.SHA }}" \
7575 -o /{{ .Docker.CurrentStage }}-darwin-amd64
7676 {{ end }}
7777 RUN chmod +x /{{ .Docker.CurrentStage }}-linux-amd64
Original file line number Diff line number Diff line change @@ -73,14 +73,21 @@ func ResolvConf(s string) (err error) {
7373// OSRelease renders a valid /etc/os-release file and writes it to disk. The
7474// node's OS Image field is reported by the node from /etc/os-release.
7575func OSRelease (s string ) (err error ) {
76+ var v string
77+ switch version .Tag {
78+ case "none" :
79+ v = version .SHA
80+ default :
81+ v = version .Tag
82+ }
7683 data := struct {
7784 Name string
7885 ID string
7986 Version string
8087 }{
8188 Name : version .Name ,
8289 ID : strings .ToLower (version .Name ),
83- Version : version . Tag ,
90+ Version : v ,
8491 }
8592
8693 tmpl , err := template .New ("" ).Parse (osReleaseTemplate )
You can’t perform that action at this time.
0 commit comments