Skip to content

Commit

Permalink
Merge pull request #111 from laverya/include-precise-version-in-troub…
Browse files Browse the repository at this point in the history
…leshoot-version.yaml

include binary version info in 'version.yaml' troubleshoot file
  • Loading branch information
laverya authored Jan 8, 2020
2 parents d6b5ae9 + 0fcf473 commit 30f4d5e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
5 changes: 4 additions & 1 deletion 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 @@ -32,6 +32,9 @@ func writeVersionFile(path string) error {
version := troubleshootv1beta1.SupportBundleVersion{
ApiVersion: "troubleshoot.replicated.com/v1beta1",
Kind: "SupportBundle",
Spec: troubleshootv1beta1.SupportBundleVersionSpec{
VersionNumber: version.Version(),
},
}
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

type SupportBundleVersionSpec struct {
VersionNumber string `json:"versionNumber" yaml:"versionNumber"`
}

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"`
Spec SupportBundleVersionSpec `json:"spec" yaml:"spec"`
}
16 changes: 16 additions & 0 deletions pkg/apis/troubleshoot/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30f4d5e

Please sign in to comment.