Skip to content

Commit 1928f00

Browse files
committed
include binary version info in 'version.yaml' troubleshoot file
1 parent d6b5ae9 commit 1928f00

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

cmd/troubleshoot/cli/version.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func VersionCmd() *cobra.Command {
1818
Short: "Print the current version and exit",
1919
Long: `Print the current version and exit`,
2020
RunE: func(cmd *cobra.Command, args []string) error {
21-
fmt.Printf("Replicated Preflight %s\n", version.Version())
21+
fmt.Printf("Replicated Troubleshoot %s\n", version.Version())
2222

2323
return nil
2424
},
@@ -30,8 +30,9 @@ const VersionFilename = "version.yaml"
3030

3131
func writeVersionFile(path string) error {
3232
version := troubleshootv1beta1.SupportBundleVersion{
33-
ApiVersion: "troubleshoot.replicated.com/v1beta1",
34-
Kind: "SupportBundle",
33+
ApiVersion: "troubleshoot.replicated.com/v1beta1",
34+
Kind: "SupportBundle",
35+
VersionInfo: version.GetBuild(),
3536
}
3637
b, err := yaml.Marshal(version)
3738
if err != nil {

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
202202
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
203203
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
204204
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
205+
github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK9YM6zKx4D2qucQU=
205206
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
206207
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
207208
github.com/googleapis/gax-go/v2 v2.0.4 h1:hU4mGcQI4DaAYW+IbTun+2qEZVFxK0ySjQLTbS0VQKc=
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package v1beta1
22

3+
import (
4+
"github.com/replicatedhq/troubleshoot/pkg/version"
5+
)
6+
37
type SupportBundleVersion struct {
4-
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
5-
Kind string `json:"kind" yaml:"kind"`
8+
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
9+
Kind string `json:"kind" yaml:"kind"`
10+
VersionInfo version.Build `json:"versionInfo" yaml:"versionInfo"`
611
}

0 commit comments

Comments
 (0)