Skip to content

Commit

Permalink
include binary version info in 'version.yaml' troubleshoot file
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Jan 8, 2020
1 parent d6b5ae9 commit 1928f00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cmd/troubleshoot/cli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func VersionCmd() *cobra.Command {
Short: "Print the current version and exit",
Long: `Print the current version and exit`,
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Printf("Replicated Preflight %s\n", version.Version())
fmt.Printf("Replicated Troubleshoot %s\n", version.Version())

return nil
},
Expand All @@ -30,8 +30,9 @@ const VersionFilename = "version.yaml"

func writeVersionFile(path string) error {
version := troubleshootv1beta1.SupportBundleVersion{
ApiVersion: "troubleshoot.replicated.com/v1beta1",
Kind: "SupportBundle",
ApiVersion: "troubleshoot.replicated.com/v1beta1",
Kind: "SupportBundle",
VersionInfo: version.GetBuild(),
}
b, err := yaml.Marshal(version)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK9YM6zKx4D2qucQU=
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
github.com/googleapis/gax-go/v2 v2.0.4 h1:hU4mGcQI4DaAYW+IbTun+2qEZVFxK0ySjQLTbS0VQKc=
Expand Down
9 changes: 7 additions & 2 deletions pkg/apis/troubleshoot/v1beta1/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package v1beta1

import (
"github.com/replicatedhq/troubleshoot/pkg/version"
)

type SupportBundleVersion struct {
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
VersionInfo version.Build `json:"versionInfo" yaml:"versionInfo"`
}

0 comments on commit 1928f00

Please sign in to comment.