-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update to go-libipni to latest * Include version information in /ready response. * Return status method no allowed when appropriate * Update release version
- Loading branch information
Showing
7 changed files
with
88 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.19-bullseye as build | ||
FROM golang:1.21-bullseye as build | ||
|
||
WORKDIR /go/src/caskadht | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package caskadht | ||
|
||
import ( | ||
_ "embed" | ||
"encoding/json" | ||
"runtime/debug" | ||
) | ||
|
||
var ( | ||
// Release is the release version tag value, e.g. "v1.2.3" | ||
Release string | ||
// Revision is the git commit hash. | ||
Revision string | ||
// Version is the full version string: Release-Revision. | ||
Version string | ||
// Modified indicates if the source tree had local modifications. | ||
Modified bool | ||
) | ||
|
||
//go:embed version.json | ||
var versionJSON []byte | ||
|
||
func init() { | ||
// Read version from embedded JSON file. | ||
var verMap map[string]string | ||
json.Unmarshal(versionJSON, &verMap) | ||
Release = verMap["version"] | ||
|
||
// If running from a module, try to get the build info. | ||
bi, ok := debug.ReadBuildInfo() | ||
if !ok { | ||
return | ||
} | ||
|
||
var found int | ||
|
||
// Append the revision to the version. | ||
for i := range bi.Settings { | ||
switch bi.Settings[i].Key { | ||
case "vcs.revision": | ||
Revision = bi.Settings[i].Value | ||
Version = Release + "-" + Revision | ||
found++ | ||
case "vcs.modified": | ||
Modified = bi.Settings[i].Value == "true" | ||
found++ | ||
} | ||
if found == 2 { | ||
break | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"version": "v0.0.2" | ||
"version": "v0.0.3" | ||
} |