Skip to content

Commit 30f4d5e

Browse files
authored
Merge pull request #111 from laverya/include-precise-version-in-troubleshoot-version.yaml
include binary version info in 'version.yaml' troubleshoot file
2 parents d6b5ae9 + 0fcf473 commit 30f4d5e

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

cmd/troubleshoot/cli/version.go

Lines changed: 4 additions & 1 deletion
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
},
@@ -32,6 +32,9 @@ func writeVersionFile(path string) error {
3232
version := troubleshootv1beta1.SupportBundleVersion{
3333
ApiVersion: "troubleshoot.replicated.com/v1beta1",
3434
Kind: "SupportBundle",
35+
Spec: troubleshootv1beta1.SupportBundleVersionSpec{
36+
VersionNumber: version.Version(),
37+
},
3538
}
3639
b, err := yaml.Marshal(version)
3740
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+
type SupportBundleVersionSpec struct {
4+
VersionNumber string `json:"versionNumber" yaml:"versionNumber"`
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+
Spec SupportBundleVersionSpec `json:"spec" yaml:"spec"`
611
}

pkg/apis/troubleshoot/v1beta1/zz_generated.deepcopy.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)