mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Merge pull request #1251 from filbranden/version_string1
Use just GitVersion for the -version output
This commit is contained in:
commit
9ffe6c05dc
@ -16,10 +16,6 @@ limitations under the License.
|
|||||||
|
|
||||||
package version
|
package version
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Info contains versioning information.
|
// Info contains versioning information.
|
||||||
// TODO: Add []string of api versions supported? It's still unclear
|
// TODO: Add []string of api versions supported? It's still unclear
|
||||||
// how we'll want to distribute that information.
|
// how we'll want to distribute that information.
|
||||||
@ -47,9 +43,5 @@ func Get() Info {
|
|||||||
|
|
||||||
// String returns info as a human-friendly version string.
|
// String returns info as a human-friendly version string.
|
||||||
func (info Info) String() string {
|
func (info Info) String() string {
|
||||||
commit := info.GitCommit
|
return info.GitVersion
|
||||||
if commit == "" {
|
|
||||||
commit = "(unknown)"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("version %s.%s, build %s", info.Major, info.Minor, commit)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user