2020-03-06 03:00:18 +05:30
|
|
|
package version
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2020-10-07 11:12:31 -07:00
|
|
|
"github.com/kyverno/kyverno/pkg/version"
|
2020-03-06 03:00:18 +05:30
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2020-11-17 13:07:30 -08:00
|
|
|
// Command returns version command
|
2020-03-06 03:00:18 +05:30
|
|
|
func Command() *cobra.Command {
|
|
|
|
return &cobra.Command{
|
|
|
|
Use: "version",
|
|
|
|
Short: "Shows current version of kyverno",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
fmt.Printf("Version: %s\n", version.BuildVersion)
|
|
|
|
fmt.Printf("Time: %s\n", version.BuildTime)
|
|
|
|
fmt.Printf("Git commit ID: %s\n", version.BuildHash)
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|