-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
- Loading branch information
1 parent
486debd
commit 2e80328
Showing
9 changed files
with
396 additions
and
0 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
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 |
---|---|---|
|
@@ -4,5 +4,6 @@ go 1.20 | |
|
||
require ( | ||
github.com/google/go-cmp v0.5.9 | ||
k8s.io/apimachinery v0.28.4 | ||
sigs.k8s.io/yaml v1.4.0 | ||
) |
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,41 @@ | ||
package version | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
|
||
"k8s.io/apimachinery/pkg/version" | ||
) | ||
|
||
var ( | ||
// commitFromGit is a constant representing the source version that | ||
// generated this build. It should be set during build via -ldflags. | ||
commitFromGit string | ||
// versionFromGit is a constant representing the version tag that | ||
// generated this build. It should be set during build via -ldflags. | ||
versionFromGit = "unknown" | ||
// major version | ||
majorFromGit string | ||
// minor version | ||
minorFromGit string | ||
// build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
buildDate string | ||
// state of git tree, either "clean" or "dirty" | ||
gitTreeState string | ||
) | ||
|
||
// Get returns the overall codebase version. It's for detecting | ||
// what code a binary was built from. | ||
func Get() version.Info { | ||
return version.Info{ | ||
Major: majorFromGit, | ||
Minor: minorFromGit, | ||
GitCommit: commitFromGit, | ||
GitVersion: versionFromGit, | ||
GitTreeState: gitTreeState, | ||
BuildDate: buildDate, | ||
GoVersion: runtime.Version(), | ||
Compiler: runtime.Compiler, | ||
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
commitchecker/vendor/k8s.io/apimachinery/pkg/version/doc.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
commitchecker/vendor/k8s.io/apimachinery/pkg/version/helpers.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.