@@ -7,10 +7,12 @@ import (
77 "os"
88 "runtime"
99
10- clog "github.com/openshift/oc-mirror/v2/internal/pkg/log"
1110 "github.com/spf13/cobra"
11+ "k8s.io/apimachinery/pkg/version"
1212 "k8s.io/kubectl/pkg/util/templates"
1313 "sigs.k8s.io/yaml"
14+
15+ clog "github.com/openshift/oc-mirror/v2/internal/pkg/log"
1416)
1517
1618var (
3032 gitTreeState string
3133)
3234
33- type Info struct {
34- Major string `json:"major"`
35- Minor string `json:"minor"`
36- GitVersion string `json:"gitVersion"`
37- GitCommit string `json:"gitCommit"`
38- GitTreeState string `json:"gitTreeState"`
39- BuildDate string `json:"buildDate"`
40- GoVersion string `json:"goVersion"`
41- Compiler string `json:"compiler"`
42- Platform string `json:"platform"`
43- }
44-
4535type VersionOptions struct {
4636 Output string
4737 Short bool
@@ -50,7 +40,7 @@ type VersionOptions struct {
5040
5141// Version is a struct for version information
5242type Version struct {
53- ClientVersion * Info `json:"clientVersion,omitempty" yaml:"clientVersion,omitempty"`
43+ ClientVersion * version. Info `json:"clientVersion,omitempty" yaml:"clientVersion,omitempty"`
5444}
5545
5646func NewVersionCommand (log clog.PluggableLoggerInterface ) * cobra.Command {
@@ -126,8 +116,8 @@ func (o *VersionOptions) Run() error {
126116 return nil
127117}
128118
129- func Get () Info {
130- return Info {
119+ func Get () version. Info {
120+ return version. Info {
131121 Major : majorFromGit ,
132122 Minor : minorFromGit ,
133123 GitCommit : commitFromGit ,
0 commit comments