mirror of https://github.com/knative/client.git
chore: Add version information of eventing (#495)
* chore: Add version information of eventing Adding sources.eventing.knative.dev to version info (the only eventing API) for now as this will be the first one used. * chore(version): Add grouping for API versions
This commit is contained in:
parent
d116fb9422
commit
48797269ed
|
|
@ -27,8 +27,13 @@ var BuildDate string
|
|||
var GitRevision string
|
||||
|
||||
// update this var as we add more deps
|
||||
var apiVersions = []string{
|
||||
var apiVersions = map[string][]string{
|
||||
"serving": {
|
||||
"serving.knative.dev/v1alpha1 (knative-serving v0.10.0)",
|
||||
},
|
||||
"eventing": {
|
||||
"sources.eventing.knative.dev/v1alpha1 (knative-eventing v0.10.0)",
|
||||
},
|
||||
}
|
||||
|
||||
// NewVersionCommand implements 'kn version' command
|
||||
|
|
@ -42,7 +47,12 @@ func NewVersionCommand(p *commands.KnParams) *cobra.Command {
|
|||
fmt.Fprintf(out, "Build Date: %s\n", BuildDate)
|
||||
fmt.Fprintf(out, "Git Revision: %s\n", GitRevision)
|
||||
fmt.Fprintf(out, "Supported APIs:\n")
|
||||
for _, api := range apiVersions {
|
||||
fmt.Fprintf(out, "* Serving\n")
|
||||
for _, api := range apiVersions["serving"] {
|
||||
fmt.Fprintf(out, " - %s\n", api)
|
||||
}
|
||||
fmt.Fprintf(out, "* Eventing\n")
|
||||
for _, api := range apiVersions["eventing"] {
|
||||
fmt.Fprintf(out, " - %s\n", api)
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -35,7 +35,10 @@ var versionOutputTemplate = `Version: {{.Version}}
|
|||
Build Date: {{.BuildDate}}
|
||||
Git Revision: {{.GitRevision}}
|
||||
Supported APIs:
|
||||
* Serving
|
||||
- serving.knative.dev/v1alpha1 (knative-serving v0.10.0)
|
||||
* Eventing
|
||||
- sources.eventing.knative.dev/v1alpha1 (knative-eventing v0.10.0)
|
||||
`
|
||||
|
||||
const (
|
||||
|
|
|
|||
Loading…
Reference in New Issue